Skip to content

Commit f4be98b

Browse files
Swap use of old and new names
1 parent 2b07114 commit f4be98b

File tree

11 files changed

+52
-52
lines changed

11 files changed

+52
-52
lines changed

docs/src/algorithms.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ ForwardEulerODEFunction
1515
## IMEX ARK methods
1616

1717
```@docs
18-
IMEXARKAlgorithm
19-
make_IMEXARKTableau
18+
OldIMEXARKAlgorithm
19+
Oldmake_IMEXARKTableau
2020
```
2121

2222
The convergence orders of the provided methods are verified using test cases from [ARKode](http://runge.math.smu.edu/ARKode_example.pdf). Plots of the solutions to these test cases, the errors of these solutions, and the convergence orders with respect to `dt` are shown below.
@@ -90,7 +90,7 @@ ARK548L2SA2KennedyCarpenter
9090

9191
### ARS
9292

93-
TODO: `ARS111`, `ARS121`, and `ARS343` should probably be types, and not constants, so that we can properly document them.
93+
TODO: add `ARS111`, `ARS121`, and `ARS343` docs.
9494

9595
## Multirate
9696

perf/flame.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ elseif problem_str=="fe"
3030
else
3131
error("Bad option")
3232
end
33-
algorithm = CTS.IMEXARKAlgorithm(ARS343(), NewtonsMethod(; max_iters = 2))
33+
algorithm = CTS.OldIMEXARKAlgorithm(OldARS343(), NewtonsMethod(; max_iters = 2))
3434
dt = 0.01
3535
integrator = DiffEqBase.init(prob, algorithm; dt)
3636
not_generated_cache = CTS.not_generated_cache(prob, algorithm)

perf/jet.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ end
1515
cts = joinpath(dirname(@__DIR__));
1616
include(joinpath(cts, "test", "problems.jl"))
1717
function config_integrators(problem)
18-
algorithm = CTS.IMEXARKAlgorithm(ARS343(), NewtonsMethod(; linsolve = linsolve_direct, max_iters = 2))
18+
algorithm = CTS.OldIMEXARKAlgorithm(OldARS343(), NewtonsMethod(; linsolve = linsolve_direct, max_iters = 2))
1919
dt = 0.01
2020
integrator = DiffEqBase.init(problem, algorithm; dt)
2121
not_generated_integrator = DiffEqBase.init(problem, algorithm; dt)

src/convergence_orders.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ const second_order_tableau = [
3636
#####
3737
const third_order_tableau = [
3838
ARS233,
39+
OldARS343,
3940
ARS343,
40-
NewARS343,
4141
ARS443,
4242
IMKG342a,
4343
IMKG343a,

src/solvers/imex_ark.jl

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -112,44 +112,44 @@ Is this too messy to do in the general case?
112112
113113
Don't forget about the possible memory optimizations!
114114
=#
115-
export IMEXARKAlgorithm, make_IMEXARKTableau
115+
export OldIMEXARKAlgorithm, Oldmake_IMEXARKTableau
116116

117117
using Base: broadcasted, materialize!
118118
using StaticArrays: SMatrix, SVector
119119

120120
"""
121-
IMEXARKAlgorithm <: DistributedODEAlgorithm
121+
OldIMEXARKAlgorithm <: DistributedODEAlgorithm
122122
123123
A generic implementation of an IMEX ARK algorithm that can handle arbitrary
124124
Butcher tableaus and problems specified using either `ForwardEulerODEFunction`s
125125
or regular `ODEFunction`s.
126126
"""
127-
struct IMEXARKAlgorithm{as, cs, N} <: AbstractIMEXARKAlgorithm
127+
struct OldIMEXARKAlgorithm{as, cs, N} <: AbstractIMEXARKAlgorithm
128128
newtons_method::N
129129
end
130130

131-
IMEXARKAlgorithm{as, cs}(newtons_method::N) where {as, cs, N} =
132-
IMEXARKAlgorithm{as, cs, N}(newtons_method)
131+
OldIMEXARKAlgorithm{as, cs}(newtons_method::N) where {as, cs, N} =
132+
OldIMEXARKAlgorithm{as, cs, N}(newtons_method)
133133

134134
"""
135-
IMEXARKAlgorithm(::AbstractIMEXARKAlgorithm, newtons_method)
135+
OldIMEXARKAlgorithm(::AbstractIMEXARKAlgorithm, newtons_method)
136136
137137
Returns the imex ARK algorithm for a particular algorithm.
138138
"""
139-
function IMEXARKAlgorithm(tab::AbstractIMEXARKTableau, newtons_method)
139+
function OldIMEXARKAlgorithm(tab::AbstractIMEXARKTableau, newtons_method)
140140
tableau(tab)(newtons_method)
141141
end
142142

143143
"""
144-
make_IMEXARKTableau(; a_exp, b_exp, c_exp, a_imp, b_imp, c_imp)
144+
Oldmake_IMEXARKTableau(; a_exp, b_exp, c_exp, a_imp, b_imp, c_imp)
145145
146-
Generates an `IMEXARKAlgorithm` type from an IMEX ARK Butcher tableau. Only
146+
Generates an `OldIMEXARKAlgorithm` type from an IMEX ARK Butcher tableau. Only
147147
`a_exp` and `a_imp` are required arguments; the default values for `b_exp` and
148148
`b_imp` assume that the algorithm is FSAL (first same as last), and the default
149149
values for `c_exp` and `c_imp` assume that the algorithm is internally
150150
consistent.
151151
"""
152-
function make_IMEXARKTableau(;
152+
function Oldmake_IMEXARKTableau(;
153153
a_exp::SMatrix{s, s},
154154
b_exp::SVector{s} = vec(a_exp[end, :]),
155155
c_exp::SVector{s} = vec(sum(a_exp; dims = 2)),
@@ -165,7 +165,7 @@ function make_IMEXARKTableau(;
165165
as = (vcat(a_exp, b_exp'), vcat(a_imp, b_imp'))
166166
end
167167
cs = (c_exp, c_imp)
168-
return IMEXARKAlgorithm{as, cs}
168+
return OldIMEXARKAlgorithm{as, cs}
169169
end
170170

171171
# General helper functions
@@ -208,7 +208,7 @@ end
208208
# interval graph for all required cached values.
209209
function cache(
210210
prob::DiffEqBase.AbstractODEProblem,
211-
alg::IMEXARKAlgorithm{as, cs};
211+
alg::OldIMEXARKAlgorithm{as, cs};
212212
kwargs...
213213
) where {as, cs}
214214
f_cache(χ, a, f_type) = is_increment(f_type) ?
@@ -440,7 +440,7 @@ step_u!(integrator, cache::IMEXARKCache) =
440440

441441
function not_generated_cache(
442442
prob::DiffEqBase.AbstractODEProblem,
443-
alg::IMEXARKAlgorithm{as, cs};
443+
alg::OldIMEXARKAlgorithm{as, cs};
444444
kwargs...
445445
) where {as, cs}
446446
f_cache(χ, a, f_type) = is_increment(f_type) ?

src/solvers/imex_ark2.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export ClimaODEFunction, NewIMEXARKAlgorithm, NewARS343
1+
export ClimaODEFunction, IMEXARKAlgorithm, ARS343
22

33
Base.@kwdef struct ClimaODEFunction{TL, TE, TI, L, D, S} <: DiffEqBase.AbstractODEFunction{true}
44
T_lim!::TL = nothing # nothing or (uₜ, u, p, t) -> ...
@@ -31,10 +31,10 @@ IMEXARKTableau(;
3131
) = IMEXARKTableau(a_exp, b_exp, c_exp, a_imp, b_imp, c_imp)
3232

3333

34-
struct NewIMEXARKAlgorithm{T <: IMEXARKTableau, NM} <: DistributedODEAlgorithm
34+
struct IMEXARKAlgorithm{T <: IMEXARKTableau, NM} <: DistributedODEAlgorithm
3535
tab::T
3636
newtons_method::NM
37-
function NewIMEXARKAlgorithm(tabname::AbstractTableau, newtons_method)
37+
function IMEXARKAlgorithm(tabname::AbstractTableau, newtons_method)
3838
tab = tableau(tabname)
3939
T = typeof(tab)
4040
new{T, typeof(newtons_method)}(tab, newtons_method)
@@ -44,8 +44,8 @@ end
4444

4545
# TODO: make new package, ButcherTableaus.jl? Or just separate into separate file
4646

47-
struct NewARS343 <: AbstractIMEXARKTableau end
48-
function tableau(::NewARS343)
47+
struct ARS343 <: AbstractIMEXARKTableau end
48+
function tableau(::ARS343)
4949
γ = 0.4358665215084590
5050
a42 = 0.5529291480359398
5151
a43 = a42
@@ -89,7 +89,7 @@ struct NewIMEXARKCache{SCU, SCE, SCI, T, Γ, NMC}
8989
newtons_method_cache::NMC
9090
end
9191

92-
function cache(prob::DiffEqBase.AbstractODEProblem, alg::NewIMEXARKAlgorithm; kwargs...)
92+
function cache(prob::DiffEqBase.AbstractODEProblem, alg::IMEXARKAlgorithm; kwargs...)
9393
(; u0, f) = prob
9494
(; T_imp!) = f
9595
(; tab, newtons_method) = alg

src/solvers/imex_ark_tableaus.jl

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export AbstractIMEXARKTableau
2-
export ARS111, ARS121, ARS122, ARS233, ARS232, ARS222, ARS343, ARS443
2+
export ARS111, ARS121, ARS122, ARS233, ARS232, ARS222, OldARS343, ARS443
33
export IMKG232a, IMKG232b, IMKG242a, IMKG242b, IMKG252a, IMKG252b
44
export IMKG253a, IMKG253b, IMKG254a, IMKG254b, IMKG254c, IMKG342a, IMKG343a
55
export DBM453, HOMMEM1
@@ -20,15 +20,15 @@ using StaticArrays: @SArray, SMatrix, sacollect
2020
struct ARS111 <: AbstractIMEXARKTableau end
2121

2222
function tableau(::ARS111)
23-
make_IMEXARKTableau(;
23+
Oldmake_IMEXARKTableau(;
2424
a_exp = @SArray([0 0; 1 0]),
2525
a_imp = @SArray([0 0; 0 1]),
2626
)
2727
end
2828

2929
struct ARS121 <: AbstractIMEXARKTableau end
3030
function tableau(::ARS121)
31-
make_IMEXARKTableau(;
31+
Oldmake_IMEXARKTableau(;
3232
a_exp = @SArray([0 0; 1 0]),
3333
b_exp = @SArray([0, 1]),
3434
a_imp = @SArray([0 0; 0 1]),
@@ -37,7 +37,7 @@ end
3737

3838
struct ARS122 <: AbstractIMEXARKTableau end
3939
function tableau(::ARS122)
40-
make_IMEXARKTableau(;
40+
Oldmake_IMEXARKTableau(;
4141
a_exp = @SArray([0 0; 1/2 0]),
4242
b_exp = @SArray([0, 1]),
4343
a_imp = @SArray([0 0; 0 1/2]),
@@ -48,7 +48,7 @@ end
4848
struct ARS233 <: AbstractIMEXARKTableau end
4949
function tableau(::ARS233)
5050
γ = 1/2 + 3/6
51-
make_IMEXARKTableau(;
51+
Oldmake_IMEXARKTableau(;
5252
a_exp = @SArray([
5353
0 0 0;
5454
γ 0 0;
@@ -68,7 +68,7 @@ struct ARS232 <: AbstractIMEXARKTableau end
6868
function tableau(::ARS232)
6969
γ = 1 - 2/2
7070
δ = -22/3
71-
make_IMEXARKTableau(;
71+
Oldmake_IMEXARKTableau(;
7272
a_exp = @SArray([
7373
0 0 0;
7474
γ 0 0;
@@ -87,7 +87,7 @@ struct ARS222 <: AbstractIMEXARKTableau end
8787
function tableau(::ARS222)
8888
γ = 1 - 2/2
8989
δ = 1 - 1/2γ
90-
make_IMEXARKTableau(;
90+
Oldmake_IMEXARKTableau(;
9191
a_exp = @SArray([
9292
0 0 0;
9393
γ 0 0;
@@ -101,8 +101,8 @@ function tableau(::ARS222)
101101
)
102102
end
103103

104-
struct ARS343 <: AbstractIMEXARKTableau end
105-
function tableau(::ARS343)
104+
struct OldARS343 <: AbstractIMEXARKTableau end
105+
function tableau(::OldARS343)
106106
γ = 0.4358665215084590
107107
a42 = 0.5529291480359398
108108
a43 = 0.5529291480359398
@@ -113,7 +113,7 @@ function tableau(::ARS343)
113113
a32 = (-1 + 9/2 * γ - 3/2 * γ^2) * a42 +
114114
(-11/4 + 21/2 * γ - 15/4 * γ^2) * a43 + 4 - 25/2 * γ + 9/2 * γ^2
115115
a41 = 1 - a42 - a43
116-
make_IMEXARKTableau(;
116+
Oldmake_IMEXARKTableau(;
117117
a_exp = @SArray([
118118
0 0 0 0;
119119
γ 0 0 0;
@@ -132,7 +132,7 @@ end
132132

133133
struct ARS443 <: AbstractIMEXARKTableau end
134134
function tableau(::ARS443)
135-
make_IMEXARKTableau(;
135+
Oldmake_IMEXARKTableau(;
136136
a_exp = @SArray([
137137
0 0 0 0 0;
138138
1/2 0 0 0 0;
@@ -181,7 +181,7 @@ imkg_imp(i, j, α̂, β, δ̂) = i == j + 1 ? α̂[j] :
181181
function make_IMKGAlgorithm(α, α̂, δ̂, β = ntuple(_ -> 0, length(δ̂)))
182182
s = length(α̂) + 1
183183
type = SMatrix{s, s}
184-
return make_IMEXARKTableau(;
184+
return Oldmake_IMEXARKTableau(;
185185
a_exp = sacollect(type, imkg_exp(i, j, α, β) for i in 1:s, j in 1:s),
186186
a_imp = sacollect(type, imkg_imp(i, j, α̂, β, δ̂) for i in 1:s, j in 1:s),
187187
)
@@ -374,7 +374,7 @@ end
374374
struct DBM453 <: AbstractIMEXARKTableau end
375375
function tableau(::DBM453)
376376
γ = 0.32591194130117247
377-
make_IMEXARKTableau(;
377+
Oldmake_IMEXARKTableau(;
378378
a_exp = @SArray([
379379
0 0 0 0 0;
380380
0.10306208811591838 0 0 0 0;
@@ -406,7 +406,7 @@ end
406406

407407
struct HOMMEM1 <: AbstractIMEXARKTableau end
408408
function tableau(::HOMMEM1)
409-
make_IMEXARKTableau(;
409+
Oldmake_IMEXARKTableau(;
410410
a_exp = @SArray([
411411
0 0 0 0 0 0;
412412
1/5 0 0 0 0 0;

test/compare_generated.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ using Test, BenchmarkTools, DiffEqBase, ClimaTimeSteppers
44
include("problems.jl")
55

66
@testset "Generated vs. Not Generated" begin
7-
algorithm = CTS.IMEXARKAlgorithm(ARS343(), NewtonsMethod(; max_iters = 2))
7+
algorithm = CTS.OldIMEXARKAlgorithm(OldARS343(), NewtonsMethod(; max_iters = 2))
88
dt = 0.01
99
for problem in (
1010
split_linear_prob_wfact_split(),

test/convergence.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ ENV["GKSwstype"] = "nul" # avoid displaying plots
5050
tab2 = (ARS122, ARS232, ARS222, IMKG232a, IMKG232b, IMKG242a, IMKG242b)
5151
tab2 = (tab2..., IMKG252a, IMKG252b, IMKG253a, IMKG253b, IMKG254a)
5252
tab2 = (tab2..., IMKG254b, IMKG254c, HOMMEM1)
53-
tab3 = (ARS233, ARS343, ARS443, IMKG342a, IMKG343a, DBM453)
53+
tab3 = (ARS233, OldARS343, ARS443, IMKG342a, IMKG343a, DBM453)
5454
tabs = [tab1..., tab2..., tab3...]
5555
test_algs("IMEX ARK", tabs, ark_analytic_nonlin_test(Float64), 400)
5656
test_algs("IMEX ARK", tabs, ark_analytic_sys_test(Float64), 60)
5757
test_algs("IMEX ARK", tabs, ark_analytic_test(Float64), 16000; super_convergence=ARS121)
5858
end
5959

6060
@testset "New IMEX ARK Algorithms" begin
61-
tabs = [NewARS343]
61+
tabs = [ARS343]
6262
test_algs("IMEX ARK", tabs, ark_analytic_nonlin_test_cts(Float64), 400)
6363
test_algs("IMEX ARK", tabs, ark_analytic_sys_test_cts(Float64), 60)
6464
test_algs("IMEX ARK", tabs, ark_analytic_test_cts(Float64), 16000)

test/single_column_ARS_test.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -265,12 +265,12 @@ end
265265

266266

267267
algorithms = (
268-
CTS.IMEXARKAlgorithm(ARS111(), NewtonsMethod(; max_iters = 1)),
269-
CTS.IMEXARKAlgorithm(ARS121(), NewtonsMethod(; max_iters = 1)),
270-
CTS.IMEXARKAlgorithm(ARS122(), NewtonsMethod(; max_iters = 1)),
271-
CTS.IMEXARKAlgorithm(ARS232(), NewtonsMethod(; max_iters = 1)),
272-
CTS.IMEXARKAlgorithm(ARS222(), NewtonsMethod(; max_iters = 1)),
273-
CTS.IMEXARKAlgorithm(ARS343(), NewtonsMethod(; max_iters = 1)),
268+
CTS.OldIMEXARKAlgorithm(ARS111(), NewtonsMethod(; max_iters = 1)),
269+
CTS.OldIMEXARKAlgorithm(ARS121(), NewtonsMethod(; max_iters = 1)),
270+
CTS.OldIMEXARKAlgorithm(ARS122(), NewtonsMethod(; max_iters = 1)),
271+
CTS.OldIMEXARKAlgorithm(ARS232(), NewtonsMethod(; max_iters = 1)),
272+
CTS.OldIMEXARKAlgorithm(ARS222(), NewtonsMethod(; max_iters = 1)),
273+
CTS.OldIMEXARKAlgorithm(OldARS343(), NewtonsMethod(; max_iters = 1)),
274274
)
275275
reference_sol_norm = [860.2745315698107; 860.2745315698107; 860.4393569534262;
276276
860.452530117785; 860.452530117785; ref_ARS343]

0 commit comments

Comments
 (0)