include/pops/mesh/storage/fab2d.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
|
fab2d.hpp
Go to the documentation of this file.
Fab2D storage allocator, selectable at compile time.
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
void set_val(Real v)
Fills the whole buffer (valid + ghosts) with value v.
Definition fab2d.hpp:105
const Box2D & grown_box() const
Grown box (valid + ng ghosts) = actual memory footprint.
Definition fab2d.hpp:76
Fab2D(const Box2D &valid, int ncomp, int ng)
Allocates the valid box grown by ng ghosts, ncomp components, initialized to 0.
Definition fab2d.hpp:64
Real & operator()(int i, int j, int c=0)
HOST write access (i, j, c) (bounds assert in debug).
Definition fab2d.hpp:86
Fab2D()=default
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
std::int64_t size() const
Buffer size (nx_tot * ny_tot * ncomp).
Definition fab2d.hpp:82
Real * data()
Raw pointer to the buffer (passed directly to MPI in unified memory, for instance).
Definition fab2d.hpp:102
Real operator()(int i, int j, int c=0) const
HOST read access (i, j, c) (bounds assert in debug).
Definition fab2d.hpp:88
Definition amr_hierarchy.hpp:29
WRITE POD handle (raw pointer + strides) over a Fab2D buffer, indexed by (i, j, c) IN GLOBAL INDICES ...
Definition fab2d.hpp:29
POPS_HD Real & operator()(int i, int j, int c=0) const
Reference to cell (i, j) of component c (global indices).
Definition fab2d.hpp:37
bool contains(int i, int j) const
true if cell (i, j) is inside the box (lo/hi bounds inclusive).
Definition box2d.hpp:61
READ-only handle (const counterpart of Array4): same layout and same contract (POD device-copyable,...
Definition fab2d.hpp:44
POPS_HD Real operator()(int i, int j, int c=0) const
Value of cell (i, j) of component c (global indices). POPS_HD, no bounds checking.
Definition fab2d.hpp:51
Base scalar types and the POPS_HD macro (host+device portability).
Generated by