Skip to content

adam_field_object ​

ADAM, field class definition.

A structured block is composed of hexahedron finite volumes with quadrilateral faces using the following internal numeration for nodes and faces:

 /|\Z
  |                            F(4)         _ F(6)
  |                            /|\          /!
  |                        7    |          /    8
  |                         *------------------*
  |                        /|   |        /    /|
  |                       / |   |       /    / |
  |                      /  |   |      /    /  |
  |                     /   |   |     /    /   |
  |                    /    |   |    +    /    |
  |                   /     |   |        /     |
  |                  /      |   +       /      |
  |                 /      3|          /       |4
  |                /        * --------/--------*
  |      F(1)<----/----+   /         /        /
  |              *------------------*    +-------->F(2)
  |             5|       /          |6      /
  |              |      /           |      /
  |              |     /        +   |     /
  |              |    /         |   |    /
  |              |   /      +   |   |   /
  |              |  /      /    |   |  /
  |              | /      /     |   | /
  |              |/      /      |   |/
  |              *------------------*
  |             1      /        |    2
  |                   /        \|/
  |   _ Y           |/_       F(3)
  |   /|         F(5)
  |  /
  | /
  |/                                                    X
  O----------------------------------------------------->

Each hexadron cells is faces-connected to its neighboring, thus the cells build a structured block with implicit connectivity, e.g. in 2D space a FriVolous block could be as the following:

                 _ J
                 /|                          _____
               5+ ...*----*----*----*----*...     |
               /    /    /    /    /    /         |
              /    /    /    /    /    /          |
            4+ ...*----*----*----*----*...        |
            /    /    /    /    /    /            |
           /    /    /    /    /    /             |
         3+ ...*----*----*----*----*...           |  Structured block of 4x4 Finite Volumes
         /    /    / FV /    /    /               |
        /    /    /    /    /    /                |
      2+ ...*----*----*----*----*...              |
      /    /    /    /    /    /                  |
     /    /    /    /    /    /                   |
   1+ ...*----*----*----*----*...                 |
   /     .    .    .    .    .                    |
  /      .    .    .    .    .               _____
 O-------+----+----+----+----+-------------> I
         1    2    3    4    5

Source: src/lib/common/adam_field_object.F90

Dependencies

Contents ​

Variables ​

NameTypeAttributesDescription
INI_SECTION_NAMEcharacter(len=5)parameterINI (config) file section name containing configs.

Derived Types ​

field_object ​

Field class definition.

Components ​

NameTypeAttributesDescription
nvinteger(kind=I4P)Number of field variables.
nv_picinteger(kind=I4P)Number of PIC (Particle In Cell) variables.
block_weightinteger(kind=I4P)Block weight, cells_number * variables_number.
block_weight_picinteger(kind=I4P)Block weight, particles_number * pic_variables_number.
nbinteger(kind=I4P)Number of all blocks that can be stored.
blocks_numberinteger(kind=I4P)Number of blocks actually stored.
npinteger(kind=I4P)Number of all particles that can be stored for each block.
codeinteger(kind=I8P)allocatableMorton codes [nb].
coordinatesinteger(kind=I4P)allocatableCoordinates IJKL for each block [4,nb].
particles_numberinteger(kind=I4P)allocatableNumber of partcles actually stored in each block [nb].
eminreal(kind=R8P)allocatableCoordinates of minimum abscissa of each block [3,nb].
emaxreal(kind=R8P)allocatableCoordinates of maximum abscissa of each block [3,nb].
dxyzreal(kind=R8P)allocatableSpace steps of each block [3,nb].
x_nodereal(kind=R8P)allocatableX node coordinates [0-ngc:ni+ngc,nb].
y_nodereal(kind=R8P)allocatableY node coordinates [0-ngc:nj+ngc,nb].
z_nodereal(kind=R8P)allocatableZ node coordinates [0-ngc:nk+ngc,nb].
x_cellreal(kind=R8P)allocatableX cell coordinates [1-ngc:ni+ngc,nb].
y_cellreal(kind=R8P)allocatableY cell coordinates [1-ngc:nj+ngc,nb].
z_cellreal(kind=R8P)allocatableZ cell coordinates [1-ngc:nk+ngc,nb].
req_send_recvinteger(kind=I4P)allocatableMPI request send/receive flags.
blocks_numbersinteger(kind=I4P)allocatableNumber of blocks actually stored in all processes.
refinements_neededinteger(kind=I4P)allocatableRefinements needed of my blocks.
refinements_needed_allinteger(kind=I4P)allocatableRefinements needed of all blocks.
disp_countinteger(kind=I4P)allocatableDisplacement of blocks that are received from process.
inner_blocks_numberinteger(kind=I4P)Number of inner blocks where I need fecs.
q_workreal(kind=R8P)allocatableField cell centered variables, working buffer memory.
residualsreal(kind=R8P)allocatableField residuals, normalized.
ngcinteger(kind=I4P)pointerNumber of ghost cells.
niinteger(kind=I4P)pointerNumber of cells in i direction.
njinteger(kind=I4P)pointerNumber of cells in j direction.
nkinteger(kind=I4P)pointerNumber of cells in k direction.

