Skip to content

Commit d143ce8

Browse files
Merge pull request #6 from Shreyas-Ekanathan/upstream
Upstream
2 parents 4fd5afb + a5fc5d8 commit d143ce8

File tree

8 files changed

+29
-29
lines changed

8 files changed

+29
-29
lines changed

lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ include("firk_tableaus.jl")
3030
include("firk_perform_step.jl")
3131
include("integrator_interface.jl")
3232

33-
export RadauIIA3, RadauIIA5, RadauIIA7
33+
export RadauIIA3, RadauIIA5, RadauIIA9
3434

3535
end
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
qmax_default(alg::Union{RadauIIA3, RadauIIA5, RadauIIA7}) = 8
1+
qmax_default(alg::Union{RadauIIA3, RadauIIA5, RadauIIA9}) = 8
22

33
alg_order(alg::RadauIIA3) = 3
44
alg_order(alg::RadauIIA5) = 5
5-
alg_order(alg::RadauIIA7) = 7
5+
alg_order(alg::RadauIIA9) = 9
66

77
isfirk(alg::RadauIIA3) = true
88
isfirk(alg::RadauIIA5) = true
9-
isfirk(alg::RadauIIA7) = true
9+
isfirk(alg::RadauIIA9) = true
1010

1111
alg_adaptive_order(alg::RadauIIA3) = 1
1212
alg_adaptive_order(alg::RadauIIA5) = 3
13-
alg_adaptive_order(alg::RadauIIA7) = 5
13+
alg_adaptive_order(alg::RadauIIA9) = 7

