ODE Solvers
Interface
ClimaTimeSteppers.ClimaODEFunction
— TypeClimaODEFunction(; T_imp!, [dss!], [cache!], [cache_imp!])
ClimaODEFunction(; T_exp!, T_lim!, [T_imp!], [lim!], [dss!], [cache!], [cache_imp!])
ClimaODEFunction(; T_exp_lim!, [T_imp!], [lim!], [dss!], [cache!], [cache_imp!])
Container for all functions used to advance through a timestep: - T_imp!(T_imp, u, p, t)
: sets the implicit tendency - T_exp!(T_exp, u, p, t)
: sets the component of the explicit tendency that is not passed through the limiter - T_lim!(T_lim, u, p, t)
: sets the component of the explicit tendency that is passed through the limiter - T_exp_lim!(T_exp, T_lim, u, p, t)
: fused alternative to the separate functions T_exp!
and T_lim!
- lim!(u, p, t, u_ref)
: applies the limiter to every state u
that has been incremented from u_ref
by the explicit tendency component T_lim!
- dss!(u, p, t)
: applies direct stiffness summation to every state u
, except for intermediate states generated within the implicit solver - cache!(u, p, t)
: updates the cache p
to reflect the state u
before the first timestep and on every subsequent timestepping stage - cache_imp!(u, p, t)
: updates the components of the cache p
that are required to evaluate T_imp!
and its Jacobian within the implicit solver By default, lim!
, dss!
, and cache!
all do nothing, and cache_imp!
is identical to cache!
. Any of the tendency functions can be set to nothing
in order to avoid corresponding allocations in the integrator.
ClimaTimeSteppers.AbstractAlgorithmConstraint
— TypeAbstractAlgorithmConstraint
A mechanism for constraining which operations can be performed by an algorithm for solving ODEs.
For example, an unconstrained algorithm might compute a Runge-Kutta stage by taking linear combinations of tendencies; i.e., by adding quantities of the form dt * tendency(state)
. On the other hand, a "strong stability preserving" algorithm can only take linear combinations of "incremented states"; i.e., it only adds quantities of the form state + dt * coefficient * tendency(state)
.
ClimaTimeSteppers.Unconstrained
— TypeUnconstrained
Indicates that an algorithm may perform any supported operations.
ClimaTimeSteppers.SSP
— TypeSSP
Indicates that an algorithm must be "strong stability preserving", which makes it easier to guarantee that the algorithm will preserve monotonicity properties satisfied by the initial state. For example, this ensures that the algorithm will be able to use limiters in a mathematically consistent way.
ClimaTimeSteppers.IMEXTableau
— TypeIMEXTableau(; a_exp, b_exp, c_exp, a_imp, b_imp, c_imp)
A wrapper for an IMEX Butcher tableau (or, more accurately, a pair of Butcher tableaus, one for explicit tendencies and the other for implicit tendencies). Only a_exp
and a_imp
are required arguments; the default values for b_exp
and b_imp
assume that the algorithm is FSAL (first same as last), and the default values for c_exp
and c_imp
assume that it is internally consistent.
The explicit tableau must be strictly lower triangular, and the implicit tableau must be lower triangular (only DIRK algorithms are currently supported).
ClimaTimeSteppers.IMEXAlgorithm
— TypeIMEXAlgorithm(tableau, newtons_method, [constraint])
IMEXAlgorithm(name, newtons_method, [constraint])
Constructs an IMEX algorithm for solving ODEs, with an optional name and constraint. The first constructor accepts any IMEXTableau
and an optional constraint, leaving the algorithm unnamed. The second constructor automatically determines the tableau and the default constraint from the algorithm name, which must be an IMEXARKAlgorithmName
.
ClimaTimeSteppers.ExplicitTableau
— TypeExplicitTableau(; a, b, c)
A wrapper for an explicit Butcher tableau. Only a
is a required argument; the default value for b
assumes that the algorithm is FSAL (first same as last), and the default value for c
assumes that it is internally consistent. The matrix a
must be strictly lower triangular.
ClimaTimeSteppers.ExplicitAlgorithm
— FunctionExplicitAlgorithm(tableau, [constraint])
ExplicitAlgorithm(name, [constraint])
Constructs an explicit algorithm for solving ODEs, with an optional name and constraint. The first constructor accepts any ExplicitTableau
and an optional constraint, leaving the algorithm unnamed. The second constructor automatically determines the tableau and the default constraint from the algorithm name, which must be an ERKAlgorithmName
.
Note that using an ExplicitAlgorithm
is merely a shorthand for using an IMEXAlgorithm
with the same tableau for explicit and implicit tendencies (and without Newton's method).
IMEX Algorithm Names
ClimaTimeSteppers.ARS111
— TypeARS111
An IMEX ARK algorithm from [8], section 2, with 1 implicit stage, 1 explicit stage and 1st order accuracy. Also called IMEX Euler or forward-backward Euler; equivalent to OrdinaryDiffEq.IMEXEuler
.
ClimaTimeSteppers.ARS121
— TypeARS121
An IMEX ARK algorithm from [8], section 2, with 1 implicit stage, 2 explicit stages, and 1st order accuracy. Also called IMEX Euler or forward-backward Euler; equivalent to OrdinaryDiffEq.IMEXEulerARK
.
ClimaTimeSteppers.ARS122
— TypeARS122
An IMEX ARK algorithm from [8], section 2, with 1 implicit stage, 2 explicit stages, and 2nd order accuracy. Also called IMEX midpoint.
ClimaTimeSteppers.ARS233
— TypeARS233
An IMEX ARK algorithm from [8], section 2, with 2 implicit stages, 3 explicit stages, and 3rd order accuracy.
ClimaTimeSteppers.ARS232
— TypeARS232
An IMEX ARK algorithm from [8], section 2, with 2 implicit stages, 3 explicit stages, and 2nd order accuracy.
ClimaTimeSteppers.ARS222
— TypeARS222
An IMEX ARK algorithm from [8], section 2, with 2 implicit stages, 2 explicit stages, and 2nd order accuracy.
ClimaTimeSteppers.ARS343
— TypeARS343
An IMEX ARK algorithm from [8], section 2, with 3 implicit stages, 4 explicit stages, and 3rd order accuracy.
ClimaTimeSteppers.ARS443
— TypeARS443
An IMEX ARK algorithm from [8], section 2, with 4 implicit stages, 4 explicit stages, and 3rd order accuracy.
ClimaTimeSteppers.IMKG232a
— TypeIMKG232a
An IMEX ARK algorithm from [9], Table 3, with 2 implicit stages, 3 explicit stages, and 2nd order accuracy.
ClimaTimeSteppers.IMKG232b
— TypeIMKG232b
An IMEX ARK algorithm from [9], Table 3, with 2 implicit stages, 3 explicit stages, and 2nd order accuracy.
ClimaTimeSteppers.IMKG242a
— TypeIMKG242a
An IMEX ARK algorithm from [9], Table 3, with 2 implicit stages, 4 explicit stages, and 2nd order accuracy.
ClimaTimeSteppers.IMKG242b
— TypeIMKG242b
An IMEX ARK algorithm from [9], Table 3, with 2 implicit stages, 4 explicit stages, and 2nd order accuracy.
ClimaTimeSteppers.IMKG243a
— TypeIMKG243a
An IMEX ARK algorithm from [9], Table 3, with 3 implicit stages, 4 explicit stages, and 2nd order accuracy.
ClimaTimeSteppers.IMKG252a
— TypeIMKG252a
An IMEX ARK algorithm from [9], Table 3, with 2 implicit stages, 5 explicit stages, and 2nd order accuracy.
ClimaTimeSteppers.IMKG252b
— TypeIMKG252b
An IMEX ARK algorithm from [9], Table 3, with 2 implicit stages, 5 explicit stages, and 2nd order accuracy.
ClimaTimeSteppers.IMKG253a
— TypeIMKG253a
An IMEX ARK algorithm from [9], Table 3, with 3 implicit stages, 5 explicit stages, and 2nd order accuracy.
ClimaTimeSteppers.IMKG253b
— TypeIMKG253b
An IMEX ARK algorithm from [9], Table 3, with 3 implicit stages, 5 explicit stages, and 2nd order accuracy.
ClimaTimeSteppers.IMKG254a
— TypeIMKG254a
An IMEX ARK algorithm from [9], Table 3, with 4 implicit stages, 5 explicit stages, and 2nd order accuracy.
ClimaTimeSteppers.IMKG254b
— TypeIMKG254b
An IMEX ARK algorithm from [9], Table 3, with 4 implicit stages, 5 explicit stages, and 2nd order accuracy.
ClimaTimeSteppers.IMKG254c
— TypeIMKG254c
An IMEX ARK algorithm from [9], Table 3, with 4 implicit stages, 5 explicit stages, and 2nd order accuracy.
ClimaTimeSteppers.IMKG342a
— TypeIMKG342a
An IMEX ARK algorithm from [9], Table 4, with 2 implicit stages, 4 explicit stages, and 3rd order accuracy.
ClimaTimeSteppers.IMKG343a
— TypeIMKG343a
An IMEX ARK algorithm from [9], Table 4, with 3 implicit stages, 4 explicit stages, and 3rd order accuracy.
ClimaTimeSteppers.SSP222
— TypeSSP222
An IMEX SSPRK algorithm from [10], with 2 implicit stages, 2 explicit stages, and 2nd order accuracy. Also called SSP2(222) in [11].
ClimaTimeSteppers.SSP322
— TypeSSP322
An IMEX SSPRK algorithm from [10], with 3 implicit stages, 2 explicit stages, and 2nd order accuracy.
ClimaTimeSteppers.SSP332
— TypeSSP332
An IMEX SSPRK algorithm from [10], with 3 implicit stages, 3 explicit stages, and 2nd order accuracy. Also called SSP2(332)a in [11].
ClimaTimeSteppers.SSP333
— TypeSSP333(; β = 1/2 + √3/6)
Family of IMEX SSPRK algorithms parametrized by the value β from [12], Section 3.2, with 3 implicit stages, 3 explicit stages, and 3rd order accuracy. The default value of β results in an SDIRK algorithm, which is also called SSP3(333)c in [11].
ClimaTimeSteppers.SSP433
— TypeSSP433
An IMEX SSPRK algorithm from [10], with 4 implicit stages, 3 explicit stages, and 3rd order accuracy. Also called SSP3(433) in [11].
ClimaTimeSteppers.DBM453
— TypeDBM453
An IMEX ARK algorithm from [13], Appendix A, with 4 implicit stages, 5 explicit stages, and 3rd order accuracy.
ClimaTimeSteppers.HOMMEM1
— TypeHOMMEM1
An IMEX ARK algorithm from [14], section 4.1, with 5 implicit stages, 6 explicit stages, and 2nd order accuracy.
ClimaTimeSteppers.ARK2GKC
— TypeARK2GKC(; paper_version = false)
An IMEX ARK algorithm from [15] with 2 implicit stages, 3 explicit stages, and 2nd order accuracy. If paper_version = true
, the algorithm uses coefficients from the paper. Otherwise, it uses coefficients that make it more stable but less accurate.
ClimaTimeSteppers.ARK437L2SA1
— TypeARK437L2SA1
An IMEX ARK algorithm from [16], Table 8, with 6 implicit stages, 7 explicit stages, and 4th order accuracy. Written as ARK4(3)7L[2]SA₁ in the paper.
ClimaTimeSteppers.ARK548L2SA2
— TypeARK548L2SA2
An IMEX ARK algorithm from [16], Table 8, with 7 implicit stages, 8 explicit stages, and 5th order accuracy. Written as ARK5(4)8L[2]SA₂ in the paper.
ClimaTimeSteppers.SSPKnoth
— TypeSSPKnoth
SSPKnoth
is a second-order Rosenbrock method developed by Oswald Knoth.
The coefficients are the same as in CGDycore.jl
, except that for C we add the diagonal elements too. Note, however, that the elements on the diagonal of C do not really matter because C is only used in its lower triangular part. We add them mostly to match literature on the subject
Explicit Algorithm Names
ClimaTimeSteppers.SSP22Heuns
— TypeSSP22Heuns
An SSPRK algorithm from [17], with 2 stages and 2nd order accuracy. Also called Heun's method ([18]).
ClimaTimeSteppers.SSP33ShuOsher
— TypeSSP33ShuOsher
An SSPRK algorithm from [17], with 3 stages and 3rd order accuracy.
ClimaTimeSteppers.RK4
— TypeRK4
The RK4 algorithm from [19], a Runge-Kutta method with 4 stages and 4th order accuracy.
Old LSRK Interface
ClimaTimeSteppers.ForwardEulerODEFunction
— TypeForwardEulerODEFunction(f; jac_prototype, Wfact, tgrad)
An ODE function wrapper where f(un, u, p, t, dt)
provides a forward Euler update
un .= u .+ dt * f(u, p, t)
ClimaTimeSteppers.LowStorageRungeKutta2N
— TypeLowStorageRungeKutta2N <: DistributedODEAlgorithm
A class of low-storage Runge-Kutta algorithms, which use only one additional copy of the state vector $u$ (often referred to as $2N$ schemes).
The available implementations are:
ClimaTimeSteppers.LSRK54CarpenterKennedy
— TypeLSRK54CarpenterKennedy()
The 4th-order, 5-stage [LowStorageRungeKutta2N
])(ref) scheme from Solution 3 of [20].
ClimaTimeSteppers.LSRK144NiegemannDiehlBusch
— TypeLSRK144NiegemannDiehlBusch()
The 4th-order, 14-stage, [LowStorageRungeKutta2N
])(ref) scheme of [21] with optimized stability region
ClimaTimeSteppers.LSRKEulerMethod
— TypeLSRKEulerMethod()
An implementation of explicit Euler method using LowStorageRungeKutta2N
infrastructure. This is mainly for debugging.
Old Multirate Interface
ClimaTimeSteppers.Multirate
— TypeMultirate(fast, slow)
A multirate Runge–Kutta scheme, combining fast
and slow
algorithms
slow
can be any algorithm providing methods for the following functions
init_inner(prob, outercache, dt)
update_inner!(innerinteg, outercache, f_slow, u, p, t, dt, stage)
Algorithms which currently support this are:
ClimaTimeSteppers.MultirateInfinitesimalStep
— TypeMultirateInfinitesimalStep
Multirate Infinitesimal Step (MIS) methods of [4] and [5].
The available implementations are:
ClimaTimeSteppers.MIS2
— TypeMIS2()
The MIS2 Multirate Infinitesimal Step (MIS) method of [5].
ClimaTimeSteppers.MIS3C
— TypeMIS3C()
The MIS3C Multirate Infinitesimal Step (MIS) method of [5].
ClimaTimeSteppers.MIS4
— TypeMIS4()
The MIS4 Multirate Infinitesimal Step (MIS) method of [5].
ClimaTimeSteppers.MIS4a
— TypeMIS4a()
The MIS4a Multirate Infinitesimal Step (MIS) method of [5].
ClimaTimeSteppers.TVDMISA
— TypeTVDMISA()
The TVDMISA Total Variation Diminishing (TVD) Multirate Infinitesimal Step (MIS) method of [5].
ClimaTimeSteppers.TVDMISB
— TypeTVDMISB()
The TVDMISB Total Variation Diminishing (TVD) Multirate Infinitesimal Step (MIS) method of [5].
ClimaTimeSteppers.WickerSkamarockRungeKutta
— TypeWickerSkamarockRungeKutta <: DistributedODEAlgorithm
Class of multirate algorithms developed in [6] and [7], which can be used as slow methods in Multirate
.
These require two additional copies of the state vector $u$.
Available implementations are:
ClimaTimeSteppers.WSRK2
— TypeWSRK2()
The 2 stage, 2nd order RK2 scheme of [6].
ClimaTimeSteppers.WSRK3
— TypeWSRK3()
The 3 stage, 2nd order (3rd order for linear problems) RK3 scheme of [7].