Type-Bound Procedures ​

NameAttributesDescription
adaptpass(self)Adapt field accordingly to refine/derefine necessity.
blocks_reorderpass(self)Reorder blocks indexes in field.
compute_metricspass(self)Compute metrics of each block.
compute_normL2_residualspass(self)Compute L2 norm of residuals.
descriptionpass(self)Return pretty-printed object description.
do_caxis_intersectpass(self)Return true if a block is intersected by coordinate-axis.
do_cplane_intersectpass(self)Return true if a block is intersected by coordinate-plane.
do_ray_intersectpass(self)Return true if a block is intersected by ray.
initializepass(self)Initialize the field.
load_blockspass(self)Load blocks data, used for restarting.
load_from_ini_filepass(self)Load object data from INI file.
mark_all_blockspass(self)Mark all blocks to be refined, derefined, ecc.
mark_spherepass(self)Mark blocks to be refined/derefined by sphere distance.
get_refinements_neededpass(self)Return gathered refinement flags and displacements.
mpi_gather_refinements_neededpass(self)Gather blocks refinement needed status between MPI processes.
mpi_redistributepass(self)Redistribute blocks to processes.
save_blockspass(self)Save blocks data, used for restarting.
check_reduce_ghost_mapspass(self)Check that every ghost is folded by one map row at most.
reduce_ghost_localpass(self)Fold deposited ghosts back onto their owner cells locally.
reduce_ghost_mpipass(self)Fold deposited ghosts back onto their owner cells of other ranks.
update_ghost_localpass(self)Update ghosts locally.
update_ghost_mpipass(self)Update ghosts MPI.
derefine1Dpass(self)Derefine blocks, 1D.
derefine2Dpass(self)Derefine blocks, 2D.
derefine3Dpass(self)Derefine blocks, 3D.
refine1Dpass(self)Refine blocks, 1D.
refine2Dpass(self)Refine blocks, 2D.
refine3Dpass(self)Refine blocks, 3D.
refine_conservativepass(self)Refine blocks, conservative limited prolongation.
update_coordinatespass(self)Update coordinates using the updated data in maps.

Subroutines ​

adapt ​

Adapt field accordingly to refine/derefine necessity.

prolongation selects how a refined block's children are filled: AMR_PROLONGATION_LINEAR (default, tensor linear interpolation, not conservative) or AMR_PROLONGATION_CONSERVATIVE (limited linear slopes whose children average to the parent, issue #74 D-M5-2). Derefinement is the mean of the children in both cases.

fortran
subroutine adapt(self, grid, plan, q, prolongation)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inoutThe field.
gridtype(grid_object)inGrid (sibling realm component, threaded in).
plantype(refinement_plan_object)inRefinement plan produced by tree%adapt.
qreal(kind=R8P)inoutField cell centered variables.
prolongationinteger(kind=I4P)inoptionalProlongation kind, AMR_PROLONGATION_*.

