From df3909c301ef4417fa77f999e749833ad18d358c Mon Sep 17 00:00:00 2001 From: Avik Pal Date: Mon, 9 Oct 2023 13:52:39 -0400 Subject: [PATCH] Update the TwoPointBVP code --- src/solve/multiple_shooting.jl | 1 - test/misc/type_stability.jl | 13 ++++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/solve/multiple_shooting.jl b/src/solve/multiple_shooting.jl index 9eca8aec..4267db67 100644 --- a/src/solve/multiple_shooting.jl +++ b/src/solve/multiple_shooting.jl @@ -1,4 +1,3 @@ -# TODO: incorporate `initial_guess` similar to MIRK methods function SciMLBase.__solve(prob::BVProblem, alg::MultipleShooting; odesolve_kwargs = (;), nlsolve_kwargs = (;), ensemblealg = EnsembleThreads(), verbose = true, kwargs...) @unpack f, tspan = prob diff --git a/test/misc/type_stability.jl b/test/misc/type_stability.jl index 7e6cafa8..ef20e632 100644 --- a/test/misc/type_stability.jl +++ b/test/misc/type_stability.jl @@ -11,11 +11,10 @@ function bc!(res, sol, p, t) res[1] = sol[1][1] - 1 res[2] = sol[end][2] - 2 end -twobc((ua, ub), p) = ([ua[1] - 1], [ub[2] - 2]) -function twobc!((resa, resb), (ua, ub), p) - resa[1] = ua[1] - 1 - resb[1] = ub[2] - 2 -end +twobc_a(ua, p) = [ua[1] - 1] +twobc_b(ub, p) = [ub[2] - 2] +twobc_a!(resa, ua, p) = (resa[1] = ua[1] - 1) +twobc_b!(resb, ub, p) = (resb[1] = ub[2] - 2) u0 = Float64[0, 0] tspan = (0.0, 1.0) @@ -44,8 +43,8 @@ end # Two-Point BVP @testset "Two-Point BVP" begin - tpbvp_iip = TwoPointBVProblem(f!, twobc!, u0, tspan, p; bcresid_prototype) - tpbvp_oop = TwoPointBVProblem(f, twobc, u0, tspan, p) + tpbvp_iip = TwoPointBVProblem(f!, (twobc_a!, twobc_b!), u0, tspan, p; bcresid_prototype) + tpbvp_oop = TwoPointBVProblem(f, (twobc_a, twobc_b), u0, tspan, p) @testset "Shooting Methods" begin @inferred solve(tpbvp_iip, Shooting(Tsit5()))