Skip to content

Commit c477425

Browse files
committed
Use correct solve
1 parent 38eb34d commit c477425

7 files changed

Lines changed: 13 additions & 15 deletions

File tree

lib/BoundaryValueDiffEqAscher/src/ascher.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ function __perform_ascher_iteration(cache::AscherCache{iip, T}, abstol, adaptive
181181
solve_alg = __concrete_solve_algorithm(nlprob, cache.alg.nlsolve, cache.alg.optimize)
182182
kwargs = __concrete_kwargs(
183183
cache.alg.nlsolve, cache.alg.optimize, cache.nlsolve_kwargs, cache.optimize_kwargs)
184-
nlsol = solve(nlprob, solve_alg; kwargs...)
184+
nlsol = __solve(nlprob, solve_alg; kwargs...)
185185
error_norm = 2 * abstol
186186
info = nlsol.retcode
187187

lib/BoundaryValueDiffEqMIRK/src/mirk.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ function __perform_mirk_iteration(cache::MIRKCache, abstol, adaptive::Bool, cont
192192
solve_alg = __concrete_solve_algorithm(nlprob, cache.alg.nlsolve, cache.alg.optimize)
193193
kwargs = __concrete_kwargs(
194194
cache.alg.nlsolve, cache.alg.optimize, cache.nlsolve_kwargs, cache.optimize_kwargs)
195-
sol_nlprob = solve(nlprob, solve_alg; kwargs...)
195+
sol_nlprob = __solve(nlprob, solve_alg; kwargs...)
196196
recursive_unflatten!(cache.y₀, sol_nlprob.u)
197197

198198
error_norm = 2 * abstol

lib/BoundaryValueDiffEqMIRKN/src/mirkn.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ function __perform_mirkn_iteration(cache::MIRKNCache)
119119
solve_alg = __concrete_solve_algorithm(nlprob, cache.alg.nlsolve, cache.alg.optimize)
120120
kwargs = __concrete_kwargs(
121121
cache.alg.nlsolve, cache.alg.optimize, cache.nlsolve_kwargs, cache.optimize_kwargs)
122-
sol_nlprob = solve(nlprob, solve_alg; kwargs...)
122+
sol_nlprob = __solve(nlprob, solve_alg; kwargs...)
123123
recursive_unflatten!(cache.y₀, sol_nlprob.u)
124124

125125
return sol_nlprob, sol_nlprob.retcode

lib/BoundaryValueDiffEqShooting/src/multiple_shooting.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ function __solve_nlproblem!(
148148
u_at_nodes, prob.p, M, length(nodes), nothing)
149149

150150
nlsolve_alg = __concrete_solve_algorithm(nlprob, alg.nlsolve, alg.optimize)
151-
solve(nlprob, nlsolve_alg; kwargs...)
151+
__solve(nlprob, nlsolve_alg; kwargs...)
152152

153153
return nothing
154154
end
@@ -223,7 +223,7 @@ function __solve_nlproblem!(::StandardBVProblem, alg::MultipleShooting, bcresid_
223223
prob, alg, loss_fn, jac_fn, jac_prototype, resid_prototype,
224224
u_at_nodes, prob.p, M, length(nodes), nothing)
225225
nlsolve_alg = __concrete_solve_algorithm(nlprob, alg.nlsolve, alg.optimize)
226-
solve(nlprob, nlsolve_alg; kwargs...)
226+
__solve(nlprob, nlsolve_alg; kwargs...)
227227

228228
return nothing
229229
end

lib/BoundaryValueDiffEqShooting/src/single_shooting.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function SciMLBase.__solve(prob::BVProblem, alg_::Shooting; abstol = 1e-6,
8080
solve_alg = __concrete_solve_algorithm(nlprob, alg.nlsolve, alg.optimize)
8181
kwargs = __concrete_kwargs(alg.nlsolve, alg.optimize, nlsolve_kwargs, optimize_kwargs)
8282
#TODO: add verbose kwarg
83-
nlsol = solve(nlprob, solve_alg; kwargs...)
83+
nlsol = __solve(nlprob, solve_alg; kwargs...)
8484

8585
# There is no way to reinit with the same cache with different cache. But not saving
8686
# the internal values gives a significant speedup. So we just create a new cache

test/misc/default_solvers.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
@testitem "Default Solvers" begin
22
using BoundaryValueDiffEq, Test
3-
3+
44
function f(du, u, p, t)
55
(x, v) = u
66
du[1] = v
77
du[2] = -x
88
end
9-
9+
1010
function bc!(resid, sol, p, t)
1111
resid[1] = sol[1][1]
1212
resid[2] = sol[end][1] - 1
1313
end
14-
14+
1515
tspan = (0.0, 100.0)
1616
u0 = [0.0, 1.0]
1717
bvp = BVProblem(f, bc!, u0, tspan)
1818
resid_f = Array{Float64}(undef, 2)
1919
sol = solve(bvp, Shooting(Tsit5()))
2020
sol2 = solve(bvp)
21-
21+
2222
@test sol2.alg == Tsit5()
2323
@test all(sol.u .== sol2.u)
24-
end
24+
end

test/misc/qa_tests.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
@testitem "Quality Assurance" begin
22
using Aqua
33

4-
Aqua.test_all(BoundaryValueDiffEq;
5-
ambiguities = false,
6-
piracies = (broken = false,
7-
treat_as_own = [SciMLBase.BVProblem]))
4+
Aqua.test_all(BoundaryValueDiffEq; ambiguities = false,
5+
piracies = (broken = false, treat_as_own = [SciMLBase.BVProblem]))
86
end
97

108
@testitem "JET Package Test" begin

0 commit comments

Comments
 (0)