Skip to content

Commit d76108c

Browse files
committed
revert incorrect fixes
1 parent 0a99a8f commit d76108c

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

lib/OrdinaryDiffEqNonlinearSolve/src/newton.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ end
8181
@unpack tstep, invγdt = cache
8282

8383
nlcache = nlsolver.cache.cache
84-
step!(nlcache)
84+
step!(nlcache, recompute_jacobian=false)
8585
nlsolver.ztmp = nlcache.u
8686

8787
ustep = compute_ustep(tmp, γ, z, method)
@@ -103,7 +103,7 @@ end
103103
@unpack tstep, invγdt, atmp, ustep = cache
104104

105105
nlcache = nlsolver.cache.cache
106-
step!(nlcache)
106+
step!(nlcache, recompute_jacobian=false)
107107
@.. broadcast=false ztmp=nlcache.u
108108

109109
ustep = compute_ustep!(ustep, tmp, γ, z, method)

lib/OrdinaryDiffEqRosenbrock/src/rosenbrock_caches.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,6 @@ struct Rodas4ConstantCache{TF, UF, Tab, JType, WType, F, AD, rateType} <: Rosenb
705705
W::WType
706706
linsolve::F
707707
autodiff::AD
708-
du::rateType
709708
ks::Vector{rateType}
710709
end
711710

@@ -724,11 +723,10 @@ function alg_cache(alg::Union{Rodas4, Rodas42, Rodas4P, Rodas4P2}, u, rate_proto
724723
linprob = nothing #LinearProblem(W,copy(u); u0=copy(u))
725724
linsolve = nothing #init(linprob,alg.linsolve,alias_A=true,alias_b=true)
726725
ks = Vector{typeof(rate_prototype)}(undef, 6)
727-
du = zero(rate_prototype)
728726
Rodas4ConstantCache(tf, uf,
729727
tabtype(alg)(constvalue(uBottomEltypeNoUnits),
730728
constvalue(tTypeNoUnits)), J, W, linsolve,
731-
alg_autodiff(alg), du, ks)
729+
alg_autodiff(alg), ks)
732730
end
733731

734732
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, ks) = cache
1211+
(;tf, uf, ks) = cache
12121212
(;A, C, gamma, c, d, H) = cache.tab
12131213

12141214
# Precalculations

lib/OrdinaryDiffEqRosenbrock/src/stiff_addsteps.jl

Lines changed: 3 additions & 3 deletions
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, ks) = cache
294+
(;tf, uf, ks) = cache
295295
(;A, C, gamma, c, d, H) = cache.tab
296296

297297
# Precalculations
@@ -344,8 +344,8 @@ function _ode_addsteps!(k, t, uprev, u, dt, f, p, cache::Rodas4ConstantCache,
344344
ks[stage] = _reshape(W \ -_vec(linsolve_tmp), axes(uprev))
345345
end
346346

347-
k1 = zero(du)
348-
k2 = zero(du)
347+
k1 = zero(ks[1])
348+
k2 = zero(ks[1])
349349
H = cache.tab.H
350350
for i in 1:length(ks)
351351
k1 = @.. k1 + H[1, i] * ks[i]

0 commit comments

Comments
 (0)