Skip to content

Commit 410555c

Browse files
committed
Re-evaluate u_initial after DAE initialization
Found by inspection - I think this acidentally had the same bug as SciML/Sundials.jl#407 if save_idxs is not `nothing`.
1 parent 73bcbf0 commit 410555c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/solve.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,11 +483,12 @@ function DiffEqBase.__init(prob::Union{DiffEqBase.AbstractODEProblem,
483483
integrator.saveiter += 1 # Starts at 1 so first save is at 2
484484
integrator.saveiter_dense += 1
485485
copyat_or_push!(ts, 1, t)
486+
# N.B.: integrator.u can be modified by initialized_dae!
486487
if save_idxs === nothing
487488
copyat_or_push!(timeseries, 1, integrator.u)
488489
copyat_or_push!(ks, 1, [rate_prototype])
489490
else
490-
copyat_or_push!(timeseries, 1, u_initial, Val{false})
491+
copyat_or_push!(timeseries, 1, integrator.u[save_idxs], Val{false})
491492
copyat_or_push!(ks, 1, [ks_prototype])
492493
end
493494
else

0 commit comments

Comments
 (0)