include/pops/numerics/spatial/primitives/wave_speed.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
|
wave_speed.hpp
Go to the documentation of this file.
109inline void max_wave_speed_hotspot_mf(const Model& model, const MultiFab& U, const MultiFab& aux,
209inline Real max_source_frequency_mf(const Model& model, const MultiFab& U, const MultiFab& aux) {
237// The HLL flux bounds each face by the signal speeds of BOTH adjacent cells (Davis estimates, cf.
238// hll_speeds). The default path recalls model.wave_speeds per face: for a model whose wave speeds are
239// expensive (moment hierarchy + factorizations at each call), wave_speeds is recomputed several times
240// per cell and per RK stage. This OPT-IN path evaluates wave_speeds ONCE per cell and per direction in
241// a scratch (4 components lo_x/hi_x/lo_y/hi_y), then assembles the residual by reading the scratch: the
242// face speed at i-1/2 becomes min/max of the signed speeds of the two neighbor cells (union over the
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 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
Parallel seam: minimal MPI abstraction (rank/size + collectives) with serial fallback.
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...
MultiFab: a field DISTRIBUTED over a level (equivalent of AMReX's MultiFab).
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
void max_wave_speed_hotspot_mf(const Model &model, const MultiFab &U, const MultiFab &aux, int nx, Real &w_out, int &i_out, int &j_out)
dt_hotspot diagnostic (ADC-182): the cell (GLOBAL indices) that dominates the block's transport CFL b...
Definition wave_speed.hpp:109
Real min_stability_dt_mf(const Model &model, const MultiFab &U, const MultiFab &aux)
Global min of the declared admissible step (HasStabilityDt trait), via max(1/dt) (cf.
Definition wave_speed.hpp:222
Real reduce_max_cell(const Box2D &b, F f)
MAX reduction with a REDUCING FUNCTOR: f receives (i, j, Real& acc) and updates acc,...
Definition for_each.hpp:240
Real max_source_frequency_mf(const Model &model, const MultiFab &U, const MultiFab &aux)
Global max of the source frequency (HasSourceFrequency trait). 0 if the source does not constrain.
Definition wave_speed.hpp:209
void fill_wave_speed_cache(const Model &model, const MultiFab &U, const MultiFab &aux, MultiFab &cache)
fill_wave_speed_cache: fills the per-cell wave speed scratch (lo_x, hi_x, lo_y, hi_y).
Definition wave_speed.hpp:277
Real max_stability_speed_mf(const Model &model, const MultiFab &U, const MultiFab &aux)
Global max of the STABILITY speed (HasStabilitySpeed trait) – counterpart of max_wave_speed_mf.
Definition wave_speed.hpp:197
Real max_wave_speed_mf(const Model &model, const MultiFab &U, const MultiFab &aux)
max_wave_speed_mf: global max of the wave speed over the whole MultiFab (CFL).
Definition wave_speed.hpp:66
Pointwise types of the physics layer: StateVec<N> (conserved state) and Aux (auxiliary fields from th...
Model/state/aux access layer of the Cartesian spatial operator.
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
Box2D grow(int n) const
Grows the box by n cells in ALL directions (uniform ghost layer).
Definition box2d.hpp:69
READ-only handle (const counterpart of Array4): same layout and same contract (POD device-copyable,...
Definition fab2d.hpp:44
InvStabilityDtKernel: max over cells of 1/model.stability_dt.
Definition wave_speed.hpp:179
POPS_HD void operator()(int i, int j, Real &acc) const
Definition wave_speed.hpp:182
MaxWaveSpeedKernel<Model>: device reduction functor for max_wave_speed_mf.
Definition wave_speed.hpp:38
POPS_HD void operator()(int i, int j, Real &acc) const
Definition wave_speed.hpp:41
SourceFrequencyKernel: max over cells of model.source_frequency (mu >= 0, 1/s).
Definition wave_speed.hpp:162
POPS_HD void operator()(int i, int j, Real &acc) const
Definition wave_speed.hpp:165
StabilitySpeedKernel: max over cells/directions of model.stability_speed (replaces MaxWaveSpeedKernel...
Definition wave_speed.hpp:146
POPS_HD void operator()(int i, int j, Real &acc) const
Definition wave_speed.hpp:149
WaveSpeedCacheKernel: evaluates model.wave_speeds per cell in both directions and stores (lo_x,...
Definition wave_speed.hpp:251
POPS_HD void operator()(int i, int j) const
Definition wave_speed.hpp:255
Locates the cell DOMINATING the CFL (dt_hotspot diagnostic, ADC-182): EQUALITY scan of the recomputed...
Definition wave_speed.hpp:83
POPS_HD void operator()(int i, int j, Real &acc) const
Definition wave_speed.hpp:88
Base scalar types and the POPS_HD macro (host+device portability).
Generated by