|
MFC
Exascale flow solver
|
Contains module m_amr_nest. More...
Go to the source code of this file.
Modules | |
| module | m_amr_nest |
| 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. | |
Functions/Subroutines | |
| impure subroutine | m_amr_nest::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 | m_amr_nest::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 | m_amr_nest::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 | m_amr_nest::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 | m_amr_nest::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 | m_amr_nest::f_amr_nest_window_empty (lo, hi) |
| Too small to nest a child in some active dimension. | |
| impure subroutine | m_amr_nest::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 | m_amr_nest::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 | m_amr_nest::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 | m_amr_nest::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 | m_amr_nest::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 | m_amr_nest::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 | m_amr_nest::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 | m_amr_nest::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 | m_amr_nest::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 | m_amr_nest::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 | m_amr_nest::f_amr_tag_val_sf (q, ci, cj, ck) |
| real(wp) function | m_amr_nest::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 | m_amr_nest::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 | m_amr_nest::amr_child_dropped = .false. |
| Nested children were dropped for lack of block capacity (warn once per regrid). | |
Contains module m_amr_nest.
Definition in file m_amr_nest.fpp.f90.