Skip to content

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 ​

Variables ​

NameTypeAttributesDescription
FACESinteger(kind=I4P)parameterFaces of the domain.

Derived Types ​

face_decay ​

Decay rate of one face (exact decay only).

Components

NameTypeAttributesDescription
lamreal(kind=R8P)pointer, contiguouslambda = alpha + gamma / kappa, the face's shape.

prism_pml_stepper_object ​

The six faces' companions.

Components

NameTypeAttributesDescription
enabledlogicalA PML integrated with the field stages.
exact_decaylogicalThe decay integrated exactly (SELAH decay=).
activelogicalThe face has a layer.
sttype(stepper)Companions.
bxtype(box)Boxes: every element of the face array.
decaytype(face_decay)Decay rates (exact decay).

Type-Bound Procedures

NameAttributesDescription
begin_stagepass(self)Open stage k of face f.
begin_steppass(self)Open the step of face f.
destroypass(self)Free the companions.
end_stagepass(self)Close stage k of face f.
finish_steppass(self)Close the step of face f.
initializepass(self)Initialize the companions of the active faces.
rhs_registerpass(self)Residual register of face f (stage window).
stage_statepass(self)State of the active stage of face f (stage window).
zero_rhspass(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

NameTypeIntentAttributesDescription
selfclass(prism_pml_stepper_object)inoutPML companions.
tstype(stepper_object)inThe field's stepper (initialized).
shapesinteger(kind=I4P)inShape of each face array.
activelogicalinThe face has a layer.
exact_decaylogicalinIntegrate the decay exactly.

Call graph

destroy ​

Free the companions and the decay rates.

fortran
subroutine destroy(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_pml_stepper_object)inoutPML companions.

Call graph

begin_step ​

Open the step of face f.

fortran
subroutine begin_step(self, f, q)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_pml_stepper_object)inoutPML companions.
finteger(kind=I4P)inFace.
qreal(kind=R8P)inFace 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

NameTypeIntentAttributesDescription
selfclass(prism_pml_stepper_object)inoutPML companions.
finteger(kind=I4P)inFace.
kinteger(kind=I4P)inStage.
dtreal(kind=R8P)inTime step.
qreal(kind=R8P)inFace 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

NameTypeIntentAttributesDescription
selfclass(prism_pml_stepper_object)inoutPML companions.
finteger(kind=I4P)inFace.
kinteger(kind=I4P)inStage.
dtreal(kind=R8P)inTime step.
qreal(kind=R8P)inoutFace 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

NameTypeIntentAttributesDescription
selfclass(prism_pml_stepper_object)inoutPML companions.
finteger(kind=I4P)inFace.
dtreal(kind=R8P)inTime step.
qreal(kind=R8P)inoutFace 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

NameTypeIntentAttributesDescription
selfclass(prism_pml_stepper_object)inPML companions.
finteger(kind=I4P)inFace.

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

NameTypeIntentAttributesDescription
selfclass(prism_pml_stepper_object)inPML companions.
finteger(kind=I4P)inFace.

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

NameTypeIntentAttributesDescription
selfclass(prism_pml_stepper_object)inPML companions.
finteger(kind=I4P)inFace.

Call graph