selah_lmm
SELAH, L0: linear multistep schemes: their coefficients, their order and their stability bounds.
A k-step linear multistep scheme advances u' = R(t, u) by
u^{n+1} = sum_{j=1..k} a_j u^{n+1-j} + dt sum_{j=0..k} b_j R^{n+1-j}, R^m = R(t^m, u^m),
explicit when b_0 = 0. lmm_coefficients holds k, a(1:k) and b(0:k); it is the L0 data of every multistep family: Adams–Bashforth, LMM-SSP, Adams–Moulton, Adams–Bashforth–Moulton (the corrector's) and BDF; the implicit ones (b_0 /= 0) run by fixed-point stages (selah_stepper), whose step's bounds are fixed_point_*_axis_bound. Its characteristic polynomials are rho(zeta) = zeta^k - sum_j a_j zeta^{k-j} and sigma(zeta) = sum_j b_j zeta^{k-j}.
Order. lmm_order(c) is the largest p for which the scheme is exact on the polynomials of degree <= p (u = t^q, q = 0..p, with exact history), checked in R8P with the time origin at the middle of the k levels and each condition scaled by the sum of the magnitudes of its terms: a condition holds when that relative residual is below 1e3 eps(R_P) (the coefficients are R_P values). The order of an explicit k-step Adams–Bashforth scheme is k.
Stability. On u' = mu u, z = mu dt, the scheme is stable when every root of rho(zeta) - z sigma(zeta) has |zeta| <= 1: lmm_roots (Aberth–Ehrlich iterations in complex R8P), and from them lmm_imag_axis_bound (the largest beta with z = i y stable for 0 <= y <= beta) and lmm_real_axis_bound (z = -x). Each is a scan by 1e-4 up to 1e-2, by 1e-3 up to 3 and by 1e-2 up to 100 (100 means "at least 100"), ended by bisection to round-off at the first crossing. Near z = 0 the principal root, zeta_1 = e^z (1 + delta) with delta ~ C z^{p+1}, leaves the unit circle by far less than round-off (AB6: |zeta_1| - 1 ~ y^8 on the imaginary axis), so it is computed apart: Newton on delta, with rho(e^z) - z sigma(e^z) summed as its Taylor series in z, whose terms of degree <= p (the order conditions) are exactly zero and are dropped, and ln|zeta_1| = Re z + Re log(1 + delta) evaluated without cancellation; it counts as stable when ln|zeta_1| <= 64 times the rounding bound of delta. The others count as stable when |zeta| <= 1 + 64 eps. Computed in R8P in every build, as the Runge–Kutta bounds (selah_tableaux).
| Scheme | k | Order | Real-axis bound | Imaginary-axis bound |
|---|---|---|---|---|
ab-1 (explicit Euler) | 1 | 1 | 2 | 0 |
ab-2 | 2 | 2 | 1 | 0 |
ab-3 | 3 | 3 | 6/11 | 0.7236 |
ab-<k>, k <= 16 | k | k | lmm_real_axis_bound | lmm_imag_axis_bound |
am-<k>, k <= 15 (implicit) | max(k, 1) | k + 1 | 100 (k <= 1), 6, 3, 1.8367, ... | 100 (k <= 1), ... |
abm-<k>, k <= 16 (am-<k-1> corrects ab-<k>) | k | k | the corrector's | the corrector's |
bdf-<k>, k <= 6 (implicit) | k | k | 100 | 100, 100, 0, 0, 0.7108, 0.8431 |
The Adams–Bashforth coefficients b_j (a_1 = 1, the other a_j = 0, b_0 = 0) are exact rationals, solved from the polynomial-exactness conditions in rational arithmetic and typed with 40 digits (notes/foodie-port-check.py prints and checks them). The leapfrog, u^{n+1} = u^{n-1} + 2 dt R^n, is the 2-step scheme a = (0, 1), b = (0, 2, 0): lmm('leapfrog'), whose bounds are those of selah_leapfrog without its filter (1 and 0).
Source: src/lib/selah_lmm.F90
Dependencies
Contents
- msrk_coefficients
- lmm_coefficients
- lmm_ssp_family
- lmm_history
- msrk_history
- lmm_roots
- ab_name
- ab_steps
- am_name
- am_steps
- abm_name
- abm_steps
- bdf_name
- bdf_steps
- lmm_ssp_vss
- lmm_ssp_coefficient
- lmm
- multistep_registers
- multistep_predictor
- multistep_iterations
- multistep_order
- multistep_starter
- starter_for_order
- msrk
- lmm_order
- fixed_point_real_axis_bound
- fixed_point_imag_axis_bound
- lmm_imag_axis_bound
- lmm_real_axis_bound
Variables
| Name | Type | Attributes | Description |
|---|---|---|---|
AB_MAX_STEPS | integer(kind=I4P) | parameter | The largest Adams–Bashforth step count (FOODIE's). |
AM_MAX_STEPS | integer(kind=I4P) | parameter | The largest Adams–Moulton step count (FOODIE's am-0 .. am-15). |
ABM_MAX_STEPS | integer(kind=I4P) | parameter | The largest Adams–Bashforth–Moulton step count (FOODIE's). |
BDF_MAX_STEPS | integer(kind=I4P) | parameter | The largest BDF step count (FOODIE's; past 6 BDF is not zero-stable). |
SCHEME_LMM_SSP_32 | character(len=*) | parameter | SSP LMM, 3 steps, order 2, C = 1/2. |
SCHEME_LMM_SSP_43 | character(len=*) | parameter | SSP LMM, 4 steps, order 3, C = 1/3. |
SCHEME_LMM_SSP_53 | character(len=*) | parameter | SSP LMM, 5 steps, order 3, C = 1/2. |
SCHEME_LMM_SSP_VSS_22 | character(len=*) | parameter | Variable-step SSP LMM, 2 steps, order 2. |
SCHEME_LMM_SSP_VSS_32 | character(len=*) | parameter | Variable-step SSP LMM, 3 steps, order 2. |
SCHEME_LMM_SSP_VSS_33 | character(len=*) | parameter | Variable-step SSP LMM, 3 steps, order 3. |
SCHEME_LMM_SSP_VSS_43 | character(len=*) | parameter | Variable-step SSP LMM, 4 steps, order 3. |
SCHEME_LMM_SSP_VSS_53 | character(len=*) | parameter | Variable-step SSP LMM, 5 steps, order 3. |
LMM_SSP_SCHEMES | character(len=SCHEME_NAME_LEN) | parameter | The SSP linear multistep schemes. |
SCHEME_MSRK_SSP_223 | character(len=*) | parameter | Multistep-multistage SSP RK: 2 steps, 2 stages, order 3. |
SCHEME_MSRK_SSP_323 | character(len=*) | parameter | 3 steps, 2 stages, order 3. |
SCHEME_MSRK_SSP_458 | character(len=*) | parameter | 4 steps, 5 stages, order 8. |
MSRK_SSP_SCHEMES | character(len=SCHEME_NAME_LEN) | parameter | All. |
Derived Types
msrk_coefficients
A multistep-multistage Runge–Kutta scheme (Bresten et al. 2017), its levels j = 0 (U^n) .. steps - 1: Y_1 = U^n; Y_k = sum_j d(k,j) U^{n-j} + dt sum_{j>=1} ah(k,j) R^{n-j} + dt sum_{l<k} a(k,l) R(Y_l); U^{n+1} = sum_j q(j) U^{n-j} + dt sum_{j>=1} bh(j) R^{n-j} + dt sum_l b(l) R(Y_l). R^{n-j} is the residual of U^{n-j}: the first stage's residual of step n - j, kept (FOODIE evaluated it again, its defect F4).
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
steps | integer(kind=I4P) | Steps (levels), 0 for an unknown scheme. | |
stages | integer(kind=I4P) | Stages. | |
order | integer(kind=I4P) | Order. | |
d | real(kind=R_P) | allocatable | Solution weights of the stages [stages, 0:steps-1]. |
ah | real(kind=R_P) | allocatable | Past residual weights of the stages [stages, 1:steps-1]. |
a | real(kind=R_P) | allocatable | Stage residual weights [stages, stages]. |
q | real(kind=R_P) | allocatable | Solution weights of the update [0:steps-1]. |
bh | real(kind=R_P) | allocatable | Past residual weights of the update [1:steps-1]. |
b | real(kind=R_P) | allocatable | Stage residual weights of the update [stages]. |
c | real(kind=R_P) | allocatable | Abscissae: sum_j -j d(k,j) + sum_j ah(k,j) + sum_l a(k,l). |
ssp | real(kind=R_P) | SSP coefficient (Spijker's criterion, notes/foodie-port-check.py). | |
real_bound | real(kind=R_P) | Real-axis bound (60 digits, notes/foodie-port-check.py). | |
imag_bound | real(kind=R_P) | Imaginary-axis bound (60 digits, notes/foodie-port-check.py). |
lmm_coefficients
A k-step linear multistep scheme: u^{n+1} = sum_{j=1..k} a(j) u^{n+1-j} + dt sum_{j=0..k} b(j) R^{n+1-j}.
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
k | integer(kind=I4P) | Steps (levels of history); 0 for an unknown scheme. | |
a | real(kind=R_P) | allocatable | Solution weights [1:k]. |
b | real(kind=R_P) | allocatable | Residual weights [0:k]; b(0) the implicit one. |
Subroutines
lmm_ssp_family
The steps, order and variable-step flag of an SSP linear multistep name (LMM_SSP_SCHEMES); k = 0 for any other.
Attributes: pure
subroutine lmm_ssp_family(scheme, k, p, vss)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
scheme | character(len=*) | in | Scheme name. | |
k | integer(kind=I4P) | out | Steps, 0 if not an SSP LMM. | |
p | integer(kind=I4P) | out | Order. | |
vss | logical | out | Variable step. |
Call graph
lmm_history
The history a step of the scheme reads besides U^n and R^n: the solution levels U^{n-1} .. U^{n-ms} (ms, the last j with a(j+1) /= 0) and the residual levels R^{n-1} .. R^{n-mr} (mr, the last j with b(j+1) /= 0).
Attributes: pure
subroutine lmm_history(c, ms, mr)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
c | type(lmm_coefficients) | in | Coefficients. | |
ms | integer(kind=I4P) | out | Solution levels. | |
mr | integer(kind=I4P) | out | Residual levels. |
msrk_history
The history a step of a multistep-multistage scheme reads besides U^n and R^n: ms solution levels (the last j with d(:,j) or q(j) /= 0) and mr residual levels (the last j with ah(:,j) or bh(j) /= 0).
Attributes: pure
subroutine msrk_history(m, ms, mr)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
m | type(msrk_coefficients) | in | Coefficients. | |
ms | integer(kind=I4P) | out | Solution levels. | |
mr | integer(kind=I4P) | out | Residual levels. |
Call graph
lmm_roots
The k roots of rho(zeta) - z sigma(zeta) (Aberth–Ehrlich iterations, complex R8P); a root at infinity (an implicit scheme with z b_0 = 1) is returned as huge. guess, the roots at a nearby z, starts the iterations (unless two of its values coincide: a multiple root, from which Aberth's iterations cannot separate them).
Attributes: pure
subroutine lmm_roots(c, z, roots, guess)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
c | type(lmm_coefficients) | in | Coefficients. | |
z | complex(kind=RB) | in | mu dt. | |
roots | complex(kind=RB) | out | Roots. | |
guess | complex(kind=RB) | in | optional | Starting values. |
Call graph
Functions
ab_name
The name of the k-step Adams–Bashforth scheme, ab-<k>.
Attributes: pure
Returns: character(len=:)
function ab_name(k) result(name)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
k | integer(kind=I4P) | in | Steps. |
Call graph
ab_steps
The step count of an Adams–Bashforth name (ab-<k>, 1 <= k <= AB_MAX_STEPS), 0 for any other name.
Attributes: pure
Returns: integer(kind=I4P)
function ab_steps(scheme) result(k)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
scheme | character(len=*) | in | Scheme name. |
Call graph
am_name
The name of the k-step Adams–Moulton scheme, am-<k> (order k + 1; am-0 is backward Euler, am-1 the trapezoid).
Attributes: pure
Returns: character(len=:)
function am_name(k) result(name)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
k | integer(kind=I4P) | in | Steps. |
Call graph
am_steps
The step count of an Adams–Moulton name (am-<k>, 0 <= k <= AM_MAX_STEPS), -1 for any other name.
Attributes: pure
Returns: integer(kind=I4P)
function am_steps(scheme) result(k)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
scheme | character(len=*) | in | Scheme name. |
Call graph
abm_name
The name of the k-step Adams–Bashforth–Moulton predictor-corrector, abm-<k> (ab-<k> predicts, am-<k-1> corrects; order k).
Attributes: pure
Returns: character(len=:)
function abm_name(k) result(name)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
k | integer(kind=I4P) | in | Steps. |
abm_steps
The step count of an Adams–Bashforth–Moulton name (abm-<k>, 1 <= k <= ABM_MAX_STEPS), 0 for any other name.
Attributes: pure
Returns: integer(kind=I4P)
function abm_steps(scheme) result(k)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
scheme | character(len=*) | in | Scheme name. |
Call graph
bdf_name
The name of the k-step backward differentiation formula, bdf-<k> (order k).
Attributes: pure
Returns: character(len=:)
function bdf_name(k) result(name)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
k | integer(kind=I4P) | in | Steps. |
Call graph
bdf_steps
The step count of a BDF name (bdf-<k>, 1 <= k <= BDF_MAX_STEPS), 0 for any other name.
Attributes: pure
Returns: integer(kind=I4P)
function bdf_steps(scheme) result(k)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
scheme | character(len=*) | in | Scheme name. |
Call graph
lmm_ssp_vss
The SSP linear multistep scheme of k steps and order p (2 or 3) at the step ratio sum omega = sum_{j=1..k-1} dt_{n-j} / dt_n (Hadjimichael, Ketcheson, Loczi & Nemeth 2016, SIAM J. Numer. Anal. 54, 2799), with the increment dt_n of the step being taken:
p = 2: u^{n+1} = (omega^2 - 1)/omega^2 u^n + 1/omega^2 u^{n-k+1} + dt_n (omega + 1)/omega R^n; p = 3: u^{n+1} = (omega + 1)^2 (omega - 2)/omega^3 u^n + (3 omega + 2)/omega^3 u^{n-k+1} + dt_n (omega + 1)^2/omega^2 R^n + dt_n (omega + 1)/omega^2 R^{n-k+1}.
At a constant step omega = k - 1, and these are the fixed-step schemes, each coefficient computed with one rounding of the literal (3/4, 1/4, 3/2; 16/27, 11/27, 16/9, 4/9; 25/32, 7/32, 25/16, 5/16).
Attributes: pure
Returns: type(lmm_coefficients)
function lmm_ssp_vss(k, p, omega) result(c)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
k | integer(kind=I4P) | in | Steps. | |
p | integer(kind=I4P) | in | Order, 2 or 3. | |
omega | real(kind=R_P) | in | Sum of the step ratios. |
Call graph
lmm_ssp_coefficient
The SSP coefficient of an explicit linear multistep scheme: min_j a_j / b_j over b_j > 0, every a_j and b_j non-negative and a_j > 0 where b_j > 0; 0 otherwise (not SSP).
Attributes: pure
Returns: real(kind=R_P)
function lmm_ssp_coefficient(c) result(cssp)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
c | type(lmm_coefficients) | in | Coefficients. |
lmm
The coefficients of a linear multistep scheme (the SSP ones at a constant step); k = 0 if the name is unknown.
Attributes: pure
Returns: type(lmm_coefficients)
function lmm(scheme) result(c)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
scheme | character(len=*) | in | Scheme name. |
Call graph
multistep_registers
The registers of a multistep scheme in the stepper's multistep form (selah_storage, FORM_MULTISTEP): the stage registers of its start-up scheme (a stage state and s - 1 stage residuals, none for a one-stage start-up), the residual ring (R^n and the mr residual levels) and the solution ring (the ms solution levels); -1 for a name that is no multistep scheme of that form.
Attributes: pure
Returns: integer(kind=I4P)
function multistep_registers(scheme) result(n)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
scheme | character(len=*) | in | Scheme name. |
Call graph
multistep_predictor
The predictor of an implicit multistep scheme run by fixed-point stages: the explicit scheme whose step is the first iterate (k = 0: none, the iterations start from U^n).
Attributes: pure
Returns: type(lmm_coefficients)
function multistep_predictor(scheme) result(cp)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
scheme | character(len=*) | in | Scheme name. |
Call graph
multistep_iterations
The default fixed-point iterations of an implicit multistep scheme (0 for an explicit one): the fewest that keep its order. From U^n each iteration gains one order (the iterate's error is O(dt) times the previous one's): am-<k> (order k + 1) needs k + 1, bdf-<k> (order k) k; abm-<k> starts from its predictor, ab-<k>, which has the order: 1 (PEC). FOODIE's default is 1 for every family (iterations=1 reproduces it).
Attributes: pure
Returns: integer(kind=I4P)
function multistep_iterations(scheme) result(m)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
scheme | character(len=*) | in | Scheme name. |
Call graph
multistep_order
The order of a multistep scheme of the stepper's multistep form; 0 for any other name.
Attributes: pure
Returns: integer(kind=I4P)
function multistep_order(scheme) result(p)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
scheme | character(len=*) | in | Scheme name. |
Call graph
multistep_starter
The built-in start-up of a multistep scheme of order p (D8 of #10): starter_for_order(max(p - 1, 1), ssp), ssp when the scheme is SSP (the LMM_SSP_SCHEMES); '' when the catalogue has no explicit Runge–Kutta scheme of that order (p > 11): the caller writes the history.
Attributes: pure
Returns: character(len=:)
function multistep_starter(scheme) result(name)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
scheme | character(len=*) | in | Scheme name. |
Call graph
starter_for_order
The catalogue's explicit Runge–Kutta scheme of fewest stages with order >= r: euler, ssp-22, ssp-33, rk4 (ssp: ssp-54), cash-karp-54, calvo-65, feagin-108 (orders 7 to 10); '' for r > 10. No explicit Runge–Kutta scheme is SSP past order 4: ssp asks for the SSP one up to order 4 and is ignored beyond.
Attributes: pure
Returns: character(len=:)
function starter_for_order(r, ssp) result(name)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
r | integer(kind=I4P) | in | Order needed. | |
ssp | logical | in | Strong stability preserving, if the order allows. |
Call graph
msrk
The coefficients of a multistep-multistage SSP Runge–Kutta scheme; steps = 0 for any other name. From FOODIE (Bresten, Gottlieb, Grant, Higgs, Ketcheson & Nemeth 2017), through notes/foodie-port-check.py (decision D5 of #10): msrk-ssp-223 and -323 refined onto their order conditions in 60 digits (changes <= 3.7e-16), FOODIE's entries below 1e-18 taken as the zeros they are (its optimiser's residues: 223's ah(2,1) = -1.1e-19, 323's d(2,1) and q(1), 1e-24); msrk-ssp-458 as FOODIE types it (the nearest exact set is 9.5e-15 away, beyond the published digits; its conditions hold to 2.5e-16 relative to their terms).
Attributes: pure
Returns: type(msrk_coefficients)
function msrk(scheme) result(m)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
scheme | character(len=*) | in | Scheme name. |
Call graph
lmm_order
The order of the scheme by polynomial exactness (see "Order" above); -1 if it is not even consistent with constants (sum a_j /= 1).
Attributes: pure
Returns: integer(kind=I4P)
function lmm_order(c) result(p)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
c | type(lmm_coefficients) | in | Coefficients. |
Call graph
fixed_point_real_axis_bound
The real-axis bound of the step m fixed-point iterations make of the implicit scheme c from the predictor cp (cp%k = 0: from U^n): what a stepper running it has (fixed_point_poly); the converged scheme's is lmm_real_axis_bound(c), reached only where the iterations contract, |z b_0| < 1.
Attributes: pure
Returns: real(kind=R_P)
function fixed_point_real_axis_bound(c, cp, m) result(beta)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
c | type(lmm_coefficients) | in | The implicit scheme. | |
cp | type(lmm_coefficients) | in | The predictor (k = 0: none). | |
m | integer(kind=I4P) | in | Iterations, >= 1. |
Call graph
fixed_point_imag_axis_bound
The imaginary-axis bound of the step m fixed-point iterations make of the implicit scheme c (as fixed_point_real_axis_bound).
Attributes: pure
Returns: real(kind=R_P)
function fixed_point_imag_axis_bound(c, cp, m) result(beta)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
c | type(lmm_coefficients) | in | The implicit scheme. | |
cp | type(lmm_coefficients) | in | The predictor (k = 0: none). | |
m | integer(kind=I4P) | in | Iterations, >= 1. |
Call graph
lmm_imag_axis_bound
The largest beta with every root |zeta| <= 1 for z = i y, 0 <= y <= beta (see "Stability" above).
Attributes: pure
Returns: real(kind=R_P)
function lmm_imag_axis_bound(c) result(beta)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
c | type(lmm_coefficients) | in | Coefficients. |
Call graph
lmm_real_axis_bound
The largest beta with every root |zeta| <= 1 for z = -x, 0 <= x <= beta (see "Stability" above).
Attributes: pure
Returns: real(kind=R_P)
function lmm_real_axis_bound(c) result(beta)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
c | type(lmm_coefficients) | in | Coefficients. |
Call graph