Skip to content

Commit

Permalink
fix saveat includes save_start for ARKODE
Browse files Browse the repository at this point in the history
  • Loading branch information
oscardssmith committed Oct 8, 2024
1 parent d7e83c0 commit 598b920
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/common_interface/solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -483,8 +483,12 @@ function DiffEqBase.__init(prob::DiffEqBase.AbstractODEProblem{uType, tupType, i
save_everystep = isempty(saveat), save_idxs = nothing,
dense = save_everystep,
save_on = true,
save_start = true,
save_end = true,
save_start = save_everystep || isempty(saveat) ||
saveat isa Number ? true :
prob.tspan[1] in saveat,
save_end = save_everystep || isempty(saveat) ||
saveat isa Number ? true :
prob.tspan[2] in saveat,
save_timeseries = nothing,
progress = false,
progress_steps = 1000,
Expand Down Expand Up @@ -1415,7 +1419,7 @@ function DiffEqBase.solve!(integrator::AbstractSundialsIntegrator; early_free =
integrator.userfun.p = integrator.p
solver_step(integrator, tstop)
integrator.t = first(integrator.tout)
# NB: CVode, ARKode may warn and then recover if integrator.t == integrator.tprev so don't flag this as an error
# NB: CVode, ARKode may warn and then recover if integrator.t == integrator.tprev so don't flag this as an error
integrator.flag < 0 && break
handle_callbacks!(integrator) # this also updates the interpolation
integrator.flag < 0 && break
Expand Down

0 comments on commit 598b920

Please sign in to comment.