include/pops/amr/hierarchy/amr_hierarchy.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
|
amr_hierarchy.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).
Stack of refined levels (domain + BoxArray + MultiFab per level), level 0 the coarsest.
Definition amr_hierarchy.hpp:38
void clear_above(int lev)
Removes all levels strictly finer than lev (no-op if lev is already the finest).
Definition amr_hierarchy.hpp:90
const MultiFab & data(int lev) const
Field of level lev (const access).
Definition amr_hierarchy.hpp:114
MultiFab & data(int lev)
Field of level lev (mutable access).
Definition amr_hierarchy.hpp:112
AmrHierarchy(const Box2D &coarse_domain, int max_grid_size, int ncomp, int ngrow, int ref_ratio=kAmrRefRatio)
Builds the hierarchy with only its level 0 (coarse).
Definition amr_hierarchy.hpp:47
int ncomp() const
Number of field components per cell.
Definition amr_hierarchy.hpp:103
int n_grow() const
Number of ghost layers of the MultiFab.
Definition amr_hierarchy.hpp:105
int ref_ratio() const
Integer refinement ratio between consecutive levels.
Definition amr_hierarchy.hpp:101
const Box2D & domain(int lev) const
Domain of level lev in index space (INCLUSIVE lo/hi corners).
Definition amr_hierarchy.hpp:108
int num_levels() const
Number of levels present (>= 1: level 0 always exists).
Definition amr_hierarchy.hpp:99
const BoxArray & boxes(int lev) const
BoxArray (split into boxes) of level lev.
Definition amr_hierarchy.hpp:110
void add_level(const BoxArray &fine_ba)
Adds a fine level defined by its BoxArray (in fine index space).
Definition amr_hierarchy.hpp:60
void install_level(int lev, const BoxArray &fine_ba, MultiFab data)
Installs (adds or replaces) a fine level at index lev.
Definition amr_hierarchy.hpp:72
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.
Definition box_array.hpp:30
Owning MPI rank of each box, indexed by GLOBAL box index (parallel to a BoxArray).
Definition distribution_mapping.hpp:19
Field distributed over a level: decomposition (BoxArray) + distribution (DistributionMapping) + ncomp...
Definition multifab.hpp:33
Parallel seam: minimal MPI abstraction (rank/size + collectives) with serial fallback.
DistributionMapping: maps each box (by global index) to its owning MPI rank.
MultiFab: a field DISTRIBUTED over a level (equivalent of AMReX's MultiFab).
Definition amr_hierarchy.hpp:29
void require_supported_ref_ratio(int ratio)
Validates a requested AMR refinement ratio at the hierarchy boundary.
Definition refinement_ratio.hpp:35
constexpr int kAmrRefRatio
The native AMR refinement ratio between two consecutive levels.
Definition refinement_ratio.hpp:30
Single source of truth for the native AMR refinement ratio.
Generated by