Skip to content

Commit 0a99a8f

Browse files
Some more fixes
1 parent 90df7ef commit 0a99a8f

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

lib/OrdinaryDiffEqRosenbrock/src/rosenbrock_caches.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,8 @@ struct Rodas4ConstantCache{TF, UF, Tab, JType, WType, F, AD, rateType} <: Rosenb
705705
W::WType
706706
linsolve::F
707707
autodiff::AD
708-
du::Vector{rateType}
708+
du::rateType
709+
ks::Vector{rateType}
709710
end
710711

711712
tabtype(::Rodas4) = Rodas4Tableau
@@ -723,10 +724,11 @@ function alg_cache(alg::Union{Rodas4, Rodas42, Rodas4P, Rodas4P2}, u, rate_proto
723724
linprob = nothing #LinearProblem(W,copy(u); u0=copy(u))
724725
linsolve = nothing #init(linprob,alg.linsolve,alias_A=true,alias_b=true)
725726
ks = Vector{typeof(rate_prototype)}(undef, 6)
727+
du = zero(rate_prototype)
726728
Rodas4ConstantCache(tf, uf,
727729
tabtype(alg)(constvalue(uBottomEltypeNoUnits),
728730
constvalue(tTypeNoUnits)), J, W, linsolve,
729-
alg_autodiff(alg), ks)
731+
alg_autodiff(alg), du, ks)
730732
end
731733

732734
function alg_cache(alg::Union{Rodas4, Rodas42, Rodas4P, Rodas4P2}, u, rate_prototype, ::Type{uEltypeNoUnits},

lib/OrdinaryDiffEqRosenbrock/src/rosenbrock_perform_step.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1208,7 +1208,7 @@ end
12081208

12091209
@muladd function perform_step!(integrator, cache::Rodas4ConstantCache, repeat_step = false)
12101210
(;t, dt, uprev, u, f, p) = integrator
1211-
(;tf, uf, du) = cache
1211+
(;tf, uf, du, ks) = cache
12121212
(;A, C, gamma, c, d, H) = cache.tab
12131213

12141214
# Precalculations

lib/OrdinaryDiffEqRosenbrock/src/stiff_addsteps.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ function _ode_addsteps!(k, t, uprev, u, dt, f, p, cache::Rodas4ConstantCache,
291291
always_calc_begin = false, allow_calc_end = true,
292292
force_calc_end = false)
293293
if length(k) < 2 || always_calc_begin
294-
(;tf, uf, du) = cache
294+
(;tf, uf, du, ks) = cache
295295
(;A, C, gamma, c, d, H) = cache.tab
296296

297297
# Precalculations

0 commit comments

Comments
 (0)