Skip to content

Commit

Permalink
This fixes SciML#292. It turns out we were asking for interpolated de…
Browse files Browse the repository at this point in the history
…rivatives for essentially no reason (and doing so caused problems whenever you hit callbacks). As a nice side-benefit, this removes the 200 warnings
  • Loading branch information
oscardssmith committed Jun 21, 2023
1 parent 090c2d4 commit 2603b14
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/common_interface/integrator_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function DiffEqBase.savevalues!(integrator::AbstractSundialsIntegrator,
integrator.opts.save_idxs)
push!(integrator.sol.t, integrator.t)
if integrator.opts.dense
tmp = integrator(integrator.t, Val{1})
tmp = DiffEqBase.get_du(integrator)
save_value!(integrator.sol.interp.du, tmp, uType,
integrator.opts.save_idxs)
end
Expand Down Expand Up @@ -151,11 +151,11 @@ function DiffEqBase.terminate!(integrator::AbstractSundialsIntegrator,
integrator.opts.tstops.valtree = typeof(integrator.opts.tstops.valtree)()
end

@inline function DiffEqBase.get_du(integrator::CVODEIntegrator)
@inline function DiffEqBase.get_du(integrator::AbstractSundialsIntegrator)
integrator(integrator.t, Val{1})
end

@inline function DiffEqBase.get_du!(out, integrator::CVODEIntegrator)
@inline function DiffEqBase.get_du!(out, integrator::AbstractSundialsIntegrator)
integrator(out, integrator.t, Val{1})
end

Expand Down
1 change: 0 additions & 1 deletion src/common_interface/solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1432,7 +1432,6 @@ function DiffEqBase.solve!(integrator::AbstractSundialsIntegrator; early_free =
integrator.opts.save_idxs)
push!(integrator.sol.t, integrator.t)
if integrator.opts.dense
integrator(integrator.u, integrator.t, Val{1})
save_value!(integrator.sol.interp.du, integrator.u, uType,
integrator.opts.save_idxs)
end
Expand Down

0 comments on commit 2603b14

Please sign in to comment.