|
MFC
Exascale flow solver
|
Hierarchical child nesting for AMR regrid: each level's children are tagged by the density-gradient sensor on the old parent-level fine solution, clustered, and replayed in rank-invariant order. Also holds the shared tag sensor. More...
Functions/Subroutines | |
| impure subroutine | s_amr_grow_pack (sidx, skb, nloc, extra) |
| Grow the pack buffers sidx/skb geometrically to hold nloc+extra entries, preserving the first nloc. | |
| impure subroutine | s_amr_pack_gwin_pairs (gwin, mlo, mhi, mg, ng, kb, sidx, skb, nloc) |
| Append this rank's tagged cells of child window [mlo:mhi] as (int8 linear index, parent kb) pairs; the encode matches the s_amr_nest_window_tags decode. gwin is not modified. | |
| impure subroutine, public | s_amr_regrid_nest_children (boxes, nboxes, box_level) |
| Regrid phase 3b: nest child boxes inside each level-(l-1) box for l = 2..amr_max_level (parents first) and set box_level. A child's extent is the density-gradient sensor on the old parent-level fine solution, coarsened and clustered; a new region with no fine data gets a centred inset. | |
| impure subroutine | s_amr_nest_mark_parents (boxes, plo, phi, lev, mine, covered) |
| mine(kb): this rank holds a level-(lev-1) block overlapping parent kb; covered(kb): any rank does (one LOR; every block has one owner). | |
| pure subroutine, public | s_amr_nest_window (box, mlo, mhi) |
| The nesting window of a parent: its box inset by amr_cpat_mar, so a child's ghost prolongation reads valid parent interior. | |
| pure logical function | f_amr_nest_window_empty (lo, hi) |
| Too small to nest a child in some active dimension. | |
| impure subroutine | s_amr_nest_tag_parent (box, lev, mlo, mhi, gwin, covered) |
| Pass 1 for one parent: tag its window from owned level-(lev-1) blocks (amr_block_level still holds the old levels). IB: also mark the body bbox with margin max(amr_buf, 4) + amr_cpat_mar, so the clamp to the window keeps a full image-point stencil. | |
| impure subroutine | s_amr_nest_route_pairs (powner, plo, sidx, skb, nloc, gidx, gkb, ntot) |
| Route each parent's (index, kb) pairs to its clustering owner with a stable counting sort by owner. Serial: the send list is the gathered list. | |
| impure subroutine | s_amr_nest_window_tags (kb, mlo, mhi, gidx, gkb, ntot, ctags, nct) |
| Pass 2 for one parent: rebuild its dense window from the routed pairs with gkb == kb (dedups replicated tags) and extract the tags in (k,j,i) order. The int8 decode matches s_amr_pack_gwin_pairs. | |
| impure subroutine | s_amr_nest_cluster_children (ctags, nct, mlo, mhi, lev, kb, mych, nmych) |
| Cluster a parent's tagged cells into children, padded by amr_buf and clamped into the nesting window. IB: expand over bodies and re-clamp (the window already holds the body plus margin). | |
| impure subroutine | s_amr_nest_inset_child (box, lev, kb, mych, nmych) |
| Brand-new region (no old fine data yet): a centred inset so the child still appears this regrid. | |
| pure subroutine | s_amr_nest_clamp (clo, chi, mlo, mhi, pad) |
| Pad a child by pad and clamp it into the nesting window; collapsed dims are pinned to 0. | |
| impure subroutine | s_amr_nest_emit (clo, chi, lev, kb, mych, nmych) |
| Tile a child to the level's slot cap, amr_maxc_fit/amr_ref_ratio**(lev-1) coarse cells, and append the tiles to this rank's list. | |
| impure subroutine | s_amr_nest_gather_children (mych, nmych, plo, phi, gch, chord, ntot) |
| Assemble every rank's children (7 ints each: lo, hi, parent kb) and order them by parent kb with a stable counting sort: chord(1:ntot) indexes gch in the canonical (kb ascending, emission) order. | |
| impure subroutine | s_amr_tag_child_from_fine (ob, win_lo, win_hi, ctag, any_tag) |
| Sensor-on-fine child tagging: OR the density-gradient tags of an old fine block into an L0 tag grid over a parent window. Reads the flat store on the host (caller refreshes it); one-sided differences at the fine edges avoid stale ghosts. | |
| real(wp) function | f_amr_tag_val_st (loc, ci, cj, ck) |
| The tagged variable at one cell (amr_tag_var): 1 total density (sum of the continuity variables), 2 volume fraction of fluid 1, 3 velocity magnitude, 4 pressure (five-equation mixture). _st reads the flat store, _sf the level-0 field. | |
| real(wp) function, public | f_amr_tag_val_sf (q, ci, cj, ck) |
| real(wp) function | f_amr_tag_grad_st (loc, ci, cj, ck, fm1, fm2, fm3) |
| Tag indicator (jump of the amr_tag_var variable) at one cell of a block in the flat store, max over the active dimensions. The stencil is clamped to the block (fm1:fm3 = block extents) since its ghosts are stale. | |
| pure real(wp) function, public | f_amr_tag_ind (rp, r0, rm) |
| Tag indicator from the tagged variable at i+1, i, i-1: central difference over 2*r_i, or with amr_tag_abs the larger absolute face jump. | |
Variables | |
| logical | amr_child_dropped = .false. |
| Nested children were dropped for lack of block capacity (warn once per regrid). | |
Hierarchical child nesting for AMR regrid: each level's children are tagged by the density-gradient sensor on the old parent-level fine solution, clustered, and replayed in rank-invariant order. Also holds the shared tag sensor.
|
private |
Too small to nest a child in some active dimension.
Definition at line 584 of file m_amr_nest.fpp.f90.
|
private |
Tag indicator (jump of the amr_tag_var variable) at one cell of a block in the flat store, max over the active dimensions. The stencil is clamped to the block (fm1:fm3 = block extents) since its ghosts are stale.
Definition at line 983 of file m_amr_nest.fpp.f90.
| pure real(wp) function, public m_amr_nest::f_amr_tag_ind | ( | real(wp), intent(in) | rp, |
| real(wp), intent(in) | r0, | ||
| real(wp), intent(in) | rm ) |
Tag indicator from the tagged variable at i+1, i, i-1: central difference over 2*r_i, or with amr_tag_abs the larger absolute face jump.
Definition at line 1000 of file m_amr_nest.fpp.f90.
| real(wp) function, public m_amr_nest::f_amr_tag_val_sf | ( | type(scalar_field), dimension(:), intent(in) | q, |
| integer, intent(in) | ci, | ||
| integer, intent(in) | cj, | ||
| integer, intent(in) | ck ) |
Definition at line 933 of file m_amr_nest.fpp.f90.
|
private |
The tagged variable at one cell (amr_tag_var): 1 total density (sum of the continuity variables), 2 volume fraction of fluid 1, 3 velocity magnitude, 4 pressure (five-equation mixture). _st reads the flat store, _sf the level-0 field.
| [in] | loc | flat-store slot |
Definition at line 882 of file m_amr_nest.fpp.f90.
|
private |
Grow the pack buffers sidx/skb geometrically to hold nloc+extra entries, preserving the first nloc.
Definition at line 395 of file m_amr_nest.fpp.f90.
|
private |
Pad a child by pad and clamp it into the nesting window; collapsed dims are pinned to 0.
Definition at line 751 of file m_amr_nest.fpp.f90.
|
private |
Cluster a parent's tagged cells into children, padded by amr_buf and clamped into the nesting window. IB: expand over bodies and re-clamp (the window already holds the body plus margin).
Definition at line 714 of file m_amr_nest.fpp.f90.
|
private |
Tile a child to the level's slot cap, amr_maxc_fit/amr_ref_ratio**(lev-1) coarse cells, and append the tiles to this rank's list.
Definition at line 762 of file m_amr_nest.fpp.f90.
|
private |
Assemble every rank's children (7 ints each: lo, hi, parent kb) and order them by parent kb with a stable counting sort: chord(1:ntot) indexes gch in the canonical (kb ascending, emission) order.
Definition at line 789 of file m_amr_nest.fpp.f90.
|
private |
Brand-new region (no old fine data yet): a centred inset so the child still appears this regrid.
Definition at line 736 of file m_amr_nest.fpp.f90.
|
private |
mine(kb): this rank holds a level-(lev-1) block overlapping parent kb; covered(kb): any rank does (one LOR; every block has one owner).
Definition at line 546 of file m_amr_nest.fpp.f90.
|
private |
Route each parent's (index, kb) pairs to its clustering owner with a stable counting sort by owner. Serial: the send list is the gathered list.
Definition at line 623 of file m_amr_nest.fpp.f90.
|
private |
Pass 1 for one parent: tag its window from owned level-(lev-1) blocks (amr_block_level still holds the old levels). IB: also mark the body bbox with margin max(amr_buf, 4) + amr_cpat_mar, so the clamp to the window keeps a full image-point stencil.
Definition at line 594 of file m_amr_nest.fpp.f90.
| pure subroutine, public m_amr_nest::s_amr_nest_window | ( | type(t_box), intent(in) | box, |
| integer, dimension(3), intent(out) | mlo, | ||
| integer, dimension(3), intent(out) | mhi ) |
The nesting window of a parent: its box inset by amr_cpat_mar, so a child's ghost prolongation reads valid parent interior.
Definition at line 574 of file m_amr_nest.fpp.f90.
|
private |
Pass 2 for one parent: rebuild its dense window from the routed pairs with gkb == kb (dedups replicated tags) and extract the tags in (k,j,i) order. The int8 decode matches s_amr_pack_gwin_pairs.
Definition at line 680 of file m_amr_nest.fpp.f90.
|
private |
Append this rank's tagged cells of child window [mlo:mhi] as (int8 linear index, parent kb) pairs; the encode matches the s_amr_nest_window_tags decode. gwin is not modified.
Definition at line 420 of file m_amr_nest.fpp.f90.
| impure subroutine, public m_amr_nest::s_amr_regrid_nest_children | ( | type(t_box), dimension(:), intent(inout), allocatable | boxes, |
| integer, intent(inout) | nboxes, | ||
| integer, dimension(:), intent(inout) | box_level ) |
Regrid phase 3b: nest child boxes inside each level-(l-1) box for l = 2..amr_max_level (parents first) and set box_level. A child's extent is the density-gradient sensor on the old parent-level fine solution, coarsened and clustered; a new region with no fine data gets a centred inset.
Per level: pass 1 tags each parent's window from owned old blocks and packs (index, kb) pairs; an alltoall routes them to the parent's round-robin owner; pass 2 rebuilds the window and clusters it into children; an allgatherv plus a stable sort by kb replays the children in serial order, so the list and its truncation are rank-invariant. IB nesting is np=1 only.
Definition at line 450 of file m_amr_nest.fpp.f90.
|
private |
Sensor-on-fine child tagging: OR the density-gradient tags of an old fine block into an L0 tag grid over a parent window. Reads the flat store on the host (caller refreshes it); one-sided differences at the fine edges avoid stale ghosts.
Definition at line 837 of file m_amr_nest.fpp.f90.
|
private |
Nested children were dropped for lack of block capacity (warn once per regrid).
Definition at line 390 of file m_amr_nest.fpp.f90.