Call graph

blocks_reorder ​

Reorder blocks indexes in field.

fortran
subroutine blocks_reorder(self, grid, maps, q)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inoutThe field.
gridtype(grid_object)inGrid (sibling realm component, threaded in).
mapstype(maps_object)inMaps (sibling realm component, threaded in).
qreal(kind=R8P)inoutField cell centered variables.

Call graph

compute_metrics ​

Compute metrics of each block.

fortran
subroutine compute_metrics(self, grid)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inoutThe field.
gridtype(grid_object)inGrid (sibling realm component, threaded in).

Call graph

compute_normL2_residuals ​

Compute L2 norm of residuals.

fortran
subroutine compute_normL2_residuals(self, grid, dq, norm)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inThe field.
gridtype(grid_object)inGrid (sibling realm component, threaded in).
dqreal(kind=R8P)inResiduals.
normreal(kind=R8P)inoutResiduals norm.

Call graph

initialize ​

Initialize field.

add_adam mirrors tree_object%initialize's optional dummy of the same name (same default .true.). When true, the tree gains an ADAM ancestor node (Morton code -1) attributed to MPI rank 0. The field reflects this by setting blocks_number = 1 ON RANK 0 ONLY (the one that owns the ADAM block); other ranks keep blocks_number = 0. This matches the blocks_numbers(0) = 1 below at line 511 and the code(1) = -1 ADAM-block convention. When add_adam = .false., the tree starts empty and the field follows suit (blocks_number = 0 on every rank). The two add_adam defaults must agree to keep tree/field state consistent at end-of-initialize; callers that pass add_adam to one MUST pass the same value to the other.

