Skip to content

selah_tableaux ​

SELAH, L0: the coefficient forms of a Runge–Kutta scheme and their conversion to the Butcher tableau.

Plain data, no behaviour beyond pure queries: the kernels (L1) and the stepper (L2) read these coefficients, the tests verify them. Every form converts to the Butcher tableau, the form the order conditions and the reflux weights (b) are stated in. For an autonomous system (u' = F(u)) the forms are:

  • Butcher: (Y_i = u^n + \Delta t \sum_j a_{ij} F(Y_j)), (u^{n+1} = u^n + \Delta t \sum_j b_j F(Y_j)), (c = A \mathbf{1});
  • Shu–Osher: (Y_1 = u^n), (Y_i = \sum_{k<i} \left(\alpha_{ik} Y_k + \Delta t \beta_{ik} F(Y_k)\right)) for (i = 2, \dots, s+1), (u^{n+1} = Y_{s+1}), each row of (\alpha) summing to 1;
  • two-register Shu–Osher: (Y_{i+1} = a_i Y_1 + b_i Y_i + c_i \Delta t F(Y_i)), the special case that needs only (u^n) and the current stage (ADAM's low-storage ark, brk, crk);
  • Williamson 2N: (\Delta Q_i = A_i \Delta Q_{i-1} + \Delta t F(Y_i)), (Y_{i+1} = Y_i + B_i \Delta Q_i), (A_1 = 0), (Y_1 = u^n), (u^{n+1} = Y_{s+1}) (Williamson 1980).

The tableau a is not assumed strictly lower triangular: is_explicit tells (notes/PLAN.md, "Beyond v0.x").

Source: src/lib/selah_tableaux.F90

Dependencies

Contents ​

Derived Types ​

butcher_tableau ​

Butcher tableau of an s-stage Runge–Kutta scheme.

Components

NameTypeAttributesDescription
stagesinteger(kind=I4P)Stages number s.
orderinteger(kind=I4P)Declared order of accuracy.
areal(kind=R_P)allocatableMatrix A [s, s].
breal(kind=R_P)allocatableWeights b [s].
creal(kind=R_P)allocatableAbscissas c [s].
b_hatreal(kind=R_P)allocatableEmbedded weights [s], unallocated when the scheme has none.
ssp_coefficientreal(kind=R_P)SSP coefficient, 0 when the scheme is not SSP.

shu_osher_form ​

Shu–Osher form: alpha(i,k) and beta(i,k) for i = 2..s+1, k = 1..i-1; row 1 and the upper triangle are zero.

Components

NameTypeAttributesDescription
stagesinteger(kind=I4P)Stages number s.
alphareal(kind=R_P)allocatableState coefficients [s+1, s].
betareal(kind=R_P)allocatableResidual coefficients [s+1, s].

shu_osher_2r_form ​

Two-register Shu–Osher form: stage i+1 from u^n and stage i only.

Components

NameTypeAttributesDescription
stagesinteger(kind=I4P)Stages number s.
areal(kind=R_P)allocatableCoefficient of u^n [s].
breal(kind=R_P)allocatableCoefficient of the current stage [s].
creal(kind=R_P)allocatableCoefficient of dt F(current stage) [s].

williamson_2n_form ​

Williamson 2N low-storage form.

Components

NameTypeAttributesDescription
stagesinteger(kind=I4P)Stages number s.
areal(kind=R_P)allocatableA_i [s], A_1 = 0.
breal(kind=R_P)allocatableB_i [s].

Functions ​

butcher_from_shu_osher ​

Butcher tableau of a Shu–Osher form.

Each stage is written as (Y_i = u^n + \Delta t \sum_j B_{ij} F(Y_j)): row i of B is the alpha-weighted sum of the rows k < i plus beta(i,k) on column k. Rows 1..s give A, row s+1 gives b, and c = A·1. The summation order is that of ADAM's ssp_tableau (k ascending, the alpha term before the beta term), so a Shu–Osher form with the same coefficients gives the same tableau bitwise.

Attributes: pure

Returns: type(butcher_tableau)

fortran
function butcher_from_shu_osher(so, order) result(bt)

Arguments

NameTypeIntentAttributesDescription
sotype(shu_osher_form)inShu–Osher form.
orderinteger(kind=I4P)inoptionalDeclared order.

Call graph

shu_osher_from_2r ​

Shu–Osher form of a two-register form: alpha(i+1,1) = a_i, alpha(i+1,i) += b_i, beta(i+1,i) = c_i.

Attributes: pure

Returns: type(shu_osher_form)

fortran
function shu_osher_from_2r(r) result(so)

Arguments

NameTypeIntentAttributesDescription
rtype(shu_osher_2r_form)inTwo-register form.

Call graph

butcher_from_shu_osher_2r ​

Butcher tableau of a two-register Shu–Osher form.

Attributes: pure

Returns: type(butcher_tableau)

fortran
function butcher_from_shu_osher_2r(r, order) result(bt)

Arguments

NameTypeIntentAttributesDescription
rtype(shu_osher_2r_form)inTwo-register form.
orderinteger(kind=I4P)inoptionalDeclared order.

Call graph

butcher_from_williamson_2n ​

Butcher tableau of a Williamson 2N form.

(\Delta Q_i = \sum_j D_{ij} \Delta t F(Y_j)) with (D_i = A_i D_{i-1} + e_i); the stage rows follow (Y_{i+1} = Y_i + B_i D_i). Rows 1..s give A, row s+1 gives b, and c = A·1.

Attributes: pure

Returns: type(butcher_tableau)

fortran
function butcher_from_williamson_2n(w, order) result(bt)

Arguments

NameTypeIntentAttributesDescription
wtype(williamson_2n_form)inWilliamson 2N form.
orderinteger(kind=I4P)inoptionalDeclared order.

Call graph

is_explicit ​

True when the tableau is strictly lower triangular.

Attributes: pure

Returns: logical

fortran
function is_explicit(bt) result(yes)

Arguments

NameTypeIntentAttributesDescription
bttype(butcher_tableau)inButcher tableau.

ssp_coefficient ​

SSP coefficient of a Shu–Osher form: (\min \alpha_{ik} / \beta_{ik}) over (\beta_{ik} > 0).

0 when a coefficient is negative, or when (\beta_{ik} > 0) with (\alpha_{ik} = 0): the form is then not a convex combination of forward-Euler steps. It is the coefficient of this representation, a lower bound of the scheme's optimal one; the catalogue stores the optimal representations.

Attributes: pure

Returns: real(kind=R_P)

fortran
function ssp_coefficient(so) result(ssp)

Arguments

NameTypeIntentAttributesDescription
sotype(shu_osher_form)inShu–Osher form.

Call graph

euler_step_fractions ​

Per stage k, the largest forward-Euler step its residual takes in a Shu–Osher form, as a fraction of the step: (f_k = \max_{i > k,\ \beta_{ik} > 0} \beta_{ik} / \alpha_{ik}).

Stage i of the form is the convex combination (Y_i = \sum_{k<i} \alpha_{ik} (Y_k + \Delta t, (\beta_{ik} / \alpha_{ik}) F(Y_k))): the residual of stage k enters forward-Euler steps of (\Delta t, \beta_{ik} / \alpha_{ik}). A limiter that makes (Y_k + \tau F(Y_k)) admissible (positive, bounded) for (\tau = f_k \Delta t) makes it so for every (0 \le \tau \le f_k \Delta t) (a convex combination of (Y_k) and that state), hence every later stage and the step. (\max_k f_k = 1 / C), C the SSP coefficient of the form. Every (f_k) is 0 when the form is not a convex combination of forward-Euler steps (a negative coefficient, or (\beta_{ik} > 0) with (\alpha_{ik} = 0): ssp_coefficient is 0 then), and (f_k = 0) for a stage whose residual no later stage uses.

Attributes: pure

Returns: real(kind=R_P)

fortran
function euler_step_fractions(so) result(f)

Arguments

NameTypeIntentAttributesDescription
sotype(shu_osher_form)inShu–Osher form.

Call graph

stability_polynomial ​

Coefficients of the stability polynomial of an explicit tableau, (R(z) = \sum_{k=0}^{s} g_k z^k): (g_0 = 1), (g_k = b^T A^{k-1} \mathbf 1).

Attributes: pure

Returns: real(kind=R_P)

fortran
function stability_polynomial(bt) result(g)

Arguments

NameTypeIntentAttributesDescription
bttype(butcher_tableau)inButcher tableau (explicit).

Call graph

imag_axis_bound ​

The imaginary-axis stability bound: the largest (\beta) with (|R(iy)| \le 1) for (|y| \le \beta), 0 when none (euler, ssp-22). The step of an oscillatory mode of frequency (\omega) (a gyration, a wave) is stable for (\omega \Delta t \le \beta).

(P(w) = |R(iy)|^2 - 1) is a polynomial in (w = y^2); its coefficients of (w^j), (2j \le p), vanish for a scheme of order p ((R) agrees with (e^z) to (z^p)) and are set to 0, so that the rounding of the tableau's digits does not decide the sign near 0. (\beta = 0) when the lowest remaining coefficient is positive, else (\sqrt{w^}), (w^) the first point where (P) turns positive (a scan of (y) by 1e-3, then bisection to round-off).

Attributes: pure

Returns: real(kind=R_P)

fortran
function imag_axis_bound(bt) result(beta)

Arguments

NameTypeIntentAttributesDescription
bttype(butcher_tableau)inButcher tableau (explicit).

Call graph

real_axis_bound ​

The real-axis stability bound: the largest (\beta) with (|R(-x)| \le 1) for (0 \le x \le \beta) (a decay of rate (\lambda) is stable for (\lambda \Delta t \le \beta)); a scan by 1e-3, then bisection.

Attributes: pure

Returns: real(kind=R_P)

fortran
function real_axis_bound(bt) result(beta)

Arguments

NameTypeIntentAttributesDescription
bttype(butcher_tableau)inButcher tableau (explicit).

Call graph

GPL-3.0-or-later, BSD-2-Clause, BSD-3-Clause or MIT, at your choice