include/pops/numerics/time/reference/amr_reflux.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_reflux.hpp
Go to the documentation of this file.
43// NAMED FUNCTORS (and not POPS_HD lambdas) for the AMR reflux device kernels. Same reasons as the
45// instantiated from an external loader TU, where an extended lambda trips the device kernel emission
172void amr_step_2level(const Model& m, Fab2D& Uc, const Box2D& dom, double dxc, double dyc, Fab2D& Uf,
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
const Box2D & grown_box() const
Grown box (valid + ng ghosts) = actual memory footprint.
Definition fab2d.hpp:76
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
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...
Definition amr_hierarchy.hpp:29
POPS_HD Model::State rusanov_flux(const Model &m, const typename Model::State &UL, const Aux &AL, const typename Model::State &UR, const Aux &AR, int dir)
rusanov_flux: free compat, delegates to RusanovFlux{} (policy of numerical_flux.hpp).
Definition face_flux.hpp:37
void fill_periodic_fab(Fab2D &U, const Box2D &dom)
Definition amr_reflux.hpp:119
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
void compute_fluxes_1c(const Model &m, const Fab2D &U, const Fab2D &aux, Fab2D &fx, Fab2D &fy)
Definition amr_reflux.hpp:94
POPS_HD Aux load_aux(const ConstArray4 &a, int i, int j)
load_aux<NComp>: reads NComp components of the auxiliary from an Array4 at (i,j).
Definition state_access.hpp:141
void average_down_fab(const Fab2D &Uf, Fab2D &Uc, int CI0, int CI1, int CJ0, int CJ1)
Definition amr_reflux.hpp:154
BoxArray coarsen(const BoxArray &ba, int r)
Coarsens each box of the BoxArray by a ratio r (coarsen box by box, order preserved).
Definition refinement.hpp:39
void amr_step_2level(const Model &m, Fab2D &Uc, const Box2D &dom, double dxc, double dyc, Fab2D &Uf, int CI0, int CI1, int CJ0, int CJ1, const Fab2D &auxc, const Fab2D &auxf, double dt)
Definition amr_reflux.hpp:172
Box2D xface_box(const Box2D &v)
xface_box / yface_box: face boxes normal to x (resp.
Definition face_flux.hpp:147
constexpr int kAmrRefRatio
The native AMR refinement ratio between two consecutive levels.
Definition refinement_ratio.hpp:30
void advance_fab_1c(const Model &m, Fab2D &U, const Fab2D &aux, double dx, double dy, double dt, Fab2D &fx, Fab2D &fy)
Definition amr_reflux.hpp:109
void fill_fine_ghosts_t(Fab2D &Uf, const Fab2D &Uco, const Fab2D &Ucn, double frac)
Definition amr_reflux.hpp:138
Single source of truth for the native AMR refinement ratio.
Cartesian spatial operator: assembles R(U, aux) = -div F + S over the cells of a level.
Pointwise types of the physics layer: StateVec<N> (conserved state) and Aux (auxiliary fields from th...
WRITE POD handle (raw pointer + strides) over a Fab2D buffer, indexed by (i, j, c) IN GLOBAL INDICES ...
Definition fab2d.hpp:29
POPS_HD int nx() const
Width (direction 0). POPS_HD (called from Geometry::dx() in a device kernel).
Definition box2d.hpp:50
bool contains(int i, int j) const
true if cell (i, j) is inside the box (lo/hi bounds inclusive).
Definition box2d.hpp:61
POPS_HD int ny() const
Height (direction 1). POPS_HD (called from Geometry::dy() in a device kernel).
Definition box2d.hpp:52
READ-only handle (const counterpart of Array4): same layout and same contract (POD device-copyable,...
Definition fab2d.hpp:44
Explicit Euler, 1 component: U -= dt div(F) on cell (i,j).
Definition amr_reflux.hpp:79
POPS_HD void operator()(int i, int j) const
Definition amr_reflux.hpp:83
Rusanov flux at the left face (x axis) of cell (i,j).
Definition amr_reflux.hpp:50
POPS_HD void operator()(int i, int j) const
Definition amr_reflux.hpp:54
Rusanov flux at the bottom face (y axis) of cell (i,j).
Definition amr_reflux.hpp:65
POPS_HD void operator()(int i, int j) const
Definition amr_reflux.hpp:69
Base scalar types and the POPS_HD macro (host+device portability).
Generated by