Skip to content

Commit

Permalink
Merge pull request #12 from benneti/master
Browse files Browse the repository at this point in the history
default to only save final state for DynamicSS and fix one test
  • Loading branch information
ChrisRackauckas authored Jun 20, 2019
2 parents 970635b + bebb3a3 commit cb1e42b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,14 @@ function DiffEqBase.__solve(prob::DiffEqBase.AbstractSteadyStateProblem,
end

function DiffEqBase.__solve(prob::DiffEqBase.AbstractSteadyStateProblem,
alg::DynamicSS,args...;kwargs...)
alg::DynamicSS,args...;save_everystep=false,
save_start=false,kwargs...)

tspan = alg.tspan isa Tuple ? alg.tspan : (zero(alg.tspan), alg.tspan)
_prob = ODEProblem(prob.f,prob.u0,tspan,prob.p)
sol = solve(_prob,alg.alg,args...;kwargs...,
callback=TerminateSteadyState(alg.abstol,alg.reltol))
callback=TerminateSteadyState(alg.abstol,alg.reltol),
save_everystep=save_everystep,save_start=save_start)
if sol.t[end] == _prob.tspan[end]
sol = DiffEqBase.solution_new_retcode(sol, :Failure)
end
Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ sol = solve(prob,DynamicSS(Rodas5(),tspan=1e-3))
@test sol.retcode != :Terminated

sol = solve(prob,DynamicSS(CVODE_BDF()),dt=1.0)
@test sol.retcode == :Success
@test sol.retcode == :Terminated

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

0 comments on commit cb1e42b

Please sign in to comment.