@@ -102,6 +102,14 @@ function _savevalues!(integrator, force_save, reduce_size)::Tuple{Bool, Bool}
102
102
[k[integrator. opts. save_idxs] for k in integrator. k],
103
103
false )
104
104
end
105
+ if integrator. prob isa DAEProblem
106
+ if integrator. opts. save_idxs === nothing
107
+ copyat_or_push! (integrator. sol. du, integrator. saveiter, integrator. du)
108
+ else
109
+ copyat_or_push! (integrator. sol. du, integrator. saveiter,
110
+ integrator. du[integrator. opts. save_idxs], false )
111
+ end
112
+ end
105
113
end
106
114
end
107
115
if integrator. alg isa OrdinaryDiffEqCompositeAlgorithm
@@ -346,6 +354,7 @@ function handle_callbacks!(integrator)
346
354
discrete_modified, saved_in_cb = DiffEqBase. apply_discrete_callback! (integrator,
347
355
discrete_callbacks... )
348
356
end
357
+
349
358
if ! saved_in_cb
350
359
savevalues! (integrator)
351
360
end
@@ -482,12 +491,10 @@ function handle_tstop!(integrator)
482
491
end
483
492
484
493
function reset_fsal! (integrator)
485
- # Under these conditions, these algorithms are not FSAL anymore
494
+ # call this when the conditions for FSAL are no longer true (e.g. u_modified)
486
495
integrator. stats. nf += 1
487
496
488
- if integrator. sol. prob isa DAEProblem
489
- DiffEqBase. initialize_dae! (integrator)
490
- else
497
+ if integrator. sol. prob isa ODEProblem
491
498
if integrator. cache isa OrdinaryDiffEqMutableCache ||
492
499
(integrator. cache isa CompositeCache &&
493
500
integrator. cache. caches[1 ] isa OrdinaryDiffEqMutableCache)
@@ -496,7 +503,7 @@ function reset_fsal!(integrator)
496
503
integrator. fsalfirst = integrator. f (integrator. u, integrator. p, integrator. t)
497
504
end
498
505
end
499
- # Do not set false here so it can be checked in the algorithm
506
+ # Do not set reeval_fsal false here so it can be checked in the algorithm
500
507
# integrator.reeval_fsal = false
501
508
end
502
509
0 commit comments