Skip to content

Commit

Permalink
Some little tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikQQY committed Dec 16, 2024
1 parent ae835bd commit fcb3ee1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
9 changes: 4 additions & 5 deletions lib/BoundaryValueDiffEqFIRK/src/firk.jl
Original file line number Diff line number Diff line change
Expand Up @@ -409,10 +409,9 @@ function __construct_nlproblem(cache::Union{FIRKCacheNested{iip}, FIRKCacheExpan

loss_bc = if iip
@closure (du, u, p) -> __firk_loss_bc!(
du, u, p, pt, cache.bc, cache.y, cache.mesh, cache, eval_sol)
du, u, p, pt, cache.bc, cache.y, cache.mesh, cache)
else
@closure (u, p) -> __firk_loss_bc(
u, p, pt, cache.bc, cache.y, cache.mesh, cache, eval_sol)
@closure (u, p) -> __firk_loss_bc(u, p, pt, cache.bc, cache.y, cache.mesh, cache)
end

loss_collocation = if iip
Expand Down Expand Up @@ -705,15 +704,15 @@ end
end

@views function __firk_loss_bc!(resid, u, p, pt, bc!::BC, y, mesh,
cache::Union{FIRKCacheNested, FIRKCacheExpand}, eval_sol) where {BC}
cache::Union{FIRKCacheNested, FIRKCacheExpand}) where {BC}
y_ = recursive_unflatten!(y, u)
eval_sol = EvalSol(__restructure_sol(y_, cache.in_size), mesh, cache)
eval_bc_residual!(resid, pt, bc!, eval_sol, p, mesh)
return nothing
end

@views function __firk_loss_bc(u, p, pt, bc!::BC, y, mesh,
cache::Union{FIRKCacheNested, FIRKCacheExpand}, eval_sol) where {BC}
cache::Union{FIRKCacheNested, FIRKCacheExpand}) where {BC}
y_ = recursive_unflatten!(y, u)
eval_sol = EvalSol(__restructure_sol(y_, cache.in_size), mesh, cache)
return eval_bc_residual(pt, bc!, eval_sol, p, mesh)
Expand Down
2 changes: 1 addition & 1 deletion lib/BoundaryValueDiffEqFIRK/src/interpolation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ end
cache.mesh, u, cache)

# Intermidiate solution for evaluating boundry conditions
# basically simplified version of the interpolation for MIRK
# basically simplified version of the interpolation for FIRK
# Expanded FIRK
function (s::EvalSol{C})(tval::Number) where {C <: FIRKCacheExpand}
(; t, u, cache) = s
Expand Down
2 changes: 1 addition & 1 deletion lib/BoundaryValueDiffEqMIRK/src/mirk.jl
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ end
end

@views function __mirk_loss(u, p, y, pt::TwoPointBVProblem, bc::Tuple{BC1, BC2},
mesh, cache, EvalSol) where {BC1, BC2}
mesh, cache, _) where {BC1, BC2}
y_ = recursive_unflatten!(y, u)
resid_co = Φ(cache, y_, u, p)
soly_ = VectorOfArray(y_)
Expand Down
2 changes: 1 addition & 1 deletion lib/BoundaryValueDiffEqMIRKN/src/interpolation.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Intermidiate solution for evaluating boundry conditions
# basically simplified version of the interpolation for MIRK
# basically simplified version of the linear interpolation for MIRKN
function (s::EvalSol{C})(tval::Number) where {C <: MIRKNCache}
(; t, u, cache) = s

Expand Down

0 comments on commit fcb3ee1

Please sign in to comment.