Skip to content

Commit bd8222a

Browse files
fix in-place method
1 parent 158da24 commit bd8222a

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/perform_step/firk_perform_step.jl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,10 @@ function initialize!(integrator, cache::RadauIIA7Cache)
111111
if integrator.opts.adaptive
112112
@unpack abstol, reltol = integrator.opts
113113
if reltol isa Number
114-
cache.rtol = reltol^(2 / 3) / 10
114+
cache.rtol = reltol^(5 / 8) / 10
115115
cache.atol = cache.rtol * (abstol / reltol)
116116
else
117-
@.. broadcast=false cache.rtol=reltol^(2 / 3) / 10
117+
@.. broadcast=false cache.rtol=reltol^(5 / 8) / 10
118118
@.. broadcast=false cache.atol=cache.rtol * (abstol / reltol)
119119
end
120120
end
@@ -1207,6 +1207,7 @@ end
12071207
ndw = ndw1 + ndw2 + ndw3 + ndw4 + ndw5
12081208

12091209
# check divergence (not in initial step)
1210+
12101211
if iter > 1
12111212
θ = ndw / ndwprev
12121213
(diverge = θ > 1) && (cache.status = Divergence)
@@ -1226,11 +1227,12 @@ end
12261227
# transform `w` to `z`
12271228
@.. broadcast=false z1=T11 * w1 + T12 * w2 + T13 * w3 + T14 * w4 + T15 * w5
12281229
@.. broadcast=false z2=T21 * w1 + T22 * w2 + T23 * w3 + T24 * w4 + T25 * w5
1229-
@.. broadcast=false z3=T31 * w1 + T22 * w2 + T23 * w3 + T34 * w4 + T35 * w5
1230+
@.. broadcast=false z3=T31 * w1 + T32 * w2 + T33 * w3 + T34 * w4 + T35 * w5
12301231
@.. broadcast=false z4=T41 * w1 + T42 * w2 + T43 * w3 + T44 * w4 + T45 * w5
12311232
@.. broadcast=false z5=T51 * w1 + w2 + w4 #= T52=1, T53=0, T54=1, T55=0 =#
12321233

12331234
# check stopping criterion
1235+
12341236
iter > 1 &&= θ / (1 - θ))
12351237
if η * ndw < κ && (iter > 1 || iszero(ndw) || !iszero(integrator.success_iter))
12361238
# Newton method converges
@@ -1239,12 +1241,14 @@ end
12391241
fail_convergence = false
12401242
break
12411243
end
1244+
12421245
end
12431246
if fail_convergence
12441247
integrator.force_stepfail = true
12451248
integrator.stats.nnonlinconvfail += 1
12461249
return
12471250
end
1251+
12481252
cache.ηold = η
12491253
cache.iter = iter
12501254

test/algconvergence/ode_firk_tests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ for prob in [prob_ode_linear, prob_ode_2Dlinear]
99
end
1010

1111
for prob in [prob_ode_linear, prob_ode_2Dlinear]
12-
sim21 = test_convergence(1 .// 2 .^ (6:-1:3), prob, RadauIIA7())
12+
sim21 = test_convergence(1 ./ 2 .^ (2.777:-1:0.777), prob, RadauIIA7())
1313
@test sim21.𝒪est[:final]7 atol=testTol
1414
end
1515

0 commit comments

Comments
 (0)