@@ -32,43 +32,43 @@ function initialize!(integrator, cache::DefaultCache)
3232 init_ith_default_cache (cache, algs, cache. current)
3333 u = integrator. u
3434 if cache. current == 1
35- initialize! (integrator, cache. cache1)
3635 fsalfirst, fsallast = get_fsalfirstlast (cache. cache1,u)
3736 integrator. fsalfirst = fsalfirst
3837 integrator. fsallast = fsallast
38+ initialize! (integrator, cache. cache1)
3939 elseif cache. current == 2
40- initialize! (integrator, cache. cache2)
4140 fsalfirst, fsallast = get_fsalfirstlast (cache. cache2,u)
4241 integrator. fsalfirst = fsalfirst
4342 integrator. fsallast = fsallast
43+ initialize! (integrator, cache. cache2)
4444 # the controller was initialized by default for algs[1]
4545 reset_alg_dependent_opts! (integrator. opts. controller, algs[1 ], algs[2 ])
4646 elseif cache. current == 3
47- initialize! (integrator, cache. cache3)
4847 fsalfirst, fsallast = get_fsalfirstlast (cache. cache3,u)
4948 integrator. fsalfirst = fsalfirst
5049 integrator. fsallast = fsallast
50+ initialize! (integrator, cache. cache3)
5151 # the controller was initialized by default for algs[1]
5252 reset_alg_dependent_opts! (integrator. opts. controller, algs[1 ], algs[3 ])
5353 elseif cache. current == 4
54- initialize! (integrator, cache. cache4)
5554 fsalfirst, fsallast = get_fsalfirstlast (cache. cache4,u)
5655 integrator. fsalfirst = fsalfirst
5756 integrator. fsallast = fsallast
57+ initialize! (integrator, cache. cache4)
5858 # the controller was initialized by default for algs[1]
5959 reset_alg_dependent_opts! (integrator. opts. controller, algs[1 ], algs[4 ])
6060 elseif cache. current == 5
61- initialize! (integrator, cache. cache5)
6261 fsalfirst, fsallast = get_fsalfirstlast (cache. cache5,u)
6362 integrator. fsalfirst = fsalfirst
6463 integrator. fsallast = fsallast
64+ initialize! (integrator, cache. cache5)
6565 # the controller was initialized by default for algs[1]
6666 reset_alg_dependent_opts! (integrator. opts. controller, algs[1 ], algs[5 ])
6767 elseif cache. current == 6
68- initialize! (integrator, cache. cache6)
6968 fsalfirst, fsallast = get_fsalfirstlast (cache. cache6,u)
7069 integrator. fsalfirst = fsalfirst
7170 integrator. fsallast = fsallast
71+ initialize! (integrator, cache. cache6)
7272 # the controller was initialized by default for algs[1]
7373 reset_alg_dependent_opts! (integrator. opts. controller, algs[1 ], algs[6 ])
7474 end
@@ -79,23 +79,23 @@ function initialize!(integrator, cache::CompositeCache)
7979 cache. current = cache. choice_function (integrator)
8080 u = integrator. u
8181 if cache. current == 1
82- initialize! (integrator, @inbounds (cache. caches[1 ]))
8382 fsalfirst, fsallast = get_fsalfirstlast (cache. caches[1 ],u)
8483 integrator. fsalfirst = fsalfirst
8584 integrator. fsallast = fsallast
85+ initialize! (integrator, @inbounds (cache. caches[1 ]))
8686 elseif cache. current == 2
87- initialize! (integrator, @inbounds (cache. caches[2 ]))
8887 fsalfirst, fsallast = get_fsalfirstlast (cache. caches[2 ],u)
8988 integrator. fsalfirst = fsalfirst
9089 integrator. fsallast = fsallast
90+ initialize! (integrator, @inbounds (cache. caches[2 ]))
9191 # the controller was initialized by default for integrator.alg.algs[1]
9292 reset_alg_dependent_opts! (integrator. opts. controller, integrator. alg. algs[1 ],
9393 integrator. alg. algs[2 ])
9494 else
95- initialize! (integrator, @inbounds (cache. caches[cache. current]))
9695 fsalfirst, fsallast = get_fsalfirstlast (cache. caches[cache. current],u)
9796 integrator. fsalfirst = fsalfirst
9897 integrator. fsallast = fsallast
98+ initialize! (integrator, @inbounds (cache. caches[cache. current]))
9999 reset_alg_dependent_opts! (integrator. opts. controller, integrator. alg. algs[1 ],
100100 integrator. alg. algs[cache. current])
101101 end
@@ -106,15 +106,15 @@ function initialize!(integrator, cache::CompositeCache{Tuple{T1, T2}, F}) where
106106 cache. current = cache. choice_function (integrator)
107107 u = integrator. u
108108 if cache. current == 1
109- initialize! (integrator, @inbounds (cache. caches[1 ]))
110109 fsalfirst, fsallast = get_fsalfirstlast (cache. caches[1 ],u)
111110 integrator. fsalfirst = fsalfirst
112111 integrator. fsallast = fsallast
112+ initialize! (integrator, @inbounds (cache. caches[1 ]))
113113 elseif cache. current == 2
114- initialize! (integrator, @inbounds (cache. caches[2 ]))
115114 fsalfirst, fsallast = get_fsalfirstlast (cache. caches[2 ],u)
116115 integrator. fsalfirst = fsalfirst
117116 integrator. fsallast = fsallast
117+ initialize! (integrator, @inbounds (cache. caches[2 ]))
118118 reset_alg_dependent_opts! (integrator. opts. controller, integrator. alg. algs[1 ],
119119 integrator. alg. algs[2 ])
120120 end
@@ -172,15 +172,15 @@ function choose_algorithm!(integrator,
172172 @inbounds if new_current != old_current
173173 cache. current = new_current
174174 if new_current == 1
175- initialize! (integrator, @inbounds (cache. caches[1 ]))
176175 fsalfirst, fsallast = get_fsalfirstlast (cache. caches[1 ],u)
177176 integrator. fsalfirst = fsalfirst
178177 integrator. fsallast = fsallast
178+ initialize! (integrator, @inbounds (cache. caches[1 ]))
179179 elseif new_current == 2
180- initialize! (integrator, @inbounds (cache. caches[2 ]))
181180 fsalfirst, fsallast = get_fsalfirstlast (cache. caches[2 ],u)
182181 integrator. fsalfirst = fsalfirst
183182 integrator. fsallast = fsallast
183+ initialize! (integrator, @inbounds (cache. caches[2 ]))
184184 end
185185 if old_current == 1 && new_current == 2
186186 reset_alg_dependent_opts! (integrator, integrator. alg. algs[1 ],
@@ -205,41 +205,41 @@ function choose_algorithm!(integrator, cache::DefaultCache)
205205 cache. current = new_current
206206 init_ith_default_cache (cache, algs, new_current)
207207 if new_current == 1
208- initialize! (integrator, @inbounds (cache. cache1))
209- new_cache = cache. cache1
210208 fsalfirst, fsallast = get_fsalfirstlast (cache. cache1,u)
211209 integrator. fsalfirst = fsalfirst
212210 integrator. fsallast = fsallast
211+ initialize! (integrator, @inbounds (cache. cache1))
212+ new_cache = cache. cache1
213213 elseif new_current == 2
214- initialize! (integrator, @inbounds (cache. cache2))
215- new_cache = cache. cache2
216214 fsalfirst, fsallast = get_fsalfirstlast (cache. cache2,u)
217215 integrator. fsalfirst = fsalfirst
218216 integrator. fsallast = fsallast
217+ initialize! (integrator, @inbounds (cache. cache2))
218+ new_cache = cache. cache2
219219 elseif new_current == 3
220- initialize! (integrator, @inbounds (cache. cache3))
221- new_cache = cache. cache3
222220 fsalfirst, fsallast = get_fsalfirstlast (cache. cache3,u)
223221 integrator. fsalfirst = fsalfirst
224222 integrator. fsallast = fsallast
223+ initialize! (integrator, @inbounds (cache. cache3))
224+ new_cache = cache. cache3
225225 elseif new_current == 4
226- initialize! (integrator, @inbounds (cache. cache4))
227- new_cache = cache. cache4
228226 fsalfirst, fsallast = get_fsalfirstlast (cache. cache4,u)
229227 integrator. fsalfirst = fsalfirst
230228 integrator. fsallast = fsallast
229+ initialize! (integrator, @inbounds (cache. cache4))
230+ new_cache = cache. cache4
231231 elseif new_current == 5
232- initialize! (integrator, @inbounds (cache. cache5))
233- new_cache = cache. cache5
234232 fsalfirst, fsallast = get_fsalfirstlast (cache. cache5,u)
235233 integrator. fsalfirst = fsalfirst
236234 integrator. fsallast = fsallast
235+ initialize! (integrator, @inbounds (cache. cache5))
236+ new_cache = cache. cache5
237237 elseif new_current == 6
238- initialize! (integrator, @inbounds (cache. cache6))
239- new_cache = cache. cache6
240238 fsalfirst, fsallast = get_fsalfirstlast (cache. cache6,u)
241239 integrator. fsalfirst = fsalfirst
242240 integrator. fsallast = fsallast
241+ initialize! (integrator, @inbounds (cache. cache6))
242+ new_cache = cache. cache6
243243 end
244244
245245 if old_current == 1
0 commit comments