include/pops/numerics/spatial/embedded_boundary/operator.hpp Source FileΒΆ
|
adc_cpp 0.3.0
Model-free C++23 core for coupled hyperbolic-elliptic systems on adaptive (AMR) meshes, with MPI and GPU (Kokkos) backends
|
operator.hpp
Go to the documentation of this file.
13#include <pops/numerics/spatial/embedded_boundary/domain.hpp> // detail::DiscDomain (level-set domain; numerics, not runtime)
14#include <pops/numerics/spatial_operator.hpp> // reconstruct<>, load_state/load_aux, *_face_box (REUSED verbatim)
274 // SMALL-CELL CLAMP: bounds 1/kappa to 1/kappa_min -> finite residual, stable fixed step. Acts ONLY on
275 // the denominator (volume); the fluxes (numerator) are unchanged -> GLOBAL conservation preserved.
323template <class Limiter = NoSlope, class NumericalFlux = RusanovFlux, class Model, class LevelSet>
324void assemble_rhs_eb(const Model& model, const MultiFab& U, const MultiFab& aux, const LevelSet& ls,
327 // STATE-GHOST WIDTH: exactly Limiter::n_ghost, like the Cartesian operator. The EB face kernels
333 // (1 ghost, narrower). HOST-only guard, BEFORE the pass-1/pass-2 loops -- never inside a kernel.
BoxArray: the set of boxes tiling a level (disjoint, covering).
const std::vector< Box2D > & boxes() const
View on the underlying vector (element-by-element equality = same boxes AND same order).
Definition box_array.hpp:46
ConstArray4 const_array() const
READ handle (POD device-copyable) over this Fab. Valid as long as the Fab lives.
Definition fab2d.hpp:96
Array4 array()
WRITE handle (POD device-copyable) over this Fab. Valid as long as the Fab lives.
Definition fab2d.hpp:91
Field distributed over a level: decomposition (BoxArray) + distribution (DistributionMapping) + ncomp...
Definition multifab.hpp:33
Fab2D & fab(int li)
Local fab at index li (0 <= li < local_size()), for writing.
Definition multifab.hpp:67
const DistributionMapping & dmap() const
GLOBAL distribution (owner rank per box).
Definition multifab.hpp:58
const BoxArray & box_array() const
GLOBAL decomposition of the level (all boxes, all ranks).
Definition multifab.hpp:56
const Box2D & box(int li) const
VALID box of local fab li.
Definition multifab.hpp:71
int local_size() const
Number of fabs OWNED by this rank (bound on local indices).
Definition multifab.hpp:65
SHARED cut-fraction primitive (cut-cell / embedded boundary).
Generic EMBEDDED-BOUNDARY / LEVEL-SET DOMAIN contract (ADC-327).
Fab2D: single-grid data on a Box2D (in-house equivalent of AMReX's FArrayBox); Array4 / ConstArray4: ...
for_each_cell and reductions: the parallelism SEAM over the cells of a Box2D; sync_host / sync_device...
Geometry: index-space (Box2D) <-> Cartesian physical-space mapping; PolarGeometry: SIBLING for a glob...
MultiFab: a field DISTRIBUTED over a level (equivalent of AMReX's MultiFab).
POPS_HD DiscLevelSet disc_level_set(const DiscDomain &d)
Builds the disc level set callable from a DiscDomain (sugar: disc_level_set(d)).
Definition operator.hpp:122
POPS_HD CutFraction cut_fraction(const LevelSet &ls, Real xc, Real yc, Real dx, Real dy)
Computes the cut geometry of an ACTIVE cell (center (xc, yc) with ls < 0) from a level-set ls evaluat...
Definition cut_fraction.hpp:76
POPS_HD bool eb_cell_active(const LevelSet &ls, Real xc, Real yc)
Activity indicator (center in the disc, ls < 0) from a callable level set. POPS_HD.
Definition operator.hpp:128
POPS_HD Real eb_face_aperture(Real lc, Real ln, Real h)
Definition operator.hpp:147
POPS_HD Real cut_distance(Real lc, Real ln, Real h)
Cut distance of ONE face along a direction, starting from the active center (ls < 0).
Definition cut_fraction.hpp:33
constexpr Real kEbFaceOpenEps
Default aperture below which a face is treated as CLOSED (immersed wall).
Definition operator.hpp:104
Definition amr_hierarchy.hpp:29
void for_each_cell(const Box2D &b, F f)
Applies f to EACH cell (i, j) of box b (bounds inclusive), via Kokkos::parallel_for (Serial / OpenMP ...
Definition for_each.hpp:138
POPS_HD Aux load_aux(const ConstArray4 &a, int i, int j)
load_aux<NComp>: reads NComp components of the auxiliary from an Array4 at (i,j).
Definition state_access.hpp:141
void assemble_rhs_eb(const Model &model, const MultiFab &U, const MultiFab &aux, const LevelSet &ls, const Geometry &geom, MultiFab &R, bool recon_prim=false, Real kappa_min=detail::kEbKappaMin, Real pos_floor=Real(0))
assemble_rhs_eb<Limiter, NumericalFlux>: residual R = -div_eb F + S on a DISC in cut-cell / EB,...
Definition operator.hpp:324
Box2D xface_box(const Box2D &v)
xface_box / yface_box: face boxes normal to x (resp.
Definition face_flux.hpp:147
Single-interface numerical flux policies: Rusanov, HLL, HLLC, Roe.
Interface reconstruction policies: MUSCL limiters and WENO5-Z.
Cartesian spatial operator: assembles R(U, aux) = -div F + S over the cells of a level.
Pointwise types of the physics layer: StateVec<N> (conserved state) and Aux (auxiliary fields from th...
WRITE POD handle (raw pointer + strides) over a Fab2D buffer, indexed by (i, j, c) IN GLOBAL INDICES ...
Definition fab2d.hpp:29
POINTWISE auxiliary fields shared with the physics: single coupling channel.
Definition state.hpp:123
READ-only handle (const counterpart of Array4): same layout and same contract (POD device-copyable,...
Definition fab2d.hpp:44
Cartesian geometry of a level: index domain + physical bounds [xlo, xhi] x [ylo, yhi].
Definition geometry.hpp:20
POPS_HD Real x_cell(int i) const
Abscissa at the CENTER of cell index i (i = 0 -> xlo + dx/2; defined for negative i)....
Definition geometry.hpp:35
POPS_HD Real dy() const
Grid spacing in y (= (yhi - ylo) / domain.ny()). POPS_HD.
Definition geometry.hpp:33
POPS_HD Real dx() const
Grid spacing in x (= (xhi - xlo) / domain.nx()). POPS_HD.
Definition geometry.hpp:31
POPS_HD Real y_cell(int j) const
Ordinate at the CENTER of cell index j. POPS_HD.
Definition geometry.hpp:37
Geometric result of crossing a cut cell: 4 cut distances per face, the 4 apertures alpha_f normalized...
Definition cut_fraction.hpp:52
Real kappa
volume fraction of the cell (share in the active domain), in (0, 1]
Definition cut_fraction.hpp:61
CIRCLE / DISC level-set domain: the canonical instance of the contract and the SINGLE SOURCE of truth...
Definition domain.hpp:69
POPS_HD Real level_set(Real x, Real y) const
Level set ls(x, y) = hypot(x - cx, y - cy) - R: < 0 inside, 0 at the boundary, > 0 outside.
Definition domain.hpp:82
Device-safe adapter wrapping a DiscDomain as the Real(Real, Real) callable expected by cut_fraction a...
Definition operator.hpp:116
POPS_HD Real operator()(Real x, Real y) const
Definition operator.hpp:118
Kernel assembling the EB residual at cell (i, j): INACTIVE cell -> residual 0 (not advanced,...
Definition operator.hpp:256
POPS_HD void operator()(int i, int j) const
Definition operator.hpp:264
FACE FLUX kernel for x (dir 0) of the EB transport: numerical flux at the face between (i-1,...
Definition operator.hpp:162
int pos_comp
component of the Density role (resolved by the host caller)
Definition operator.hpp:173
Real pos_floor
Zhang-Shu positivity limiter (<= 0: inactive, bit-identical)
Definition operator.hpp:172
POPS_HD void operator()(int i, int j) const
Definition operator.hpp:174
FACE FLUX kernel for y (dir 1) of the EB transport: analogue of EbFaceFluxXKernel in j.
Definition operator.hpp:207
int pos_comp
component of the Density role (resolved by the host caller)
Definition operator.hpp:218
POPS_HD void operator()(int i, int j) const
Definition operator.hpp:219
Real pos_floor
Zhang-Shu positivity limiter (<= 0: inactive, bit-identical)
Definition operator.hpp:217
Base scalar types and the POPS_HD macro (host+device portability).
Generated by