BoxArray Class ReferenceΒΆ

adc_cpp: pops::BoxArray Class Reference
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

Ordered list of boxes tiling a level. More...

#include <box_array.hpp>

+ Collaboration diagram for pops::BoxArray:

Public Member Functions

 BoxArray ()=default
 
 BoxArray (std::vector< Box2D > boxes)
 Build from an already-computed list of boxes (move). The order is kept as is.
 
int size () const
 Number of boxes in the tiling.
 
const Box2Doperator[] (int i) const
 Box at global index i (0 <= i < size()); the index is the box identity throughout the code.
 
const std::vector< Box2D > & boxes () const
 View on the underlying vector (element-by-element equality = same boxes AND same order).
 
std::int64_t num_cells () const
 Total number of valid cells (sum of num_cells over all boxes).
 
Box2D bounding_box () const
 Smallest box enclosing all boxes (empty box if the tiling is empty).
 

Static Public Member Functions

static BoxArray from_domain (const Box2D &domain, int max_grid_size)
 Tile the domain into tiles of at most max_grid_size per direction, distributed evenly.
 

Detailed Description

Ordered list of boxes tiling a level.

Expected INVARIANT (not checked): boxes disjoint and covering the domain. The ORDER is significant (global box index = position in the vector; shared by MultiFab / DistributionMapping). Copyable (vector of Box2D).

Constructor & Destructor Documentation

◆ BoxArray() [1/2]

pops::BoxArray::BoxArray ( )
default

◆ BoxArray() [2/2]

pops::BoxArray::BoxArray ( std::vector< Box2D boxes)
inlineexplicit

Build from an already-computed list of boxes (move). The order is kept as is.

Member Function Documentation

◆ bounding_box()

Box2D pops::BoxArray::bounding_box ( ) const
inline

Smallest box enclosing all boxes (empty box if the tiling is empty).

+ Here is the caller graph for this function:

◆ boxes()

const std::vector< Box2D > & pops::BoxArray::boxes ( ) const
inline

View on the underlying vector (element-by-element equality = same boxes AND same order).

+ Here is the caller graph for this function:

◆ from_domain()

static BoxArray pops::BoxArray::from_domain ( const Box2D domain,
int  max_grid_size 
)
inlinestatic

Tile the domain into tiles of at most max_grid_size per direction, distributed evenly.

Traversal order is y outer, x inner (deterministic, identical on all ranks).

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ num_cells()

std::int64_t pops::BoxArray::num_cells ( ) const
inline

Total number of valid cells (sum of num_cells over all boxes).

+ Here is the caller graph for this function:

◆ operator[]()

const Box2D & pops::BoxArray::operator[] ( int  i) const
inline

Box at global index i (0 <= i < size()); the index is the box identity throughout the code.

◆ size()

int pops::BoxArray::size ( ) const
inline

Number of boxes in the tiling.

+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: