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
- butcher_tableau
- shu_osher_form
- shu_osher_2r_form
- williamson_2n_form
- butcher_from_shu_osher
- shu_osher_from_2r
- butcher_from_shu_osher_2r
- butcher_from_williamson_2n
- is_explicit
- ssp_coefficient
- euler_step_fractions
- stability_polynomial
- imag_axis_bound
- real_axis_bound
Derived Types
butcher_tableau
Butcher tableau of an s-stage Runge–Kutta scheme.
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
stages | integer(kind=I4P) | Stages number s. | |
order | integer(kind=I4P) | Declared order of accuracy. | |
a | real(kind=R_P) | allocatable | Matrix A [s, s]. |
b | real(kind=R_P) | allocatable | Weights b [s]. |
c | real(kind=R_P) | allocatable | Abscissas c [s]. |
b_hat | real(kind=R_P) | allocatable | Embedded weights [s], unallocated when the scheme has none. |
ssp_coefficient | real(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
| Name | Type | Attributes | Description |
|---|---|---|---|
stages | integer(kind=I4P) | Stages number s. | |
alpha | real(kind=R_P) | allocatable | State coefficients [s+1, s]. |
beta | real(kind=R_P) | allocatable | Residual coefficients [s+1, s]. |
shu_osher_2r_form
Two-register Shu–Osher form: stage i+1 from u^n and stage i only.
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
stages | integer(kind=I4P) | Stages number s. | |
a | real(kind=R_P) | allocatable | Coefficient of u^n [s]. |
b | real(kind=R_P) | allocatable | Coefficient of the current stage [s]. |
c | real(kind=R_P) | allocatable | Coefficient of dt F(current stage) [s]. |
williamson_2n_form
Williamson 2N low-storage form.
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
stages | integer(kind=I4P) | Stages number s. | |
a | real(kind=R_P) | allocatable | A_i [s], A_1 = 0. |
b | real(kind=R_P) | allocatable | B_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)
function butcher_from_shu_osher(so, order) result(bt)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
so | type(shu_osher_form) | in | Shu–Osher form. | |
order | integer(kind=I4P) | in | optional | Declared 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)
function shu_osher_from_2r(r) result(so)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
r | type(shu_osher_2r_form) | in | Two-register form. |
Call graph
butcher_from_shu_osher_2r
Butcher tableau of a two-register Shu–Osher form.
Attributes: pure
Returns: type(butcher_tableau)
function butcher_from_shu_osher_2r(r, order) result(bt)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
r | type(shu_osher_2r_form) | in | Two-register form. | |
order | integer(kind=I4P) | in | optional | Declared 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)
function butcher_from_williamson_2n(w, order) result(bt)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
w | type(williamson_2n_form) | in | Williamson 2N form. | |
order | integer(kind=I4P) | in | optional | Declared order. |
Call graph
is_explicit
True when the tableau is strictly lower triangular.
Attributes: pure
Returns: logical
function is_explicit(bt) result(yes)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
bt | type(butcher_tableau) | in | Butcher 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)
function ssp_coefficient(so) result(ssp)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
so | type(shu_osher_form) | in | Shu–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)
function euler_step_fractions(so) result(f)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
so | type(shu_osher_form) | in | Shu–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)
function stability_polynomial(bt) result(g)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
bt | type(butcher_tableau) | in | Butcher 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)
function imag_axis_bound(bt) result(beta)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
bt | type(butcher_tableau) | in | Butcher 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)
function real_axis_bound(bt) result(beta)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
bt | type(butcher_tableau) | in | Butcher tableau (explicit). |
Call graph