lib/OrdinaryDiffEqFIRK/src/algorithms.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,10 @@ year={1999},
114114
publisher={Elsevier}
115115
}
116116
117-
RadauIIA7: Fully-Implicit Runge-Kutta Method
117+
RadauIIA9: Fully-Implicit Runge-Kutta Method
118118
An A-B-L stable fully implicit Runge-Kutta method with internal tableau complex basis transform for efficiency.
119119
"""
120-
struct RadauIIA7{CS, AD, F, P, FDT, ST, CJ, Tol, C1, C2, StepLimiter} <:
120+
struct RadauIIA9{CS, AD, F, P, FDT, ST, CJ, Tol, C1, C2, StepLimiter} <:
121121
OrdinaryDiffEqNewtonAdaptiveAlgorithm{CS, AD, FDT, ST, CJ}
122122
linsolve::F
123123
precs::P
@@ -131,15 +131,15 @@ struct RadauIIA7{CS, AD, F, P, FDT, ST, CJ, Tol, C1, C2, StepLimiter} <:
131131
step_limiter!::StepLimiter
132132
end
133133

134-
function RadauIIA7(; chunk_size = Val{0}(), autodiff = Val{true}(),
134+
function RadauIIA9(; chunk_size = Val{0}(), autodiff = Val{true}(),
135135
standardtag = Val{true}(), concrete_jac = nothing,
136136
diff_type = Val{:forward},
137137
linsolve = nothing, precs = DEFAULT_PRECS,
138138
extrapolant = :dense, fast_convergence_cutoff = 1 // 5,
139139
new_W_γdt_cutoff = 1 // 5,
140140
controller = :Predictive, κ = nothing, maxiters = 10, smooth_est = true,
141141
step_limiter! = trivial_limiter!)
142-
RadauIIA7{_unwrap_val(chunk_size), _unwrap_val(autodiff), typeof(linsolve),
142+
RadauIIA9{_unwrap_val(chunk_size), _unwrap_val(autodiff), typeof(linsolve),
143143
typeof(precs), diff_type, _unwrap_val(standardtag), _unwrap_val(concrete_jac),
144144
typeof(κ), typeof(fast_convergence_cutoff),
145145
typeof(new_W_γdt_cutoff), typeof(step_limiter!)}(linsolve,

lib/OrdinaryDiffEqFIRK/src/firk_caches.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ function alg_cache(alg::RadauIIA5, u, rate_prototype, ::Type{uEltypeNoUnits},
273273
Convergence, alg.step_limiter!)
274274
end
275275

276-
mutable struct RadauIIA7ConstantCache{F, Tab, Tol, Dt, U, JType} <:
276+
mutable struct RadauIIA9ConstantCache{F, Tab, Tol, Dt, U, JType} <:
277277
OrdinaryDiffEqConstantCache
278278
uf::F
279279
tab::Tab
@@ -290,22 +290,22 @@ mutable struct RadauIIA7ConstantCache{F, Tab, Tol, Dt, U, JType} <:
290290
J::JType
291291
end
292292

293-
function alg_cache(alg::RadauIIA7, u, rate_prototype, ::Type{uEltypeNoUnits},
293+
function alg_cache(alg::RadauIIA9, u, rate_prototype, ::Type{uEltypeNoUnits},
294294
::Type{uBottomEltypeNoUnits},
295295
::Type{tTypeNoUnits}, uprev, uprev2, f, t, dt, reltol, p, calck,
296296
::Val{false}) where {uEltypeNoUnits, uBottomEltypeNoUnits, tTypeNoUnits}
297297
uf = UDerivativeWrapper(f, t, p)
298298
uToltype = constvalue(uBottomEltypeNoUnits)
299-
tab = RadauIIA7Tableau(uToltype, constvalue(tTypeNoUnits))
299+
tab = RadauIIA9Tableau(uToltype, constvalue(tTypeNoUnits))
300300

301301
κ = alg.κ !== nothing ? convert(uToltype, alg.κ) : convert(uToltype, 1 // 100)
302302
J = false .* _vec(rate_prototype) .* _vec(rate_prototype)'
303303

304-
RadauIIA7ConstantCache(uf, tab, κ, one(uToltype), 10000, u, u, u, u, dt, dt,
304+
RadauIIA9ConstantCache(uf, tab, κ, one(uToltype), 10000, u, u, u, u, dt, dt,
305305
Convergence, J)
306306
end
307307

308-
mutable struct RadauIIA7Cache{uType, cuType, uNoUnitsType, rateType, JType, W1Type, W2Type,
308+
mutable struct RadauIIA9Cache{uType, cuType, uNoUnitsType, rateType, JType, W1Type, W2Type,
309309
UF, JC, F1, F2, Tab, Tol, Dt, rTol, aTol, StepLimiter} <:
310310
OrdinaryDiffEqMutableCache
311311
u::uType
@@ -370,13 +370,13 @@ mutable struct RadauIIA7Cache{uType, cuType, uNoUnitsType, rateType, JType, W1Ty
370370
step_limiter!::StepLimiter
371371
end
372372

373-
function alg_cache(alg::RadauIIA7, u, rate_prototype, ::Type{uEltypeNoUnits},
373+
function alg_cache(alg::RadauIIA9, u, rate_prototype, ::Type{uEltypeNoUnits},
374374
::Type{uBottomEltypeNoUnits},
375375
::Type{tTypeNoUnits}, uprev, uprev2, f, t, dt, reltol, p, calck,
376376
::Val{true}) where {uEltypeNoUnits, uBottomEltypeNoUnits, tTypeNoUnits}
377377
uf = UJacobianWrapper(f, t, p)
378378
uToltype = constvalue(uBottomEltypeNoUnits)
379-
tab = RadauIIA7Tableau(uToltype, constvalue(tTypeNoUnits))
379+
tab = RadauIIA9Tableau(uToltype, constvalue(tTypeNoUnits))
380380

381381
κ = alg.κ !== nothing ? convert(uToltype, alg.κ) : convert(uToltype, 1 // 100)
382382

@@ -457,7 +457,7 @@ function alg_cache(alg::RadauIIA7, u, rate_prototype, ::Type{uEltypeNoUnits},
457457
rtol = reltol isa Number ? reltol : zero(reltol)
458458
atol = reltol isa Number ? reltol : zero(reltol)
459459

460-
RadauIIA7Cache(u, uprev,
460+
RadauIIA9Cache(u, uprev,
461461
z1, z2, z3, z4, z5, w1, w2, w3, w4, w5,
462462
dw1, ubuff, dw23, dw45, cubuff1, cubuff2, cont1, cont2, cont3, cont4,
463463
du1, fsalfirst, k, k2, k3, k4, k5, fw1, fw2, fw3, fw4, fw5,

lib/OrdinaryDiffEqFIRK/src/firk_perform_step.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function initialize!(integrator, cache::RadauIIA5ConstantCache)
5151
nothing
5252
end
5353

54-
function initialize!(integrator, cache::RadauIIA7ConstantCache)
54+
function initialize!(integrator, cache::RadauIIA9ConstantCache)
5555
integrator.kshortsize = 2
5656
integrator.k = typeof(integrator.k)(undef, integrator.kshortsize)
5757
integrator.fsalfirst = integrator.f(integrator.uprev, integrator.p, integrator.t) # Pre-start fsal
@@ -98,7 +98,7 @@ function initialize!(integrator, cache::RadauIIA5Cache)
9898
nothing
9999
end
100100

101-
function initialize!(integrator, cache::RadauIIA7Cache)
101+
function initialize!(integrator, cache::RadauIIA9Cache)
102102
integrator.kshortsize = 2
103103
integrator.fsalfirst = cache.fsalfirst
104104
integrator.fsallast = cache.k
@@ -784,7 +784,7 @@ end
784784
return
785785
end
786786

787-
@muladd function perform_step!(integrator, cache::RadauIIA7ConstantCache,
787+
@muladd function perform_step!(integrator, cache::RadauIIA9ConstantCache,
788788
repeat_step = false)
789789
@unpack t, dt, uprev, u, f, p = integrator
790790
@unpack T11, T12, T13, T14, T15, T21, T22, T23, T24, T25, T31, T32, T33, T34, T35, T41, T42, T43, T44, T45, T51 = cache.tab #= T52 = 1, T53 = 0, T54 = 1, T55 = 0=#
@@ -1014,7 +1014,7 @@ end
10141014
return
10151015
end
10161016

1017-
@muladd function perform_step!(integrator, cache::RadauIIA7Cache, repeat_step = false)
1017+
@muladd function perform_step!(integrator, cache::RadauIIA9Cache, repeat_step = false)
10181018
@unpack t, dt, uprev, u, f, p, fsallast, fsalfirst = integrator
10191019
@unpack T11, T12, T13, T14, T15, T21, T22, T23, T24, T25, T31, T32, T33, T34, T35, T41, T42, T43, T44, T45, T51 = cache.tab #= T52 = 1, T53 = 0, T54 = 1, T55 = 0=#
10201020
@unpack TI11, TI12, TI13, TI14, TI15, TI21, TI22, TI23, TI24, TI25, TI31, TI32, TI33, TI34, TI35, TI41, TI42, TI43, TI44, TI45, TI51, TI52, TI53, TI54, TI55 = cache.tab

lib/OrdinaryDiffEqFIRK/src/firk_tableaus.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ function RadauIIA5Tableau(T, T2)
111111
e1, e2, e3)
112112
end
113113

114-
struct RadauIIA7Tableau{T, T2}
114+
struct RadauIIA9Tableau{T, T2}
115115
T11::T
116116
T12::T
117117
T13::T
@@ -178,7 +178,7 @@ struct RadauIIA7Tableau{T, T2}
178178
e5::T
179179
end
180180

181-
function RadauIIA7Tableau(T, T2)
181+
function RadauIIA9Tableau(T, T2)
182182
T11 = convert(T, -1.251758622050104589014e-2)
183183
T12 = convert(T, -1.024204781790882707009e-2)
184184
T13 = convert(T, 4.767387729029572386318e-2)
@@ -248,7 +248,7 @@ function RadauIIA7Tableau(T, T2)
248248
e4 = convert(T, 5.920031671845428725662e-1)
249249
e5 = convert(T, -2.000000000000000000000e-1)
250250

251-
RadauIIA7Tableau{T, T2}(T11, T12, T13, T14, T15,
251+
RadauIIA9Tableau{T, T2}(T11, T12, T13, T14, T15,
252252
T21, T22, T23, T24, T25, T31, T32, T33, T34, T35,
253253
T41, T42, T43, T44, T45, T51, #=T52, T53, T54, T55=#
254254
TI11, TI12, TI13, TI14, TI15, TI21, TI22, TI23, TI24, TI25,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@inline function DiffEqBase.get_tmp_cache(integrator, alg::Union{RadauIIA3, RadauIIA5, RadauIIA7},
1+
@inline function DiffEqBase.get_tmp_cache(integrator, alg::Union{RadauIIA3, RadauIIA5, RadauIIA9},
22
cache::OrdinaryDiffEqMutableCache)
33
(cache.tmp, cache.atmp)
44
end

lib/OrdinaryDiffEqFIRK/test/ode_firk_tests.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ for prob in [prob_ode_linear, prob_ode_2Dlinear]
88
@test sim21.𝒪est[:final]5 atol=testTol
99
end
1010

11-
sim21 = test_convergence(1 ./ 2 .^ (2.777:-1:0.777), prob_ode_linear, RadauIIA7())
12-
@test sim21.𝒪est[:final]7 atol=testTol
11+
sim21 = test_convergence(1 ./ 2 .^ (2.5:-1:0.5), prob_ode_linear, RadauIIA9())
12+
@test sim21.𝒪est[:final]8 atol=testTol
1313

14-
sim21 = test_convergence(1 ./ 2 .^ (2.777:-1:0.777), prob_ode_2Dlinear, RadauIIA7())
14+
sim21 = test_convergence(1 ./ 2 .^ (2.5:-1:0.5), prob_ode_2Dlinear, RadauIIA9())
1515
@test sim21.𝒪est[:final]8 atol=testTol
1616

1717
# test adaptivity
@@ -57,4 +57,4 @@ for iip in (true, false)
5757
@test sol.stats.njacs < sol.stats.nw # W reuse
5858
end
5959
@test length(sol) < 5000 # the error estimate is not very good
60-
end
60+
end

0 commit comments

Comments
 (0)