Skip to content

Commit

Permalink
Merge pull request #84 from SciML/os/specialize-ode
Browse files Browse the repository at this point in the history
specialize `ODEProblem`
  • Loading branch information
ChrisRackauckas authored Sep 4, 2024
2 parents e8062ef + cd70ba7 commit 8f5b618
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function SciMLBase.__solve(prob::SciMLBase.AbstractSteadyStateProblem, alg::Dyna
(callback = CallbackSet(callback, odesolve_kwargs[:callback]))

# Construct and solve the ODEProblem
odeprob = ODEProblem{isinplace(prob)}(f, prob.u0, tspan, prob.p)
odeprob = ODEProblem{isinplace(prob), true}(f, prob.u0, tspan, prob.p)
odesol = solve(odeprob, alg.alg, args...; abstol, reltol, kwargs...,
odesolve_kwargs..., callback, save_end = true)

Expand Down
7 changes: 6 additions & 1 deletion test/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,14 @@ end
sol = solve(prob, DynamicSS(CVODE_BDF()), dt = 1.0)
@test SciMLBase.successful_retcode(sol.retcode)

# test autodiff
sol = solve(prob, DynamicSS(Rodas5P()))

@test SciMLBase.successful_retcode(sol.retcode)

# scalar save_idxs
scalar_sol = solve(prob, DynamicSS(CVODE_BDF()), dt = 1.0, save_idxs = 1)
@test scalar_sol[1] sol[1]
@test scalar_sol[1] sol[1] atol=1e-6

f(du, sol.u, p, 0)
@test du[0, 0] atol=1e-6
Expand Down

0 comments on commit 8f5b618

Please sign in to comment.