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).
subroutine stage_state_exp_box(bx, n, dt, coef, c, q, regs, lam, u)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
bx | type(box) | in | Box. | |
n | integer(kind=I4P) | in | Registers summed. | |
dt | real(kind=R_P) | in | Time step. | |
coef | real(kind=R_P) | in | Coefficients [n or more] (row of A). | |
c | real(kind=R_P) | in | The stage's abscissa. | |
q | real(kind=R_P) | in | Solution. | |
regs | real(kind=R_P) | in | Source registers [..., n or more]. | |
lam | real(kind=R_P) | in | Decay rate, >= 0. | |
u | real(kind=R_P) | inout | Stage 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).
subroutine step_update_exp_box(bx, n, dt, coef, regs, lam, q)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
bx | type(box) | in | Box. | |
n | integer(kind=I4P) | in | Registers summed. | |
dt | real(kind=R_P) | in | Time step. | |
coef | real(kind=R_P) | in | Weights [n or more] (b). | |
regs | real(kind=R_P) | in | Source registers [..., n or more]. | |
lam | real(kind=R_P) | in | Decay rate, >= 0. | |
q | real(kind=R_P) | inout | Solution, advanced. |