Skip to content

adam_prism_pic_bc_object ​

ADAM, PRISM PIC particle boundary conditions (particle closure at the domain faces).

The particle closure of a face is derived from the field BC of that face ([bc_*] type, no input key of its own), by a total map: every field BC kind maps to a particle closure, an unknown kind is fatal, so a new field BC has to state its particle closure here too.

  • periodic -> PIC_BC_PERIODIC: a particle leaving the domain across the face re-enters from the opposite face. The deposits and gathers of a particle near the face need no special treatment: the periodic ghosts are images of the opposite interior (library periodicity), so a particle beyond the face is located in the ghost halo of the block on that face, exactly as a particle beyond the blocks of its rank. Its position is wrapped at the end of a time step (never inside the RK stages, whose positions are combined linearly).
  • every other kind -> PIC_BC_LEGACY, with a warning: no particle closure, a particle must stay far from the face (a particle outside the domain stops the run, a conserving current whose support reaches the face stops the run, the standard deposit drops what spills into the boundary ghosts).

Source: src/app/prism/common/adam_prism_pic_bc_object.F90

Dependencies

Contents ​

Variables ​

NameTypeAttributesDescription
PIC_BC_LEGACYinteger(kind=I4P)parameterNo particle closure: particles must stay far from the face.
PIC_BC_PERIODICinteger(kind=I4P)parameterPeriodic particle closure.
FACE_NAMEScharacter(len=8)parameter

Derived Types ​

prism_pic_bc_object ​

PIC particle boundary conditions.

Components ​

NameTypeAttributesDescription
pic_bc_typeinteger(kind=I4P)Particle closure of each face.
is_periodiclogicalPeriodic particle closure along each axis.
domain_eminreal(kind=R8P)Domain minimum coordinates.
domain_emaxreal(kind=R8P)Domain maximum coordinates.
domain_lengthreal(kind=R8P)Domain lengths.

Type-Bound Procedures ​

NameAttributesDescription
descriptionpass(self)Return pretty-printed object description.
initializepass(self)Initialize the particle closures from the field BCs.
is_outsidepass(self)True if a position is outside the domain along a non-periodic axis.
wrap_periodic_positionspass(self)Bring the particles that crossed a periodic face back in the domain.

Subroutines ​

initialize ​

Initialize the particle closures from the field BCs of the grid (grid%set_bc_type already called).

fortran
subroutine initialize(self, grid)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_pic_bc_object)inoutPIC BC object.
gridtype(grid_object)inGrid (sibling realm component, threaded in).

Call graph

wrap_periodic_positions ​

Bring the particles that crossed a periodic face back in the domain (emin, emax], by one domain length (a particle moves less than a cell in a step). Particles inside the domain are not touched (bitwise).

fortran
subroutine wrap_periodic_positions(self, q_pic, particle_number)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_pic_bc_object)inPIC BC object.
q_picreal(kind=R8P)inoutPIC variables [variable, particle].
particle_numberinteger(kind=I4P)inNumber of particles.

Call graph

Functions ​

description ​

Return a pretty-formatted object description.

Attributes: pure

Returns: character(len=:)

fortran
function description(self, prefix) result(desc)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_pic_bc_object)inPIC BC object.
prefixcharacter(len=*)inoptionalPrefixing string.

Call graph

is_outside ​

True if a position is outside the domain (emin, emax] along an axis without periodic closure.

Attributes: pure

Returns: logical

fortran
function is_outside(self, x) result(outside)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_pic_bc_object)inPIC BC object.
xreal(kind=R8P)inPosition.

Call graph