Skip to content

Commit de4a30e

Browse files
Compute TSRKC2/TSRKC3 stage time unconditionally in the stage loop
Rebase of the surviving content of #3902 onto current master. In the in-place TSRKC2 and TSRKC3 stage loops `th` was assigned inside the `if (iter < mdeg)` guard. Hoisting it out matches RKC and RKMC2, which already compute `th` unconditionally. This is a no-op: `th` is read only by the `th1 = th` on the following line, which stays inside the guard, so nothing observes the value computed on the final iteration. The rest of #3902 landed separately and is already on master: - RKL1/RKL2 non-autonomous stage times (#3948) - RKG1/RKG2 non-autonomous stage times (#3949) - RKC in-place mdeg < 2 handling (#3951) - per-algorithm limiter fields, reverted by the author in c34fe7a and superseded by solve-level limiters (#3835) Original commits: 9158496, 05548a5, c34fe7a Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
1 parent 7a8f930 commit de4a30e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/OrdinaryDiffEqStabilizedRK/src/rkc_perform_step.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,10 +1226,10 @@ end
12261226
f(k, gprev, p, t + dt * th1)
12271227
OrdinaryDiffEqCore.increment_nf!(integrator.stats, 1)
12281228
@.. broadcast = false u = μ * gprev + ν * tmp + dt * μs * k
1229+
th = μ * th1 + ν * th2 + μs
12291230
if (iter < mdeg)
12301231
@.. broadcast = false tmp = gprev
12311232
@.. broadcast = false gprev = u
1232-
th = μ * th1 + ν * th2 + μs
12331233
th2 = th1
12341234
th1 = th
12351235
z2 = z1
@@ -1486,10 +1486,10 @@ end
14861486
OrdinaryDiffEqCore.increment_nf!(integrator.stats, 1)
14871487
@.. broadcast = false u = μ * gprev + ν * tmp + (T(1) - μ - ν) * uprev +
14881488
dt * μs * (k - νs * fsalfirst)
1489+
th = μ * th1 + ν * th2 + μs * (T(1) - νs)
14891490
if (iter < mdeg)
14901491
@.. broadcast = false tmp = gprev
14911492
@.. broadcast = false gprev = u
1492-
th = μ * th1 + ν * th2 + μs * (T(1) - νs)
14931493
th2 = th1
14941494
th1 = th
14951495
b2 = b1

0 commit comments

Comments
 (0)