Skip to content

Commit

Permalink
Shortcut __restructure_sol
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikQQY committed Dec 16, 2024
1 parent fcb3ee1 commit 87a1e10
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/BoundaryValueDiffEqCore/src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,11 @@ __vec_bc(sol, p, bc, u_size) = vec(bc(reshape(sol, u_size), p))

# Restructure Solution
function __restructure_sol(sol::AbstractVectorOfArray, u_size)
(size(first(sol)) == u_size) && return sol
return VectorOfArray(map(Base.Fix2(reshape, u_size), sol))
end
function __restructure_sol(sol::AbstractArray{<:AbstractArray}, u_size)
(size(first(sol)) == u_size) && return sol
return map(Base.Fix2(reshape, u_size), sol)
end

Expand Down

0 comments on commit 87a1e10

Please sign in to comment.