Skip to content

selah_kernels_exp ​

SELAH, L1: the exponential box kernels, a Butcher stage and step with an exactly integrated linear decay.

For a state whose equation is psi' = g - lambda psi, lambda >= 0 per element and constant in time (the auxiliary fields of a perfectly matched layer), the caller's residual is the source g only and the decay is integrated exactly: with z = -lambda dt, the state of stage i is e^(c_i z) psi^n + phi_1(c_i z) dt sum_j a_ij g_j and the step e^z psi^n + phi_1(z) dt sum_j b_j g_j, phi_1(z) = (e^z - 1)/z (exponential Euler on the Runge–Kutta-averaged source: notes/companions-pushers-pml.md §5, variant F). Exact for a source frozen over the step, any lambda dt; second order with a varying source; where lambda = 0, bitwise the explicit kernels (selah_kernels_box). No mask. phi_1 is evaluated without cancellation: e^(z/2) sinh(z/2)/(z/2), and (e^z - 1)/z where e^z is negligible; where z/2 is 0 (z = 0, or a subnormal z whose half rounds to 0) the explicit expression, never 0/0.

Source: src/lib/selah_kernels_exp.F90

Dependencies

Contents ​

Subroutines ​

stage_state_exp_box ​

u = e^(c z) q + phi_1(c z) sum_{k=1..n} dt coef(k) regs(k), z = -lam dt, over the box (u = q + the sum where lam = 0, as stage_state_box).

fortran
subroutine stage_state_exp_box(bx, n, dt, coef, c, q, regs, lam, u)

Arguments

NameTypeIntentAttributesDescription
bxtype(box)inBox.
ninteger(kind=I4P)inRegisters summed.
dtreal(kind=R_P)inTime step.
coefreal(kind=R_P)inCoefficients [n or more] (row of A).
creal(kind=R_P)inThe stage's abscissa.
qreal(kind=R_P)inSolution.
regsreal(kind=R_P)inSource registers [..., n or more].
lamreal(kind=R_P)inDecay rate, >= 0.
ureal(kind=R_P)inoutStage state.

step_update_exp_box ​

q = e^z q + phi_1(z) dt sum_{k=1..n} coef(k) regs(k), z = -lam dt, over the box (q = q + dt times the sum where lam = 0, as step_update_box).

fortran
subroutine step_update_exp_box(bx, n, dt, coef, regs, lam, q)

Arguments

NameTypeIntentAttributesDescription
bxtype(box)inBox.
ninteger(kind=I4P)inRegisters summed.
dtreal(kind=R_P)inTime step.
coefreal(kind=R_P)inWeights [n or more] (b).
regsreal(kind=R_P)inSource registers [..., n or more].
lamreal(kind=R_P)inDecay rate, >= 0.
qreal(kind=R_P)inoutSolution, advanced.

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