Skip to content

adam_flume_seam_sync_object ​

ADAM, FLUME per-stage seam flux synchronisation data of the positivity limiter (issue #50, D1).

Why. The positivity limiter keeps every forward-Euler stage admissible cell by cell, but at a 2:1 AMR seam the end-of-step Berger-Colella reflux then replaces the coarse face flux by the restricted fine one, a correction no cell factor bounds: on the Balsara-Spicer blast across a refined box it drives coarse seam cells to rho e < 0 (issue #50). The limited runs therefore synchronise the seam flux at every stage, before the update:

  • the fine faces of the seam take as backbone F^LF(q_C, q_f), with the coarse donor cell q_C as outer state;
  • the coarse face takes the means of the fine high-order and backbone fluxes, F_H and F_LF (2x2 fine faces per coarse face cell, 2x1 on a quadtree face normal to x or y): the coarse backbone update with the mean of F^LF(q_C, q_f) is a convex combination of standard Lax-Friedrichs partial updates of q_C, hence admissible, so the coarse cell factor Lambda_C is computed with this pair;
  • both sides blend with one factor theta_s = min(Lambda_C, min Lambda_f), so each side stays in its corner box and the coarse flux is exactly the mean of the fine ones: conservative at every stage, the reflux reduces to round-off.

What this object holds. The register's intra-realm AMR faces are replicated on every rank (flux_register_object, issue #28), so per-face skins indexed like the register are complete after one MPI_ALLREDUCE each: the coarse donor states qc (SUM: one owner writes), the fine means flo, fhi (SUM over the fine quadrants), the fine factors lmin (MIN) and the seam factors th (SUM: the coarse owner writes). The fine seam faces of this rank keep their backbone and high-order fluxes in a compact store (fine_lo, fine_hi): the blend overwrites the face fluxes before the seam faces are set. The skin cell c runs over the two tangential axes, inner fastest, the register order.

Source: src/app/flume/common/adam_flume_seam_sync_object.F90

Dependencies

Contents ​

Derived Types ​

flume_seam_sync_object ​

Per-stage seam flux synchronisation data (host).

Components ​

NameTypeAttributesDescription
nvinteger(kind=I4P)Variables number.
ncellsinteger(kind=I4P)Skin cells of all intra-realm AMR register faces.
nfineinteger(kind=I4P)Face cells of this rank's fine seam faces.
offinteger(kind=I4P)allocatableSkin offset of each register face (-1: not intra-realm AMR).
fine_offinteger(kind=I4P)allocatableCompact offset of each (block, face) fine seam face (-1: none).
qcreal(kind=R8P)allocatableCoarse donor states [nv, ncells].
floreal(kind=R8P)allocatableMean fine backbone fluxes [nv, ncells].
fhireal(kind=R8P)allocatableMean fine high-order fluxes [nv, ncells].
lminreal(kind=R8P)allocatableSmallest fine factor [ncells].
threal(kind=R8P)allocatableSeam factors [ncells].
fine_loreal(kind=R8P)allocatableFine seam face backbone fluxes [nv, nfine].
fine_hireal(kind=R8P)allocatableFine seam face high-order fluxes [nv, nfine].

Type-Bound Procedures ​

NameAttributesDescription
buildpass(self)Size the skins from the register, reset them; .true. if any seam.
reduce_statespass(self)Complete the coarse donor states over the ranks.
reduce_fluxespass(self)Complete the fine means over the ranks.
reduce_factorspass(self)Complete the smallest fine factors over the ranks.
reduce_thetapass(self)Complete the seam factors over the ranks.

Subroutines ​

reduce_states ​

Complete the coarse donor states over the ranks (each skin cell written by its coarse owner only).

fortran
subroutine reduce_states(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_seam_sync_object)inoutThe synchronisation data.

Call graph

reduce_fluxes ​

Complete the fine means over the ranks (each quadrant written by its fine owner only).

fortran
subroutine reduce_fluxes(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_seam_sync_object)inoutThe synchronisation data.

Call graph

reduce_factors ​

Complete the smallest fine factors over the ranks.

fortran
subroutine reduce_factors(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_seam_sync_object)inoutThe synchronisation data.

Call graph

reduce_theta ​

Complete the seam factors over the ranks (each skin cell written by its coarse owner only).

fortran
subroutine reduce_theta(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_seam_sync_object)inoutThe synchronisation data.

Call graph

Functions ​

seam_weno5_sensor ​

Return the WENO-5 sensor of the face between v(3) and v(4) (issue #68 E1): r = min_k w_k / d_k of the right-interface reconstruction of cell 3 (v(1:5)) and of the left-interface one of cell 4 (v(2:6)), the Jiang-Shu weights of adam_weno_object (zeps = 1e-6, exponent 3, its smoothness-indicator table): about 1 on smooth data, near 0 where a stencil holds a discontinuity. The sensor of verification/amr-log/amr_log.py (A4) and of the weno-riemann flux correction (#47), threshold FLUX_CORRECTION_SENSOR_TAU. Whole-array argument: no array section crosses the device call boundary.

Attributes: pure

Returns: real(kind=R8P)

fortran
function seam_weno5_sensor(v) result(r)

Arguments

NameTypeIntentAttributesDescription
vreal(kind=R8P)inOne variable on the 6 cells across the face, in order.

Call graph

seam_weno5_cell_ratio ​

Return min_k w_k / d_k of the WENO-5 reconstruction of cell c of v with the linear weights d0, d1, d2 of the stencils (c-2..c), (c-1..c+1), (c..c+2) (seam_weno5_sensor).

Attributes: pure

Returns: real(kind=R8P)

fortran
function seam_weno5_cell_ratio(v, c, d0, d1, d2) result(r)

Arguments

NameTypeIntentAttributesDescription
vreal(kind=R8P)inOne variable on the 6 cells across the face.
cinteger(kind=I4P)inCell (3 or 4).
d0real(kind=R8P)inLinear weights.
d1real(kind=R8P)inLinear weights.
d2real(kind=R8P)inLinear weights.

Call graph

build ​

Size the skins of the register's intra-realm AMR faces and the compact store of this rank's fine seam faces, and reset them (qc, flo, fhi, th to 0, lmin to huge). The result depends on the replicated register only, so every rank takes the same branch and issues the same collectives.

Returns: logical

fortran
function build(self, flux_register, register_index, blocks_number, ni, nj, nk, nv) result(active)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_seam_sync_object)inoutThe synchronisation data.
flux_registertype(flux_register_object)inForest's flux register.
register_indexinteger(kind=I4P)in(block, face) signed register index.
blocks_numberinteger(kind=I4P)inActual blocks number.
niinteger(kind=I4P)inGrid dimensions.
njinteger(kind=I4P)inGrid dimensions.
nkinteger(kind=I4P)inGrid dimensions.
nvinteger(kind=I4P)inVariables number.

Call graph

seam_face_cells ​

Cells of a block face fec (1..6: -x, +x, -y, +y, -z, +z).

Attributes: pure

Returns: integer(kind=I4P)

fortran
function seam_face_cells(fec, ni, nj, nk) result(n)

Arguments

NameTypeIntentAttributesDescription
fecinteger(kind=I4P)inFace.
niinteger(kind=I4P)inGrid dimensions.
njinteger(kind=I4P)inGrid dimensions.
nkinteger(kind=I4P)inGrid dimensions.

Call graph

seam_skin_index ​

Skin index of the interior cell (i, j, k) beside face fec (the inverse of seam_skin_cell).

Attributes: pure

Returns: integer(kind=I4P)

fortran
function seam_skin_index(fec, ni, nj, i, j, k) result(c)

Arguments

NameTypeIntentAttributesDescription
fecinteger(kind=I4P)inFace.
niinteger(kind=I4P)inGrid dimensions.
njinteger(kind=I4P)inGrid dimensions.
iinteger(kind=I4P)inCell.
jinteger(kind=I4P)inCell.
kinteger(kind=I4P)inCell.

Call graph

seam_fine_to_coarse ​

Coarse skin cell covering the fine skin cell c of a fine block whose quadrant on the coarse face is (ioff, joff) (the convention of restrict_fine_face_to_quadrant: ri x ro fine face cells per coarse face cell, 2 per refined tangential axis, 1 with a zero offset along an axis the tree does not refine, z of a quadtree, issue #46).

Attributes: pure

Returns: integer(kind=I4P)

fortran
function seam_fine_to_coarse(fec, ni, nj, nk, ioff, joff, ri, ro, c) result(cc)

Arguments

NameTypeIntentAttributesDescription
fecinteger(kind=I4P)inFine block face.
niinteger(kind=I4P)inGrid dimensions.
njinteger(kind=I4P)inGrid dimensions.
nkinteger(kind=I4P)inGrid dimensions.
ioffinteger(kind=I4P)inQuadrant offsets (inner, outer).
joffinteger(kind=I4P)inQuadrant offsets (inner, outer).
riinteger(kind=I4P)inRefinement ratios along the inner and outer tangential axes.
rointeger(kind=I4P)inRefinement ratios along the inner and outer tangential axes.
cinteger(kind=I4P)inFine skin cell.

Call graph