Appearance
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 cellq_Cas outer state; - the coarse face takes the means of the fine high-order and backbone fluxes,
F_HandF_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 ofF^LF(q_C, q_f)is a convex combination of standard Lax-Friedrichs partial updates ofq_C, hence admissible, so the coarse cell factorLambda_Cis 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
- flume_seam_sync_object
- reduce_states
- reduce_fluxes
- reduce_factors
- reduce_theta
- seam_weno5_sensor
- seam_weno5_cell_ratio
- build
- seam_face_cells
- seam_skin_index
- seam_fine_to_coarse
Derived Types
flume_seam_sync_object
Per-stage seam flux synchronisation data (host).
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
nv | integer(kind=I4P) | Variables number. | |
ncells | integer(kind=I4P) | Skin cells of all intra-realm AMR register faces. | |
nfine | integer(kind=I4P) | Face cells of this rank's fine seam faces. | |
off | integer(kind=I4P) | allocatable | Skin offset of each register face (-1: not intra-realm AMR). |
fine_off | integer(kind=I4P) | allocatable | Compact offset of each (block, face) fine seam face (-1: none). |
qc | real(kind=R8P) | allocatable | Coarse donor states [nv, ncells]. |
flo | real(kind=R8P) | allocatable | Mean fine backbone fluxes [nv, ncells]. |
fhi | real(kind=R8P) | allocatable | Mean fine high-order fluxes [nv, ncells]. |
lmin | real(kind=R8P) | allocatable | Smallest fine factor [ncells]. |
th | real(kind=R8P) | allocatable | Seam factors [ncells]. |
fine_lo | real(kind=R8P) | allocatable | Fine seam face backbone fluxes [nv, nfine]. |
fine_hi | real(kind=R8P) | allocatable | Fine seam face high-order fluxes [nv, nfine]. |
Type-Bound Procedures
| Name | Attributes | Description |
|---|---|---|
build | pass(self) | Size the skins from the register, reset them; .true. if any seam. |
reduce_states | pass(self) | Complete the coarse donor states over the ranks. |
reduce_fluxes | pass(self) | Complete the fine means over the ranks. |
reduce_factors | pass(self) | Complete the smallest fine factors over the ranks. |
reduce_theta | pass(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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_seam_sync_object) | inout | The 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_seam_sync_object) | inout | The synchronisation data. |
Call graph
reduce_factors
Complete the smallest fine factors over the ranks.
fortran
subroutine reduce_factors(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_seam_sync_object) | inout | The 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_seam_sync_object) | inout | The 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
v | real(kind=R8P) | in | One 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
v | real(kind=R8P) | in | One variable on the 6 cells across the face. | |
c | integer(kind=I4P) | in | Cell (3 or 4). | |
d0 | real(kind=R8P) | in | Linear weights. | |
d1 | real(kind=R8P) | in | Linear weights. | |
d2 | real(kind=R8P) | in | Linear 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_seam_sync_object) | inout | The synchronisation data. | |
flux_register | type(flux_register_object) | in | Forest's flux register. | |
register_index | integer(kind=I4P) | in | (block, face) signed register index. | |
blocks_number | integer(kind=I4P) | in | Actual blocks number. | |
ni | integer(kind=I4P) | in | Grid dimensions. | |
nj | integer(kind=I4P) | in | Grid dimensions. | |
nk | integer(kind=I4P) | in | Grid dimensions. | |
nv | integer(kind=I4P) | in | Variables 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
fec | integer(kind=I4P) | in | Face. | |
ni | integer(kind=I4P) | in | Grid dimensions. | |
nj | integer(kind=I4P) | in | Grid dimensions. | |
nk | integer(kind=I4P) | in | Grid 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
fec | integer(kind=I4P) | in | Face. | |
ni | integer(kind=I4P) | in | Grid dimensions. | |
nj | integer(kind=I4P) | in | Grid dimensions. | |
i | integer(kind=I4P) | in | Cell. | |
j | integer(kind=I4P) | in | Cell. | |
k | integer(kind=I4P) | in | Cell. |
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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
fec | integer(kind=I4P) | in | Fine block face. | |
ni | integer(kind=I4P) | in | Grid dimensions. | |
nj | integer(kind=I4P) | in | Grid dimensions. | |
nk | integer(kind=I4P) | in | Grid dimensions. | |
ioff | integer(kind=I4P) | in | Quadrant offsets (inner, outer). | |
joff | integer(kind=I4P) | in | Quadrant offsets (inner, outer). | |
ri | integer(kind=I4P) | in | Refinement ratios along the inner and outer tangential axes. | |
ro | integer(kind=I4P) | in | Refinement ratios along the inner and outer tangential axes. | |
c | integer(kind=I4P) | in | Fine skin cell. |
Call graph