include/pops/mesh/storage/multifab.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
|
multifab.hpp
Go to the documentation of this file.
Box2D: the integer index space of a 2D cell-centered Cartesian grid.
BoxArray: the set of boxes tiling a level (disjoint, covering).
Owning MPI rank of each box, indexed by GLOBAL box index (parallel to a BoxArray).
Definition distribution_mapping.hpp:19
Single-grid data on a Box2D: VALID box + ng ghost layers, ncomp components, component-slow layout.
Definition fab2d.hpp:59
ConstArray4 const_array() const
READ handle (POD device-copyable) over this Fab. Valid as long as the Fab lives.
Definition fab2d.hpp:96
Small per-MultiFab cache of halo schedules, one entry per distinct (Periodicity, domain).
Definition halo_schedule.hpp:57
Field distributed over a level: decomposition (BoxArray) + distribution (DistributionMapping) + ncomp...
Definition multifab.hpp:33
MultiFab()=default
Fab2D & fab(int li)
Local fab at index li (0 <= li < local_size()), for writing.
Definition multifab.hpp:67
int local_index_of(int global) const
LOCAL index of the global box global, or -1 if it is not owned by this rank.
Definition multifab.hpp:75
int global_index(int li) const
GLOBAL index (in box_array) of local fab li.
Definition multifab.hpp:73
HaloScheduleCache & halo_cache() const
Internal (ADC-260): memoized halo-exchange schedule used by fill_boundary.
Definition multifab.hpp:100
void sync_host()
Makes the HOST residence valid (before a host access: operator(), loop, set_val).
Definition multifab.hpp:79
void sync_device()
Marks a DEVICE residence (before a kernel). No-op under unified memory.
Definition multifab.hpp:81
const Fab2D & fab(int li) const
Local fab at index li, for reading.
Definition multifab.hpp:69
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
MultiFab(BoxArray ba, DistributionMapping dm, int ncomp, int ngrow)
Builds the field: allocates one Fab2D (ncomp components, ngrow ghosts) for EACH box that this rank ow...
Definition multifab.hpp:39
void set_val(Real v)
Fills all cells (valid + ghosts) of every local fab with v.
Definition multifab.hpp:85
int local_size() const
Number of fabs OWNED by this rank (bound on local indices).
Definition multifab.hpp:65
Parallel seam: minimal MPI abstraction (rank/size + collectives) with serial fallback.
DistributionMapping: maps each box (by global index) to its owning MPI rank.
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...
HaloSchedule: memoized intra-level halo-exchange plan for fill_boundary (ADC-260).
Definition amr_hierarchy.hpp:29
Real for_each_cell_reduce_sum(const Box2D &b, F f)
SUM reduction of f(i, j) over box b.
Definition for_each.hpp:199
void sync_host()
Makes the HOST residency valid before a host access (read/write from the host).
Definition for_each.hpp:125
Real sum(const MultiFab &mf, int comp=0)
Sum of the VALID cells of component comp, reduced over ALL ranks (all_reduce).
Definition multifab.hpp:121
void sync_device()
Marks a DEVICE residency (upcoming kernel).
Definition for_each.hpp:132
READ-only handle (const counterpart of Array4): same layout and same contract (POD device-copyable,...
Definition fab2d.hpp:44
Base scalar types and the POPS_HD macro (host+device portability).
Generated by