Skip to content

Commit

Permalink
Correct initial saved value for dures
Browse files Browse the repository at this point in the history
We were saving `u` twice rather than `du` at the start. While we're
at it, also defer the choice of the interpolator to the SciMLBase
code (which does the same thing currently, but let's have this in
one place and give the SciMLBase constructor access to the `du`
vector if we have it).
  • Loading branch information
Keno committed Oct 25, 2023
1 parent 824865b commit 8c0b98e
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/common_interface/solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1254,12 +1254,8 @@ function DiffEqBase.__init(prob::DiffEqBase.AbstractDAEProblem{uType, duType, tu
sol = DiffEqBase.build_solution(prob,
alg,
ts,
ures;
ures, dense ? dures : nothing;
dense = dense,
interp = dense ?
DiffEqBase.HermiteInterpolation(ts, ures,
dures) :
DiffEqBase.LinearInterpolation(ts, ures),
calculate_error = false,
timeseries_errors = timeseries_errors,
retcode = retcode,
Expand Down Expand Up @@ -1323,7 +1319,7 @@ function DiffEqBase.__init(prob::DiffEqBase.AbstractDAEProblem{uType, duType, tu

if save_start
save_value!(ures, integrator.u, uType, save_idxs)
save_value!(dures, integrator.u, uType, save_idxs)
save_value!(dures, integrator.du, duType, save_idxs)
end

initialize_callbacks!(integrator)
Expand Down

0 comments on commit 8c0b98e

Please sign in to comment.