Skip to content

Commit

Permalink
Fix twopoint MIRK
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikQQY committed Dec 9, 2024
1 parent 9f18a3b commit cd9fe82
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/BoundaryValueDiffEqMIRK/src/mirk.jl
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,10 @@ end
y_ = recursive_unflatten!(y, u)
resids = [get_tmp(r, u) for r in residual]
Φ!(resids[2:end], cache, y_, u, p)
EvalSol.u[1:end] .= nodual_value(y_)
EvalSol.k_discrete[1:end] .= cache.k_discrete
soly_ = VectorOfArray(y_)
resida = resids[1][1:prod(cache.resid_size[1])]
residb = resids[1][(prod(cache.resid_size[1]) + 1):end]
eval_bc_residual!((resida, residb), pt, bc!, EvalSol, p, mesh)
eval_bc_residual!((resida, residb), pt, bc!, soly_, p, mesh)
recursive_flatten_twopoint!(resid, resids, cache.resid_size)
return nothing
end
Expand All @@ -278,9 +277,8 @@ end
mesh, cache, EvalSol) where {BC1, BC2}
y_ = recursive_unflatten!(y, u)
resid_co = Φ(cache, y_, u, p)
EvalSol.u[1:end] .= nodual_value(y_)
EvalSol.k_discrete[1:end] .= cache.k_discrete
resid_bca, resid_bcb = eval_bc_residual(pt, bc, EvalSol, p, mesh)
soly_ = VectorOfArray(y_)
resid_bca, resid_bcb = eval_bc_residual(pt, bc, soly_, p, mesh)
return vcat(resid_bca, mapreduce(vec, vcat, resid_co), resid_bcb)
end

Expand Down

0 comments on commit cd9fe82

Please sign in to comment.