@@ -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. alg isa DAEAlgorithm
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
@@ -134,6 +142,14 @@ function _savevalues!(integrator, force_save, reduce_size)::Tuple{Bool, Bool}
134
142
[k[integrator. opts. save_idxs] for k in integrator. k],
135
143
false )
136
144
end
145
+ if integrator. alg isa DAEAlgorithm
146
+ if integrator. opts. save_idxs === nothing
147
+ copyat_or_push! (integrator. sol. du, integrator. saveiter, integrator. du)
148
+ else
149
+ copyat_or_push! (integrator. sol. du, integrator. saveiter,
150
+ integrator. du[integrator. opts. save_idxs], false )
151
+ end
152
+ end
137
153
end
138
154
end
139
155
if integrator. alg isa OrdinaryDiffEqCompositeAlgorithm
@@ -346,6 +362,7 @@ function handle_callbacks!(integrator)
346
362
discrete_modified, saved_in_cb = DiffEqBase. apply_discrete_callback! (integrator,
347
363
discrete_callbacks... )
348
364
end
365
+
349
366
if ! saved_in_cb
350
367
savevalues! (integrator)
351
368
end
@@ -482,12 +499,10 @@ function handle_tstop!(integrator)
482
499
end
483
500
484
501
function reset_fsal! (integrator)
485
- # Under these conditions, these algorithms are not FSAL anymore
502
+ # call this when the conditions for FSAL are no longer true (e.g. u_modified)
486
503
integrator. stats. nf += 1
487
504
488
- if integrator. sol. prob isa DAEProblem
489
- DiffEqBase. initialize_dae! (integrator)
490
- else
505
+ if integrator. sol. prob isa ODEProblem
491
506
if integrator. cache isa OrdinaryDiffEqMutableCache ||
492
507
(integrator. cache isa CompositeCache &&
493
508
integrator. cache. caches[1 ] isa OrdinaryDiffEqMutableCache)
@@ -496,7 +511,7 @@ function reset_fsal!(integrator)
496
511
integrator. fsalfirst = integrator. f (integrator. u, integrator. p, integrator. t)
497
512
end
498
513
end
499
- # Do not set false here so it can be checked in the algorithm
514
+ # Do not set reeval_fsal false here so it can be checked in the algorithm
500
515
# integrator.reeval_fsal = false
501
516
end
502
517
0 commit comments