include/pops/numerics/spatial/operators/polar_operator.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
|
polar_operator.hpp
Go to the documentation of this file.
12#include <pops/numerics/spatial_operator.hpp> // reconstruct<>, load_state/load_aux (REUSED verbatim)
53// detect it and fall back to 0 otherwise -> the polar operator works just as well on the standalone
101// RADIAL FACE FLUX kernel (dir 0): numerical flux at the radial face i (between i-1 and i), ALREADY
119 // Optional RADIAL WALL (no-penetration). wall_radial == false (default): no effect, boundary flux
120 // computed like the interior (BIT-IDENTICAL to the history: MMS, azimuthal conservation). true:
121 // the radial flux at BOTH physical boundary faces (i = i_lo_face = lo, i = i_hi_face = hi+1) is
123 // boundaries no longer count) -> mass Sum n r dr dtheta conserved to machine precision, whatever
151// AZIMUTHAL FACE FLUX kernel (dir 1): numerical flux at the theta face j (between j-1 and j). NO
180// R = S - (1/r_i) (Fr_weighted_{i+1} - Fr_weighted_i) / dr - (1/r_i) (Ftheta_{j+1} - Ftheta_j) / dtheta
211// Radial / azimuthal FACE boxes (cf. Cartesian xface_box/yface_box): radial faces = nr+1 x ntheta,
212// azimuthal faces = nr x ntheta+1. Reuses the Cartesian helpers (same face index conventions) to
233 // STATE-GHOST WIDTH: exactly Limiter::n_ghost, like the Cartesian operator. The polar face kernels
234 // (PolarFaceFluxRKernel / PolarFaceFluxThetaKernel) reuse reconstruct_pp<> VERBATIM at the SAME
235 // i-1/i (radial) and j-1/j (azimuthal) offsets over the SAME face boxes (xface_box/yface_box, up
236 // to hi+1) as compute_face_fluxes -> identical reconstruction stencil (i+-Limiter::n_ghost at the
237 // edge of the valid box). The polar metric (r_face = r_min + i*dr, r_cell, 1/r) is computed from
238 // INDICES, never read from U, so it adds NO state-ghost width; aux is read at i+-1 only (1 ghost,
243 // Physical radial boundary faces (wall): r_min at the lo face of the index domain, r_max at the
244 // hi+1 face. geom.domain is the GLOBAL domain (System's PolarGeometry covers the whole annulus,
BoxArray: the set of boxes tiling a level (disjoint, covering).
const std::vector< Box2D > & boxes() const
View on the underlying vector (element-by-element equality = same boxes AND same order).
Definition box_array.hpp:46
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
Field distributed over a level: decomposition (BoxArray) + distribution (DistributionMapping) + ncomp...
Definition multifab.hpp:33
Fab2D & fab(int li)
Local fab at index li (0 <= li < local_size()), for writing.
Definition multifab.hpp:67
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
int local_size() const
Number of fabs OWNED by this rank (bound on local indices).
Definition multifab.hpp:65
PolarHasGeomSource<M>: internal concept – true if M exposes polar_geom_source(u, r) -> State.
Definition polar_operator.hpp:85
PolarHasSource<M>: internal concept – true if M exposes source(U, aux) -> State.
Definition polar_operator.hpp:61
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...
Geometry: index-space (Box2D) <-> Cartesian physical-space mapping; PolarGeometry: SIBLING for a glob...
MultiFab: a field DISTRIBUTED over a level (equivalent of AMReX's MultiFab).
POPS_HD Model::State polar_geom_source(const Model &m, const typename Model::State &u, Real r)
polar_geom_source<Model>: returns m.polar_geom_source(u, r) if PolarHasGeomSource<Model>,...
Definition polar_operator.hpp:93
POPS_HD Model::State polar_source(const Model &m, const typename Model::State &u, const Aux &a)
polar_source<Model>: returns m.source(u, a) if PolarHasSource<Model>, otherwise the zero state.
Definition polar_operator.hpp:69
Definition amr_hierarchy.hpp:29
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
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 assemble_rhs_polar(const Model &model, const MultiFab &U, const MultiFab &aux, const PolarGeometry &geom, MultiFab &R, bool recon_prim=false, bool wall_radial=false, Real pos_floor=Real(0))
assemble_rhs_polar<Limiter, NumericalFlux>: R = -div_polar F* + S on a PolarGeometry.
Definition polar_operator.hpp:230
Box2D xface_box(const Box2D &v)
xface_box / yface_box: face boxes normal to x (resp.
Definition face_flux.hpp:147
Single-interface numerical flux policies: Rusanov, HLL, HLLC, Roe.
Interface reconstruction policies: MUSCL limiters and WENO5-Z.
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
POINTWISE auxiliary fields shared with the physics: single coupling channel.
Definition state.hpp:123
READ-only handle (const counterpart of Array4): same layout and same contract (POD device-copyable,...
Definition fab2d.hpp:44
Definition geometry.hpp:59
Box2D domain
nx() = nr (radial cells), ny() = ntheta (azimuthal cells)
Definition geometry.hpp:60
PolarAssembleRhsKernel: device kernel of the polar residual in cell (i,j).
Definition polar_operator.hpp:187
POPS_HD void operator()(int i, int j) const
Definition polar_operator.hpp:192
Definition polar_operator.hpp:111
POPS_HD void operator()(int i, int j) const
Definition polar_operator.hpp:130
Real pos_floor
Zhang-Shu positivity limiter (<= 0: inactive, bit-identical)
Definition polar_operator.hpp:128
int pos_comp
component of the Density role (resolved by the host caller)
Definition polar_operator.hpp:129
PolarFaceFluxThetaKernel: device kernel of the flux at the azimuthal face j.
Definition polar_operator.hpp:158
int pos_comp
component of the Density role (resolved by the host caller)
Definition polar_operator.hpp:166
POPS_HD void operator()(int i, int j) const
Definition polar_operator.hpp:167
Real pos_floor
Zhang-Shu positivity limiter (<= 0: inactive, bit-identical)
Definition polar_operator.hpp:165
Base scalar types and the POPS_HD macro (host+device portability).
Generated by