Skip to content

Commit

Permalink
Fix VectorOfArray lastindex
Browse files Browse the repository at this point in the history
Signed-off-by: ErikQQY <[email protected]>
  • Loading branch information
ErikQQY committed Aug 15, 2024
1 parent 5597128 commit 302832a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/BoundaryValueDiffEq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ end

bc1! = @closure (residual, u, p, t) -> begin
residual[1] = u[:, 1][1] - 5
residual[2] = u[:, lastindex(u)][1]
residual[2] = u[:, end][1]
end

bc1 = @closure (u, p, t) -> [u[:, 1][1] - 5, u[:, lastindex(u)][1]]
bc1 = @closure (u, p, t) -> [u[:, 1][1] - 5, u[:, end][1]]

bc1_a! = @closure (residual, ua, p) -> (residual[1] = ua[1] - 5)
bc1_b! = @closure (residual, ub, p) -> (residual[1] = ub[1])
Expand Down Expand Up @@ -102,14 +102,14 @@ end

bc1_nlls! = @closure (resid, sol, p, t) -> begin
solₜ₁ = sol[:, 1]
solₜ₂ = sol[:, lastindex(sol)]
solₜ₂ = sol[:, end]
resid[1] = solₜ₁[1]
resid[2] = solₜ₂[1] - 1
resid[3] = solₜ₂[2] + 1.729109
return nothing
end
bc1_nlls = @closure (sol, p, t) -> [
sol[:, 1][1], sol[:, lastindex(sol)][1] - 1, sol[:, lastindex(sol)][2] + 1.729109]
sol[:, 1][1], sol[:, end][1] - 1, sol[:, end][2] + 1.729109]

bc1_nlls_a! = @closure (resid, ua, p) -> (resid[1] = ua[1])
bc1_nlls_b! = @closure (resid, ub, p) -> (resid[1] = ub[1] - 1;
Expand Down

0 comments on commit 302832a

Please sign in to comment.