include/pops/mesh/boundary/physical_bc.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
|
physical_bc.hpp
Go to the documentation of this file.
38// itself pulled from the MG V-cycle first-instantiated from an external TU; an extended lambda there
39// trips up device kernel emission under nvcc. Body identical to the old lambdas (Foextrap: copy of
42// Component range [c0, c1): the WHOLE channel for the all-component fill, or a single component for the
43// per-field aux halo override (ADC-369). The loop bounds are the only difference; the all-channel path
114 // Physical edges on DEVICE (for_each_cell -> kernel): ghost = mirror cell (Foextrap: copy of the
115 // 1st interior; Dirichlet: 2 v - reflection). Ghost index <-> layer: for x low, i = lo-k so the
126 // VALID range alone. Reason (9-point stencil corner, multi-box): a CROSS term (a_rt/a_tr of the
130 // reflection (which reads a(lo, j) / a(2 lo - i - 1, j) at the SAME j) thus correctly extends the
131 // radial edge into the y halo. Without this extension, the corner (x-ghost, y-ghost) stays at 0
132 // and the cross term is WRONG at the box edge (multi-box divergence, cf. test_polar_schur_multibox).
135 // extended, below, which runs AFTER) -> Cartesian behavior unchanged (y wins). In y-physical we
136 // read a(lo, j-ghost) here, possibly not filled, but the result is overwritten: no effect on the
Box2D: the integer index space of a 2D cell-centered Cartesian grid.
Single-grid data on a Box2D: VALID box + ng ghost layers, ncomp components, component-slow layout.
Definition fab2d.hpp:59
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
int local_size() const
Number of fabs OWNED by this rank (bound on local indices).
Definition multifab.hpp:65
Fab2D: single-grid data on a Box2D (in-house equivalent of AMReX's FArrayBox); Array4 / ConstArray4: ...
fill_boundary: INTRA-level halo exchange (fills ghosts from neighbors).
MultiFab: a field DISTRIBUTED over a level (equivalent of AMReX's MultiFab).
Definition amr_hierarchy.hpp:29
void fill_physical_bc_range(MultiFab &mf, const Box2D &domain, const BCRec &bc, int c0, int c1)
Fills the OUT-OF-domain ghosts of the NON-periodic faces of mf according to bc (Foextrap or Dirichlet...
Definition physical_bc.hpp:96
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
BCRec aux_halo_override(const BCRec &shared, const AuxHaloPolicy &p)
Builds the effective override BCRec for a per-field aux halo: starts from the SHARED aux BC shared (s...
Definition physical_bc.hpp:204
void fill_boundary(MultiFab &mf, const Box2D &domain, Periodicity per={})
BLOCKING halo exchange: begin then end immediately (no overlap).
Definition fill_boundary.hpp:333
void fill_physical_bc(MultiFab &mf, const Box2D &domain, const BCRec &bc)
Fills the physical-face ghosts of ALL components per bc (historical entry point, bit-identical).
Definition physical_bc.hpp:176
BCType
Boundary condition type for a face: Periodic (handled by fill_boundary), Foextrap (zero gradient,...
Definition physical_bc.hpp:25
@ Foextrap
@ Dirichlet
@ Periodic
void fill_ghosts(MultiFab &mf, const Box2D &domain, const BCRec &bc)
COMPLETE ghost filling: fill_boundary (interior + periodic, periodicity deduced from bc) THEN fill_ph...
Definition physical_bc.hpp:227
WRITE POD handle (raw pointer + strides) over a Fab2D buffer, indexed by (i, j, c) IN GLOBAL INDICES ...
Definition fab2d.hpp:29
Per-field aux halo policy (ADC-369): a UNIFORM boundary policy for ONE model-named aux component,...
Definition physical_bc.hpp:195
Boundary conditions for the FOUR faces of the domain (type + associated Dirichlet value).
Definition physical_bc.hpp:29
Per-direction periodicity: halo wrapping in x and/or y during the exchange (false = open edge,...
Definition fill_boundary.hpp:37
Definition physical_bc.hpp:55
POPS_HD void operator()(int i, int j) const
Definition physical_bc.hpp:60
Definition physical_bc.hpp:45
POPS_HD void operator()(int i, int j) const
Definition physical_bc.hpp:50
Definition physical_bc.hpp:75
POPS_HD void operator()(int i, int j) const
Definition physical_bc.hpp:80
Definition physical_bc.hpp:65
POPS_HD void operator()(int i, int j) const
Definition physical_bc.hpp:70
Base scalar types and the POPS_HD macro (host+device portability).
Generated by