@@ -32,43 +32,43 @@ function initialize!(integrator, cache::DefaultCache)
32
32
init_ith_default_cache (cache, algs, cache. current)
33
33
u = integrator. u
34
34
if cache. current == 1
35
- initialize! (integrator, cache. cache1)
36
35
fsalfirst, fsallast = get_fsalfirstlast (cache. cache1,u)
37
36
integrator. fsalfirst = fsalfirst
38
37
integrator. fsallast = fsallast
38
+ initialize! (integrator, cache. cache1)
39
39
elseif cache. current == 2
40
- initialize! (integrator, cache. cache2)
41
40
fsalfirst, fsallast = get_fsalfirstlast (cache. cache2,u)
42
41
integrator. fsalfirst = fsalfirst
43
42
integrator. fsallast = fsallast
43
+ initialize! (integrator, cache. cache2)
44
44
# the controller was initialized by default for algs[1]
45
45
reset_alg_dependent_opts! (integrator. opts. controller, algs[1 ], algs[2 ])
46
46
elseif cache. current == 3
47
- initialize! (integrator, cache. cache3)
48
47
fsalfirst, fsallast = get_fsalfirstlast (cache. cache3,u)
49
48
integrator. fsalfirst = fsalfirst
50
49
integrator. fsallast = fsallast
50
+ initialize! (integrator, cache. cache3)
51
51
# the controller was initialized by default for algs[1]
52
52
reset_alg_dependent_opts! (integrator. opts. controller, algs[1 ], algs[3 ])
53
53
elseif cache. current == 4
54
- initialize! (integrator, cache. cache4)
55
54
fsalfirst, fsallast = get_fsalfirstlast (cache. cache4,u)
56
55
integrator. fsalfirst = fsalfirst
57
56
integrator. fsallast = fsallast
57
+ initialize! (integrator, cache. cache4)
58
58
# the controller was initialized by default for algs[1]
59
59
reset_alg_dependent_opts! (integrator. opts. controller, algs[1 ], algs[4 ])
60
60
elseif cache. current == 5
61
- initialize! (integrator, cache. cache5)
62
61
fsalfirst, fsallast = get_fsalfirstlast (cache. cache5,u)
63
62
integrator. fsalfirst = fsalfirst
64
63
integrator. fsallast = fsallast
64
+ initialize! (integrator, cache. cache5)
65
65
# the controller was initialized by default for algs[1]
66
66
reset_alg_dependent_opts! (integrator. opts. controller, algs[1 ], algs[5 ])
67
67
elseif cache. current == 6
68
- initialize! (integrator, cache. cache6)
69
68
fsalfirst, fsallast = get_fsalfirstlast (cache. cache6,u)
70
69
integrator. fsalfirst = fsalfirst
71
70
integrator. fsallast = fsallast
71
+ initialize! (integrator, cache. cache6)
72
72
# the controller was initialized by default for algs[1]
73
73
reset_alg_dependent_opts! (integrator. opts. controller, algs[1 ], algs[6 ])
74
74
end
@@ -79,23 +79,23 @@ function initialize!(integrator, cache::CompositeCache)
79
79
cache. current = cache. choice_function (integrator)
80
80
u = integrator. u
81
81
if cache. current == 1
82
- initialize! (integrator, @inbounds (cache. caches[1 ]))
83
82
fsalfirst, fsallast = get_fsalfirstlast (cache. caches[1 ],u)
84
83
integrator. fsalfirst = fsalfirst
85
84
integrator. fsallast = fsallast
85
+ initialize! (integrator, @inbounds (cache. caches[1 ]))
86
86
elseif cache. current == 2
87
- initialize! (integrator, @inbounds (cache. caches[2 ]))
88
87
fsalfirst, fsallast = get_fsalfirstlast (cache. caches[2 ],u)
89
88
integrator. fsalfirst = fsalfirst
90
89
integrator. fsallast = fsallast
90
+ initialize! (integrator, @inbounds (cache. caches[2 ]))
91
91
# the controller was initialized by default for integrator.alg.algs[1]
92
92
reset_alg_dependent_opts! (integrator. opts. controller, integrator. alg. algs[1 ],
93
93
integrator. alg. algs[2 ])
94
94
else
95
- initialize! (integrator, @inbounds (cache. caches[cache. current]))
96
95
fsalfirst, fsallast = get_fsalfirstlast (cache. caches[cache. current],u)
97
96
integrator. fsalfirst = fsalfirst
98
97
integrator. fsallast = fsallast
98
+ initialize! (integrator, @inbounds (cache. caches[cache. current]))
99
99
reset_alg_dependent_opts! (integrator. opts. controller, integrator. alg. algs[1 ],
100
100
integrator. alg. algs[cache. current])
101
101
end
@@ -106,15 +106,15 @@ function initialize!(integrator, cache::CompositeCache{Tuple{T1, T2}, F}) where
106
106
cache. current = cache. choice_function (integrator)
107
107
u = integrator. u
108
108
if cache. current == 1
109
- initialize! (integrator, @inbounds (cache. caches[1 ]))
110
109
fsalfirst, fsallast = get_fsalfirstlast (cache. caches[1 ],u)
111
110
integrator. fsalfirst = fsalfirst
112
111
integrator. fsallast = fsallast
112
+ initialize! (integrator, @inbounds (cache. caches[1 ]))
113
113
elseif cache. current == 2
114
- initialize! (integrator, @inbounds (cache. caches[2 ]))
115
114
fsalfirst, fsallast = get_fsalfirstlast (cache. caches[2 ],u)
116
115
integrator. fsalfirst = fsalfirst
117
116
integrator. fsallast = fsallast
117
+ initialize! (integrator, @inbounds (cache. caches[2 ]))
118
118
reset_alg_dependent_opts! (integrator. opts. controller, integrator. alg. algs[1 ],
119
119
integrator. alg. algs[2 ])
120
120
end
@@ -172,15 +172,15 @@ function choose_algorithm!(integrator,
172
172
@inbounds if new_current != old_current
173
173
cache. current = new_current
174
174
if new_current == 1
175
- initialize! (integrator, @inbounds (cache. caches[1 ]))
176
175
fsalfirst, fsallast = get_fsalfirstlast (cache. caches[1 ],u)
177
176
integrator. fsalfirst = fsalfirst
178
177
integrator. fsallast = fsallast
178
+ initialize! (integrator, @inbounds (cache. caches[1 ]))
179
179
elseif new_current == 2
180
- initialize! (integrator, @inbounds (cache. caches[2 ]))
181
180
fsalfirst, fsallast = get_fsalfirstlast (cache. caches[2 ],u)
182
181
integrator. fsalfirst = fsalfirst
183
182
integrator. fsallast = fsallast
183
+ initialize! (integrator, @inbounds (cache. caches[2 ]))
184
184
end
185
185
if old_current == 1 && new_current == 2
186
186
reset_alg_dependent_opts! (integrator, integrator. alg. algs[1 ],
@@ -205,41 +205,41 @@ function choose_algorithm!(integrator, cache::DefaultCache)
205
205
cache. current = new_current
206
206
init_ith_default_cache (cache, algs, new_current)
207
207
if new_current == 1
208
- initialize! (integrator, @inbounds (cache. cache1))
209
- new_cache = cache. cache1
210
208
fsalfirst, fsallast = get_fsalfirstlast (cache. cache1,u)
211
209
integrator. fsalfirst = fsalfirst
212
210
integrator. fsallast = fsallast
211
+ initialize! (integrator, @inbounds (cache. cache1))
212
+ new_cache = cache. cache1
213
213
elseif new_current == 2
214
- initialize! (integrator, @inbounds (cache. cache2))
215
- new_cache = cache. cache2
216
214
fsalfirst, fsallast = get_fsalfirstlast (cache. cache2,u)
217
215
integrator. fsalfirst = fsalfirst
218
216
integrator. fsallast = fsallast
217
+ initialize! (integrator, @inbounds (cache. cache2))
218
+ new_cache = cache. cache2
219
219
elseif new_current == 3
220
- initialize! (integrator, @inbounds (cache. cache3))
221
- new_cache = cache. cache3
222
220
fsalfirst, fsallast = get_fsalfirstlast (cache. cache3,u)
223
221
integrator. fsalfirst = fsalfirst
224
222
integrator. fsallast = fsallast
223
+ initialize! (integrator, @inbounds (cache. cache3))
224
+ new_cache = cache. cache3
225
225
elseif new_current == 4
226
- initialize! (integrator, @inbounds (cache. cache4))
227
- new_cache = cache. cache4
228
226
fsalfirst, fsallast = get_fsalfirstlast (cache. cache4,u)
229
227
integrator. fsalfirst = fsalfirst
230
228
integrator. fsallast = fsallast
229
+ initialize! (integrator, @inbounds (cache. cache4))
230
+ new_cache = cache. cache4
231
231
elseif new_current == 5
232
- initialize! (integrator, @inbounds (cache. cache5))
233
- new_cache = cache. cache5
234
232
fsalfirst, fsallast = get_fsalfirstlast (cache. cache5,u)
235
233
integrator. fsalfirst = fsalfirst
236
234
integrator. fsallast = fsallast
235
+ initialize! (integrator, @inbounds (cache. cache5))
236
+ new_cache = cache. cache5
237
237
elseif new_current == 6
238
- initialize! (integrator, @inbounds (cache. cache6))
239
- new_cache = cache. cache6
240
238
fsalfirst, fsallast = get_fsalfirstlast (cache. cache6,u)
241
239
integrator. fsalfirst = fsalfirst
242
240
integrator. fsallast = fsallast
241
+ initialize! (integrator, @inbounds (cache. cache6))
242
+ new_cache = cache. cache6
243
243
end
244
244
245
245
if old_current == 1
0 commit comments