fortran
subroutine initialize(self, grid, maps, tree, nb, file_parameters, nv, verbose, add_adam)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inoutThe field.
gridtype(grid_object)intargetGrid (sibling realm component, threaded in).
mapstype(maps_object)inMaps (sibling realm component, threaded in).
treetype(tree_object)inTree (sibling realm component, threaded in).
nbinteger(kind=I4P)inNumber of all blocks that can be stored.
file_parameterstype(file_ini)inoutINI file handler.
nvinteger(kind=I4P)inoptionalNumber of field variables.
verboselogicalinoptionalTrigger verbose output.
add_adamlogicalinoptionalAdd ADAM ancestor block (mirrors tree initialize's add_adam,

Call graph

load_blocks ​

Load blocks data, used for restarting.

Note: blocks memory must be already initialized with enough memory (proper nv,ni,nj,nk,ngc and nb>=blocks number).

fortran
subroutine load_blocks(self, grid, basename, q)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inoutThe field.
gridtype(grid_object)inGrid (sibling realm component, threaded in).
basenamecharacter(len=*)inOutput base name.
qreal(kind=R8P)inoutField cell centered variables.

Call graph

load_from_ini_file ​

Load object data from INI file.

fortran
subroutine load_from_ini_file(self, file_parameters, nv, go_on_fail)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inoutThe field.
file_parameterstype(file_ini)inoutINI file handler.
nvinteger(kind=I4P)inoptionalNumber of field variables.
go_on_faillogicalinoptionalGo on if load fails.

Call graph

mark_sphere ​

Mark blocks to be refined/derefined by sphere distance.

fortran
subroutine mark_sphere(self, grid, center, radius, threshold)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inoutThe field.
gridtype(grid_object)inGrid (sibling realm component, threaded in).
centerreal(kind=R8P)inSphere center coordinates [x,y,z].
radiusreal(kind=R8P)inSphere radius.
thresholdreal(kind=R8P)inoptionalThreshold for sphere proximity.

Call graph

mark_all_blocks ​

Mark all blocks to be refined, derefined, ecc.

fortran
subroutine mark_all_blocks(self, mark)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inoutThe tree.
markinteger(kind=I4P)inMark to be imposed [TO_BE_REFINED,...].

mpi_gather_refinements_needed ​

Gather blocks refinement needed status between MPI processes.

fortran
subroutine mpi_gather_refinements_needed(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inoutThe field.

Call graph

get_refinements_needed ​

Return gathered refinement flags and process displacements. Provides an accessor so callers do not reach into field internals. Call mpi_gather_refinements_needed before invoking this procedure.

fortran
subroutine get_refinements_needed(self, flags, disp)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inThe field.
flagsinteger(kind=I4P)outallocatableRefinements needed of all blocks.
dispinteger(kind=I4P)outallocatableDisplacement of received blocks per process.

Call graph

mpi_redistribute ​

Redistribute blocks to processes. @TODO: Morton codes are not yet redistributed, must be fixed.

fortran
subroutine mpi_redistribute(self, grid, maps, tree, q)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inoutThe field.
gridtype(grid_object)inGrid (sibling realm component, threaded in).
mapstype(maps_object)inMaps (sibling realm component, threaded in).
treetype(tree_object)inTree (sibling realm component, threaded in).
qreal(kind=R8P)inoutField cell centered variables.

Call graph

save_blocks ​

Save blocks data, used for restarting.

Every rank writes its file, with zero blocks if it owns none (issue #42): load_blocks reads one file per rank, so a rank that skipped the save aborted the restart, and a file left by an earlier save of that rank (when it still owned blocks) would have been read as current. status='replace' truncates a longer old file.

fortran
subroutine save_blocks(self, grid, basename, q)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inThe field.
gridtype(grid_object)inGrid (sibling realm component, threaded in).
basenamecharacter(len=*)inOutput base name.
qreal(kind=R8P)inField cell centered variables.

Call graph

update_ghost_local ​

Update (local) ghost cells.

fortran
subroutine update_ghost_local(self, grid, maps, q)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inThe base backend.
gridtype(grid_object)inGrid (sibling realm component, threaded in).
mapstype(maps_object)inMaps (sibling realm component, threaded in).
qreal(kind=R8P)inoutField component to be updated.

Call graph

reduce_ghost_local ​

Fold (local) ghost cells back onto the cells they mirror: the transpose of update_ghost_local.

Meant for quantities deposited by sources owned by one block (e.g. PIC charge/current), whose stencil spills into the ghost cells of the owner block: those contributions belong to the interior cells of the neighbour block that the ghosts mirror. For every same-level map row the ghost value is added to its donor cell, then the ghost is refilled with the (now complete) donor value, so that the result equals a single-block deposit of the same sources. Ghosts without a map row (physical boundaries) are left untouched. Only variables v_first:v_last are processed. Rows of 2:1 seams (coarse<->fine) have no transpose implemented yet: their presence is an error.

fortran
subroutine reduce_ghost_local(self, grid, maps, q, v_first, v_last)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inThe field.
gridtype(grid_object)inGrid (sibling realm component, threaded in).
mapstype(maps_object)inMaps (sibling realm component, threaded in).
qreal(kind=R8P)inoutField component to be reduced.
v_firstinteger(kind=I4P)inFirst variable to reduce.
v_lastinteger(kind=I4P)inLast variable to reduce.

Call graph

reduce_ghost_mpi ​

Fold the ghost cells filled by other ranks back onto their donor cells: the transpose of update_ghost_mpi.

MPI twin of reduce_ghost_local, for deposited quantities (e.g. PIC charge/current). The forward maps and buffers are reused with the roles swapped: every received ghost is packed into its receive-buffer slot, the receive segments travel back to the ranks that sent them, and each send-map row adds its slot to the donor cell. Superseded slots of the deduplicated receive map stay zero. The ghosts are NOT refilled: the caller completes the reduction with update_ghost_local + update_ghost_mpi once every fold (local and MPI) is done. Collective: every rank must call it. Only same-level rows are supported (2:1 seams have no transpose yet); see check_reduce_ghost_maps for the disjointness of the local and MPI maps that makes the two folds add each ghost exactly once.

fortran
subroutine reduce_ghost_mpi(self, grid, maps, q, v_first, v_last)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inoutThe field.
gridtype(grid_object)inGrid (sibling realm component, threaded in).
mapstype(maps_object)inoutMaps (sibling realm component, threaded in).
qreal(kind=R8P)inoutField component to be reduced.
v_firstinteger(kind=I4P)inFirst variable to reduce.
v_lastinteger(kind=I4P)inLast variable to reduce.

Call graph

check_reduce_ghost_maps ​

Check that the transposed ghost updates (reduce_ghost_local + reduce_ghost_mpi) fold every ghost cell once at most: a ghost listed by two map rows (two local rows, two MPI rows, or one of each) would be added twice. The forward update tolerates such duplicates (last writer wins), the transpose does not. Only same-level maps are meaningful here.

fortran
subroutine check_reduce_ghost_maps(self, grid, maps)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inThe field.
gridtype(grid_object)inGrid (sibling realm component, threaded in).
mapstype(maps_object)inMaps (sibling realm component, threaded in).

Call graph

update_ghost_mpi ​

Update ghost cells within other processes.

fortran
subroutine update_ghost_mpi(self, grid, maps, q, step)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inoutThe base backend.
gridtype(grid_object)inGrid (sibling realm component, threaded in).
mapstype(maps_object)inoutMaps (sibling realm component, threaded in).
qreal(kind=R8P)inoutField component to be updated.
stepinteger(kind=I4P)inoptionalStep to be perfordmed in asyncronous comp.

Call graph

derefine1D ​

Derefine blocks.

Note: blocks number is not updated: mpi redistribute does it. This is dangerous...

fortran
subroutine derefine1D(self, grid, ratio, block_to_derefine, block_derefined, q)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inoutThe field.
gridtype(grid_object)inGrid (sibling realm component, threaded in).
ratiointeger(kind=I4P)inRefinement ratio.
block_to_derefineinteger(kind=I8P)inallocatableList of blocks to be derefined.
block_derefinedinteger(kind=I8P)inallocatableList of derefined blocks with Morton code.
qreal(kind=R8P)inoutField cell centered variables.

Call graph

derefine2D ​

Derefine blocks.

Note: blocks number is not updated: mpi redistribute does it. This is dangerous...

fortran
subroutine derefine2D(self, grid, ratio, block_to_derefine, block_derefined, q)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inoutThe field.
gridtype(grid_object)inGrid (sibling realm component, threaded in).
ratiointeger(kind=I4P)inRefinement ratio.
block_to_derefineinteger(kind=I8P)inallocatableList of blocks to be derefined.
block_derefinedinteger(kind=I8P)inallocatableList of derefined blocks with Morton code.
qreal(kind=R8P)inoutField cell centered variables.

Call graph

derefine3D ​

Derefine blocks.

Note: blocks number is not updated: mpi redistribute does it. This is dangerous...

fortran
subroutine derefine3D(self, grid, ratio, block_to_derefine, block_derefined, q)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inoutThe field.
gridtype(grid_object)inGrid (sibling realm component, threaded in).
ratiointeger(kind=I4P)inRefinement ratio.
block_to_derefineinteger(kind=I8P)inallocatableList of blocks to be derefined.
block_derefinedinteger(kind=I8P)inallocatableList of derefined blocks with Morton code.
qreal(kind=R8P)inoutField cell centered variables.

Call graph

refine1D ​

Refine blocks.

Note: blocks number is not updated: mpi redistribute does it. This is dangerous...

fortran
subroutine refine1D(self, grid, ratio, block_to_refine, block_refined, q)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inoutThe field.
gridtype(grid_object)inGrid (sibling realm component, threaded in).
ratiointeger(kind=I4P)inRefinement ratio.
block_to_refineinteger(kind=I8P)inallocatableList of blocks to be refined.
block_refinedinteger(kind=I8P)inallocatableList of refined blocks with Morton code.
qreal(kind=R8P)inoutField cell centered variables.

Call graph

refine2D ​

Refine blocks.

Note: blocks number is not updated: mpi redistribute does it. This is dangerous...

fortran
subroutine refine2D(self, grid, ratio, block_to_refine, block_refined, q)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inoutThe field.
gridtype(grid_object)inGrid (sibling realm component, threaded in).
ratiointeger(kind=I4P)inRefinement ratio.
block_to_refineinteger(kind=I8P)inallocatableList of blocks to be refined.
block_refinedinteger(kind=I8P)inallocatableList of refined blocks with Morton code.
qreal(kind=R8P)inoutField cell centered variables.

Call graph

refine3D ​

Refine blocks.

Note: blocks number is not updated: mpi redistribute does it. This is dangerous...

fortran
subroutine refine3D(self, grid, ratio, block_to_refine, block_refined, q)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inoutThe field.
gridtype(grid_object)inGrid (sibling realm component, threaded in).
ratiointeger(kind=I4P)inRefinement ratio.
block_to_refineinteger(kind=I8P)inallocatableList of blocks to be refined.
block_refinedinteger(kind=I8P)inallocatableList of refined blocks with Morton code.
qreal(kind=R8P)inoutField cell centered variables.

Call graph

refine_conservative ​

Refine blocks by a conservative limited linear prolongation (issue #74, D-M5-2).

Each parent cell is split along the refined axes (ratio 2: i; 4: i, j; 8: i, j, k) into children set, variable by variable, to q + phi * sum_d sigma_d * s_d / 4: s_d is the monotonized-central (MC) slope of the parent along axis d, in parent-cell units, from its two face neighbours (the first ghost layer included), and sigma_d = -1, +1 the side of the child. The offsets cancel over the children, so their mean is the parent: the mean restriction of derefine*D undoes this prolongation, and the discrete integral sum(q dV) is unchanged, to round-off. phi in [0, 1] scales the slopes so that no child leaves the range of the parent and its face neighbours (Barth and Jespersen 1989): the MC limit alone bounds each axis, not the sum over the axes, which a corner child takes. A variable that is positive on the parent and its neighbours stays positive. Linear data are reproduced exactly: the MC slope of linear data is its centred difference, and a corner child moves by at most 3/4 of the largest neighbour difference, so phi = 1. Like the linear prolongation, it reads the parent's first ghost layer, which the caller must have refreshed.

Note: blocks number is not updated: mpi redistribute does it.

fortran
subroutine refine_conservative(self, grid, ratio, block_to_refine, block_refined, q)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inoutThe field.
gridtype(grid_object)inGrid (sibling realm component, threaded in).
ratiointeger(kind=I4P)inRefinement ratio, 2, 4 or 8.
block_to_refineinteger(kind=I8P)inallocatableList of blocks to be refined.
block_refinedinteger(kind=I8P)inallocatableList of refined blocks with Morton code.
qreal(kind=R8P)inoutField cell centered variables.

Call graph

update_coordinates ​

Update coordinates using the updated data in maps (that in turn is updated by tree).

fortran
subroutine update_coordinates(self, maps, tree)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inoutThe field.
mapstype(maps_object)inMaps (sibling realm component, threaded in).
treetype(tree_object)inTree (sibling realm component, threaded in).

Call graph

Functions ​

description ​

Return a pretty-formatted object description.

Attributes: pure

Returns: character(len=:)

fortran
function description(self) result(desc)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inThe field.

Call graph

do_caxis_intersect ​

Return true if a block is intersected by coordinate-axis.

Returns: logical

fortran
function do_caxis_intersect(self, b, caxis_origin, caxis_direction, caxis_block_indexes) result(do_intersect)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inoutThe field.
binteger(kind=I4P)inBlock index.
caxis_originreal(kind=R8P)inCoordinate-axis origin.
caxis_directionreal(kind=R8P)inCoordinate-axis direction.
caxis_block_indexesinteger(kind=I4P)outoptionalBlock-local indexes of caxis intersection.

do_cplane_intersect ​

Return true if a block is intersected by coordinate-plane.

Returns: logical

fortran
function do_cplane_intersect(self, grid, b, cplane_origin, cplane_normal, cplane_block_indexes) result(do_intersect)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inoutThe field.
gridtype(grid_object)inGrid (sibling realm component, threaded in).
binteger(kind=I4P)inBlock index.
cplane_originreal(kind=R8P)inCoordinate-plane origin.
cplane_normalreal(kind=R8P)inCoordinate-plane normal.
cplane_block_indexesinteger(kind=I4P)outoptionalBlock-local indexes of cplane intersection.

Call graph

do_ray_intersect ​

Return true if a block is intersected by ray from ray_origin and oriented as ray_direction vector.

Returns: logical

fortran
function do_ray_intersect(self, b, ray_origin, ray_direction) result(do_intersect)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_object)inoutThe field.
binteger(kind=I4P)inBlock index.
ray_originreal(kind=R8P)inRay origin.
ray_directionreal(kind=R8P)inRay direction.

Call graph

interp_seam_ghost ​

Evaluate the coarse->fine seam ghost interpolant for one (variable, fine ghost) pair (issue #21 N2): gather the donor footprint around the anchor (i_send,j_send,k_send) of block b_send and compose the 1D weights of the active regime. The anchor and the shift-clamped positions in meta guarantee the footprint reads REAL donor cells only (G3).

Attributes: pure

Returns: real(kind=R8P)

fortran
function interp_seam_ghost(regime, meta, ngc, q, v, i_send, j_send, k_send, b_send) result(value_)

Arguments

NameTypeIntentAttributesDescription
regimeinteger(kind=I4P)inActive fill regime (SEAM_FILL_*).
metainteger(kind=I4P)inPacked interpolation metadata (see seam_meta_pack).
ngcinteger(kind=I4P)inGhost cells number (bounds of q).
qreal(kind=R8P)inField variables.
vinteger(kind=I4P)inVariable index.
i_sendinteger(kind=I4P)inAnchor donor cell, i.
j_sendinteger(kind=I4P)inAnchor donor cell, j.
k_sendinteger(kind=I4P)inAnchor donor cell, k.
b_sendinteger(kind=I4P)inDonor block index.

Call graph

restrict_seam_high_order ​

Evaluate the high-order restriction of one (variable, coarse ghost) pair to the coarse centre, which sits midway between the fine cells first and first + 1 of each refined direction ((i_send,j_send,k_send) is the first fine cell of block b_send); the footprint first - code .. first - code + 5 is kept inside the donor block by the codes of meta (seam_restriction_code), which also carries the regime (seam_restriction_meta_pack):

  • 6-point Lagrange (issue #68 C1): the tensor product of the 1D weights SEAM_W_LAGRANGE6, summed direction by direction (x innermost), the same order as the FNL twin;
  • WENO (issue #68 C3): seam_restriction_weno6 on the gathered footprint. An unrefined direction (code SEAM_RESTRICT_IDENTITY) reads the cell itself only.

Attributes: pure

Returns: real(kind=R8P)

fortran
function restrict_seam_high_order(meta, ngc, q, v, i_send, j_send, k_send, b_send) result(value_)

Arguments

NameTypeIntentAttributesDescription
metainteger(kind=I4P)inPacked restriction codes and regime (seam_restriction_meta_pack).
ngcinteger(kind=I4P)inGhost cells number (bounds of q).
qreal(kind=R8P)inField variables.
vinteger(kind=I4P)inVariable index.
i_sendinteger(kind=I4P)inFirst fine cell of the restricted pair, i.
j_sendinteger(kind=I4P)inFirst fine cell of the restricted pair, j.
k_sendinteger(kind=I4P)inFirst fine cell of the restricted pair, k.
b_sendinteger(kind=I4P)inDonor block index.

Call graph

mc_slope ​

Monotonized-central limited slope (van Leer 1977) from the backward and forward differences.

Zero at an extremum (the differences disagree in sign), else the smallest of the centred difference and twice each one-sided difference, with their common sign.

Attributes: elemental

Returns: real(kind=R8P)

fortran
function mc_slope(dm, dp) result(slope)

Arguments

NameTypeIntentAttributesDescription
dmreal(kind=R8P)inBackward difference, q(i) - q(i-1).
dpreal(kind=R8P)inForward difference, q(i+1) - q(i).

Call graph