Type Hierarchies
The type trees below are generated from the loaded package and reflect the current state of the code. They are useful for understanding how algorithms, tableau names, constraints, and ODE function types relate to each other.
import AbstractTrees as AT
import InteractiveUtils as IU
import ClimaTimeSteppers as CTS
AT.children(x::Type) = IU.subtypes(x)Algorithms
All concrete solvers are subtypes of ClimaTimeSteppers.TimeSteppingAlgorithm:
AT.print_tree(CTS.TimeSteppingAlgorithm)TimeSteppingAlgorithm
├─ LowStorageRungeKutta2N
│ ├─ LSRK144NiegemannDiehlBusch
│ ├─ LSRK54CarpenterKennedy
│ └─ LSRKEulerMethod
├─ MultirateInfinitesimalStep
│ ├─ MIS2
│ ├─ MIS3C
│ ├─ MIS4
│ ├─ MIS4a
│ ├─ TVDMISA
│ └─ TVDMISB
├─ WickerSkamarockRungeKutta
│ ├─ WSRK2
│ └─ WSRK3
├─ IMEXAlgorithm
├─ Multirate
└─ RosenbrockAlgorithmAlgorithm Names (Tableaux)
Each named tableau is a subtype of AbstractAlgorithmName:
AT.print_tree(CTS.AbstractAlgorithmName)AbstractAlgorithmName
├─ ERKAlgorithmName
│ ├─ SSPRKAlgorithmName
│ │ ├─ SSP22Heuns
│ │ └─ SSP33ShuOsher
│ └─ RK4
├─ IMEXARKAlgorithmName
│ ├─ ARK2GKC
│ ├─ ARK437L2SA1
│ ├─ ARK548L2SA2
│ ├─ ARS111
│ ├─ ARS121
│ ├─ ARS122
│ ├─ ARS222
│ ├─ ARS232
│ ├─ ARS233
│ ├─ ARS343
│ ├─ ARS443
│ ├─ IMEXSSPRKAlgorithmName
│ │ ├─ SSP222
│ │ ├─ SSP322
│ │ ├─ SSP332
│ │ ├─ SSP333
│ │ └─ SSP433
│ ├─ DBM453
│ ├─ HOMMEM1
│ ├─ IMKG232a
│ ├─ IMKG232b
│ ├─ IMKG242a
│ ├─ IMKG242b
│ ├─ IMKG243a
│ ├─ IMKG252a
│ ├─ IMKG252b
│ ├─ IMKG253a
│ ├─ IMKG253b
│ ├─ IMKG254a
│ ├─ IMKG254b
│ ├─ IMKG254c
│ ├─ IMKG342a
│ └─ IMKG343a
└─ RosenbrockAlgorithmName
└─ SSPKnothAlgorithm Constraints
AT.print_tree(CTS.AbstractAlgorithmConstraint)AbstractAlgorithmConstraint
├─ SSP
└─ UnconstrainedODE Function Types
AT.print_tree(CTS.AbstractClimaODEFunction)AbstractClimaODEFunction
└─ ClimaODEFunctionInternal Types
OffsetODEFunction
Multirate algorithms (MIS, Wicker-Skamarock) solve an "inner ODE" representing the fast tendency $f_F$ during each outer stage. The inner problem runs over a substep interval $\tau \in [\tau_{i-1}, \tau_i]$ with the slow tendency $f_S$ held fixed as a constant forcing term.
To reuse standard timesteppers for the inner problem without allocating new functions, ClimaTimeSteppers.jl uses OffsetODEFunction. This wrapper dynamically offsets the inner integration time and adds the constant slow forcing:
\[f_{\text{offset}}(u, p, \tau) = f_F(u, p, \alpha + \beta \tau) + \gamma \cdot x\]
The parameters $\alpha, \beta, \gamma, x$ are mutated in-place by the outer multirate solver at the start of each stage. This design achieves zero-allocation multirate stepping.
Sparse Containers and Coefficients
To achieve zero-allocation stepping and eliminate operations on zero coefficients at compile time, ClimaTimeSteppers.jl uses specialized sparse structures for storing and masking Butcher tableaux.
ClimaTimeSteppers.SparseContainer — Type
SparseContainer(compressed_data, sparse_index_map)A compact container that allows dense-like indexing into a sparse, uniform, container.
Examples
using Test
a1 = ones(3) .* 1
a2 = ones(3) .* 2
a3 = ones(3) .* 3
a4 = ones(3) .* 4
v = SparseContainer((a1,a2,a3,a4), (1,3,5,7))
@test v[1] == ones(3) .* 1
@test v[3] == ones(3) .* 2
@test v[5] == ones(3) .* 3
@test v[7] == ones(3) .* 4ClimaTimeSteppers.SparseCoeffs — Type
SparseCoeffs(coefficients)A mask for coefficients. Supports getindex(::SparseCoeffs, ijk...) that forwards to coefficients, and getindex(::Type{SparseCoeffs}, ijk...) that forwards (at compile time) to the mask, which behaves as a BitArray of the coefficients.