@@ -8,6 +8,54 @@ function get_fsalfirstlast(cache::GenericRosenbrockMutableCache, u)
88 (cache. fsalfirst, cache. fsallast)
99end
1010
11+ mutable struct RosenbrockCache{uType, rateType, uNoUnitsType, JType, WType, TabType,
12+ TFType, UFType, F, JCType, GCType, RTolType, A, AV, StepLimiter, StageLimiter} <: RosenbrockMutableCache
13+ u:: uType
14+ uprev:: uType
15+ dense:: Vector{rateType}
16+ du:: rateType
17+ du1:: rateType
18+ du2:: rateType
19+ ks:: Vector{rateType}
20+ fsalfirst:: rateType
21+ fsallast:: rateType
22+ dT:: rateType
23+ J:: JType
24+ W:: WType
25+ tmp:: rateType
26+ atmp:: uNoUnitsType
27+ weight:: uNoUnitsType
28+ tab:: TabType
29+ tf:: TFType
30+ uf:: UFType
31+ linsolve_tmp:: rateType
32+ linsolve:: F
33+ jac_config:: JCType
34+ grad_config:: GCType
35+ reltol:: RTolType
36+ alg:: A
37+ algebraic_vars:: AV
38+ step_limiter!:: StepLimiter
39+ stage_limiter!:: StageLimiter
40+ interp_order:: Int
41+ end
42+
43+ function full_cache (c:: RosenbrockCache )
44+ return [c. u, c. uprev, c. dense... , c. du, c. du1, c. du2,
45+ c. ks... , c. fsalfirst, c. fsallast, c. dT, c. tmp, c. atmp, c. weight, c. linsolve_tmp]
46+ end
47+
48+ struct RosenbrockCombinedConstantCache{TF, UF, Tab, JType, WType, F, AD} <: RosenbrockConstantCache
49+ tf:: TF
50+ uf:: UF
51+ tab:: Tab
52+ J:: JType
53+ W:: WType
54+ linsolve:: F
55+ autodiff:: AD
56+ interp_order:: Int
57+ end
58+
1159@cache mutable struct Rosenbrock23Cache{uType, rateType, uNoUnitsType, JType, WType,
1260 TabType, TFType, UFType, F, JCType, GCType,
1361 RTolType, A, AV, StepLimiter, StageLimiter} <: RosenbrockMutableCache
74122 stage_limiter!:: StageLimiter
75123end
76124
125+ function get_fsalfirstlast (cache:: Union{Rosenbrock23Cache, Rosenbrock32Cache} , u)
126+ (cache. fsalfirst, cache. fsallast)
127+ end
128+
77129function alg_cache (alg:: Rosenbrock23 , u, rate_prototype, :: Type{uEltypeNoUnits} ,
78130 :: Type{uBottomEltypeNoUnits} , :: Type{tTypeNoUnits} , uprev, uprev2, f, t,
79131 dt, reltol, p, calck,
@@ -222,57 +274,6 @@ function alg_cache(alg::Rosenbrock32, u, rate_prototype, ::Type{uEltypeNoUnits},
222274 alg_autodiff (alg))
223275end
224276
225- # ###############################################################################
226-
227- # Shampine's Low-order Rosenbrocks
228- mutable struct RosenbrockCache{uType, rateType, uNoUnitsType, JType, WType, TabType,
229- TFType, UFType, F, JCType, GCType, RTolType, A, AV, StepLimiter, StageLimiter} <: RosenbrockMutableCache
230- u:: uType
231- uprev:: uType
232- dense:: Vector{rateType}
233- du:: rateType
234- du1:: rateType
235- du2:: rateType
236- ks:: Vector{rateType}
237- fsalfirst:: rateType
238- fsallast:: rateType
239- dT:: rateType
240- J:: JType
241- W:: WType
242- tmp:: rateType
243- atmp:: uNoUnitsType
244- weight:: uNoUnitsType
245- tab:: TabType
246- tf:: TFType
247- uf:: UFType
248- linsolve_tmp:: rateType
249- linsolve:: F
250- jac_config:: JCType
251- grad_config:: GCType
252- reltol:: RTolType
253- alg:: A
254- algebraic_vars:: AV
255- step_limiter!:: StepLimiter
256- stage_limiter!:: StageLimiter
257- interp_order:: Int
258- end
259-
260- function full_cache (c:: RosenbrockCache )
261- return [c. u, c. uprev, c. dense... , c. du, c. du1, c. du2,
262- c. ks... , c. fsalfirst, c. fsallast, c. dT, c. tmp, c. atmp, c. weight, c. linsolve_tmp]
263- end
264-
265- struct RosenbrockCombinedConstantCache{TF, UF, Tab, JType, WType, F, AD} <: RosenbrockConstantCache
266- tf:: TF
267- uf:: UF
268- tab:: Tab
269- J:: JType
270- W:: WType
271- linsolve:: F
272- autodiff:: AD
273- interp_order:: Int
274- end
275-
276277@ROS2 (:cache )
277278
278279# ###############################################################################
@@ -296,9 +297,6 @@ jac_cache(c::Rosenbrock4Cache) = (c.J, c.W)
296297
297298# ##############################################################################
298299
299- # ## Rodas methods
300- tabtype (:: Rosenbrock23 ) = Rosenbrock23Tableau
301- tabtype (:: Rosenbrock32 ) = Rosenbrock32Tableau
302300tabtype (:: Rodas23W ) = Rodas23WTableau
303301tabtype (:: ROS3P ) = ROS3PTableau
304302tabtype (:: Rodas3 ) = Rodas3Tableau
0 commit comments