Skip to content

Commit

Permalink
Update for BoundaryValueDiffEq v5
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszbaran committed Oct 27, 2023
1 parent cdf3f6c commit e9421c4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ ManifoldsRecipesBaseExt = ["Colors", "RecipesBase"]
ManifoldsTestExt = "Test"

[compat]
BoundaryValueDiffEq = "4"
BoundaryValueDiffEq = "4, 5"
Colors = "0.12"
Distributions = "0.22.6, 0.23, 0.24, 0.25"
Einsum = "0.4"
Expand Down
16 changes: 6 additions & 10 deletions ext/ManifoldsBoundaryValueDiffEqExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ end
A::AbstractAtlas,
i;
solver=MIRK4(),
dt=0.05,
dt::Real=0.05,
kwargs...,
)
Expand All @@ -55,22 +55,18 @@ function solve_chart_log_bvp(
A::AbstractAtlas,
i;
solver=MIRK4(),
dt=0.05,
dt::Real=0.05,
kwargs...,
)
tspan = (0.0, 1.0)
function bc1!(residual, u, p, t)
mid = div(length(u[1]), 2)
residual[1:mid] = u[1][1:mid] - a1
return residual[(mid + 1):end] = u[end][1:mid] - a2
residual[(mid + 1):end] = u[end][1:mid] - a2
return residual
end
bvp1 = BVProblem(
chart_log_problem!,
bc1!,
(p, t) -> vcat(t * a1 + (1 - t) * a2, zero(a1)),
tspan,
(M, A, i),
)
u0 = [vcat(a1, zero(a1)), vcat(a2, zero(a1))]
bvp1 = BVProblem(chart_log_problem!, bc1!, u0, tspan, (M, A, i))
sol1 = solve(bvp1, solver, dt=dt)
return sol1
end
Expand Down

0 comments on commit e9421c4

Please sign in to comment.