@@ -172,8 +172,14 @@ function choose_algorithm!(integrator,
172172 cache. current = new_current
173173 if new_current == 1
174174 initialize! (integrator, @inbounds (cache. caches[1 ]))
175+ fsalfirst, fsallast = get_fsalfirstlast (cache. caches[1 ],u)
176+ integrator. fsalfirst = fsalfirst
177+ integrator. fsallast = fsallast
175178 elseif new_current == 2
176179 initialize! (integrator, @inbounds (cache. caches[2 ]))
180+ fsalfirst, fsallast = get_fsalfirstlast (cache. caches[2 ],u)
181+ integrator. fsalfirst = fsalfirst
182+ integrator. fsallast = fsallast
177183 end
178184 if old_current == 1 && new_current == 2
179185 reset_alg_dependent_opts! (integrator, integrator. alg. algs[1 ],
@@ -199,21 +205,39 @@ function choose_algorithm!(integrator, cache::DefaultCache)
199205 if new_current == 1
200206 initialize! (integrator, @inbounds (cache. cache1))
201207 new_cache = cache. cache1
208+ fsalfirst, fsallast = get_fsalfirstlast (cache. cache1,u)
209+ integrator. fsalfirst = fsalfirst
210+ integrator. fsallast = fsallast
202211 elseif new_current == 2
203212 initialize! (integrator, @inbounds (cache. cache2))
204213 new_cache = cache. cache2
214+ fsalfirst, fsallast = get_fsalfirstlast (cache. cache2,u)
215+ integrator. fsalfirst = fsalfirst
216+ integrator. fsallast = fsallast
205217 elseif new_current == 3
206218 initialize! (integrator, @inbounds (cache. cache3))
207219 new_cache = cache. cache3
220+ fsalfirst, fsallast = get_fsalfirstlast (cache. cache3,u)
221+ integrator. fsalfirst = fsalfirst
222+ integrator. fsallast = fsallast
208223 elseif new_current == 4
209224 initialize! (integrator, @inbounds (cache. cache4))
210225 new_cache = cache. cache4
226+ fsalfirst, fsallast = get_fsalfirstlast (cache. cache4,u)
227+ integrator. fsalfirst = fsalfirst
228+ integrator. fsallast = fsallast
211229 elseif new_current == 5
212230 initialize! (integrator, @inbounds (cache. cache5))
213231 new_cache = cache. cache5
232+ fsalfirst, fsallast = get_fsalfirstlast (cache. cache5,u)
233+ integrator. fsalfirst = fsalfirst
234+ integrator. fsallast = fsallast
214235 elseif new_current == 6
215236 initialize! (integrator, @inbounds (cache. cache6))
216237 new_cache = cache. cache6
238+ fsalfirst, fsallast = get_fsalfirstlast (cache. cache6,u)
239+ integrator. fsalfirst = fsalfirst
240+ integrator. fsallast = fsallast
217241 end
218242
219243 if old_current == 1
0 commit comments