Appearance
adam_prism_pml_stepper_object
PRISM, the PML auxiliary fields as SELAH companions of the field stepper (#134 D5).
The auxiliary fields psi of a perfectly matched layer live in face-local arrays, one per active face of the domain (q_pml_x_m, ..., q_pml_z_p: [4, cells, nj, nk, blocks] on the CPU, [blocks, cells, nj, nk, 4] on the FNL backend). They advance in the same step as the fields, their residual built inside the fields' (psi' = g - lambda psi, g from the field derivatives): each face is a SELAH companion of the field stepper (initialize_companion: the same scheme, form and stages on q), driven through the same stage window as the field (begin_step, begin_stage(k), the residual into rhs_register(f), end_stage(k), finish_step). SELAH owns the stage states, the registers and the update; PRISM writes the residual. Stepped together, field and companion are the two stepped as one state (szaghi/SELAH#4).
Exact decay ([PML] exact_decay, default false; szaghi/SELAH#4 variant F): with it the residual is the source g alone and lambda = alpha + gamma / kappa (written by the residual kernels into decay(f), static) is integrated exactly by SELAH (decay= at every begin_stage and at finish_step: exponential Euler on the Runge-Kutta-averaged source), stable for any lambda dt; without it the explicit step of psi' = g - lambda psi, bitwise the former integrator's arithmetic but for the order of the stage sums. The first stage of an explicit scheme has c = 0, so the decay of stage 1 is never read before the first residual writes it.
The same source serves the CPU (host arrays) and the FNL backend (device arrays, SELAH's device kernels): the face arrays are passed by the caller, the registers and decay(f) are allocated through FUNDAL.
Source: src/app/prism/common/adam_prism_pml_stepper_object.F90
Dependencies
Contents
- face_decay
- prism_pml_stepper_object
- initialize
- destroy
- begin_step
- begin_stage
- end_stage
- finish_step
- zero_rhs
- rhs_register
- stage_state
Variables
| Name | Type | Attributes | Description |
|---|---|---|---|
FACES | integer(kind=I4P) | parameter | Faces of the domain. |
Derived Types
face_decay
Decay rate of one face (exact decay only).
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
lam | real(kind=R8P) | pointer, contiguous | lambda = alpha + gamma / kappa, the face's shape. |
prism_pml_stepper_object
The six faces' companions.
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
enabled | logical | A PML integrated with the field stages. | |
exact_decay | logical | The decay integrated exactly (SELAH decay=). | |
active | logical | The face has a layer. | |
st | type(stepper) | Companions. | |
bx | type(box) | Boxes: every element of the face array. | |
decay | type(face_decay) | Decay rates (exact decay). |
Type-Bound Procedures
| Name | Attributes | Description |
|---|---|---|
begin_stage | pass(self) | Open stage k of face f. |
begin_step | pass(self) | Open the step of face f. |
destroy | pass(self) | Free the companions. |
end_stage | pass(self) | Close stage k of face f. |
finish_step | pass(self) | Close the step of face f. |
initialize | pass(self) | Initialize the companions of the active faces. |
rhs_register | pass(self) | Residual register of face f (stage window). |
stage_state | pass(self) | State of the active stage of face f (stage window). |
zero_rhs | pass(self) | Zero the residual register of face f (stage window). |
Subroutines
initialize
Initialize a companion of the field stepper per active face, of the face array's shape.
fortran
subroutine initialize(self, ts, shapes, active, exact_decay)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_pml_stepper_object) | inout | PML companions. | |
ts | type(stepper_object) | in | The field's stepper (initialized). | |
shapes | integer(kind=I4P) | in | Shape of each face array. | |
active | logical | in | The face has a layer. | |
exact_decay | logical | in | Integrate the decay exactly. |
Call graph
destroy
Free the companions and the decay rates.
fortran
subroutine destroy(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_pml_stepper_object) | inout | PML companions. |
Call graph
begin_step
Open the step of face f.
fortran
subroutine begin_step(self, f, q)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_pml_stepper_object) | inout | PML companions. | |
f | integer(kind=I4P) | in | Face. | |
q | real(kind=R8P) | in | Face array. |
Call graph
begin_stage
Open stage k of face f: SELAH builds its state (with the exact decay, from the decay rates).
fortran
subroutine begin_stage(self, f, k, dt, q)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_pml_stepper_object) | inout | PML companions. | |
f | integer(kind=I4P) | in | Face. | |
k | integer(kind=I4P) | in | Stage. | |
dt | real(kind=R8P) | in | Time step. | |
q | real(kind=R8P) | in | Face array. |
Call graph
end_stage
Close stage k of face f, its residual written into rhs_register(f).
fortran
subroutine end_stage(self, f, k, dt, q)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_pml_stepper_object) | inout | PML companions. | |
f | integer(kind=I4P) | in | Face. | |
k | integer(kind=I4P) | in | Stage. | |
dt | real(kind=R8P) | in | Time step. | |
q | real(kind=R8P) | inout | Face array. |
Call graph
finish_step
Close the step of face f: SELAH advances the face array (with the exact decay, from the decay rates).
fortran
subroutine finish_step(self, f, dt, q)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_pml_stepper_object) | inout | PML companions. | |
f | integer(kind=I4P) | in | Face. | |
dt | real(kind=R8P) | in | Time step. | |
q | real(kind=R8P) | inout | Face array. |
Call graph
zero_rhs
Zero the residual register of face f: the residual kernels write the elements of each block's cells only, the others keep a zero residual (and a zero state).
fortran
subroutine zero_rhs(self, f)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_pml_stepper_object) | in | PML companions. | |
f | integer(kind=I4P) | in | Face. |
Call graph
Functions
rhs_register
Return the residual register of face f (null outside its stage window).
Returns: real(kind=R8P)
fortran
function rhs_register(self, f) result(r)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_pml_stepper_object) | in | PML companions. | |
f | integer(kind=I4P) | in | Face. |
Call graph
stage_state
Return the state of the active stage of face f (null outside its stage window).
Returns: real(kind=R8P)
fortran
function stage_state(self, f) result(u)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_pml_stepper_object) | in | PML companions. | |
f | integer(kind=I4P) | in | Face. |
Call graph