pops Namespace ReferenceΒΆ

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

Namespaces

namespace  compiled_block
 
namespace  detail
 
namespace  dynlib
 
namespace  field_solver
 
namespace  native_loader
 
namespace  runtime
 
namespace  stepper
 
namespace  validation
 

Classes

struct  AmrAdvanceFacesKernel
 Device-clean NAMED functor: U <- U - dt div(Fx,Fy) on a valid cell. More...
 
struct  AmrApplySourceKernel
 Device-clean NAMED functor (template Model, see AmrSspRhsKernel): U <- U + dt S(U, aux) on a valid cell. More...
 
struct  AmrAverageDownKernel
 Device-clean NAMED functor: 2x2 average fine -> coarse on a coarse cell. More...
 
struct  AmrBuildParams
 Frozen parameters passed to the deferred build of the compiled path (add_compiled_model). More...
 
struct  AmrCompiledHooks
 Type-erased closures of a compiled AMR block, produced by amr_dsl_block::build_amr_compiled and installed via AmrSystem::set_compiled_block. More...
 
class  AmrCondensedSchurSourceStepper
 Schur-condensed SOURCE stage over an AMR hierarchy. More...
 
class  AmrCouplerMP
 Multi-patch E x B AMR coupler. More...
 
struct  AmrDiscLF
 Bundle (limiter, Riemann flux) expected by AmrCouplerMP::step<Disc>. More...
 
class  AmrHierarchy
 Stack of refined levels (domain + BoxArray + MultiFab per level), level 0 the coarsest. More...
 
struct  AmrHierarchyLayout
 Single source of truth on the GRID shared by all blocks: per level the BoxArray (boxes AND order), the DistributionMapping (rank per box) and dx/dy. More...
 
struct  AmrImplicitSourceStepper
 Default implicit callback for AmrSystemCoupler::step: backward-Euler (Newton) on the model source, applied to EACH level of the hierarchy, followed by a fine -> coarse cascade (coverage consistency, cf. More...
 
struct  AmrLevelMP
 
class  AmrLevelStack
 Owns the AMR level stack and the parallel aux stack. More...
 
class  AmrRuntime
 AMR multi-block engine at runtime. More...
 
struct  AmrRuntimeBlock
 Type-erased closures of ONE AMR block, placed on the shared hierarchy. More...
 
struct  AmrSspRhsKernel
 
class  AmrSystem
 Single block carried on an AMR hierarchy, composed at runtime. More...
 
struct  AmrSystemConfig
 AMR mesh and cadence (per-block physical parameters live in the ModelSpec). More...
 
class  AmrSystemCoupler
 Multi-species system coupler on AMR. More...
 
struct  ArenaStats
 ManagedArena pool statistics: hits/misses/fences and retained bytes. More...
 
struct  Array4
 WRITE POD handle (raw pointer + strides) over a Fab2D buffer, indexed by (i, j, c) IN GLOBAL INDICES (ig0/jg0 = lower corner of the grown box). More...
 
struct  Aux
 POINTWISE auxiliary fields shared with the physics: single coupling channel. More...
 
struct  AuxHaloPolicy
 Per-field aux halo policy (ADC-369): a UNIFORM boundary policy for ONE model-named aux component, declared via pops.AuxHalo. More...
 
struct  BackgroundDensity
 Neutralizing background f = alpha (n - n0). More...
 
struct  BCRec
 Boundary conditions for the FOUR faces of the domain (type + associated Dirichlet value). More...
 
struct  BlockClosures
 Compiled block closures, frozen at add time. More...
 
struct  Box2D
 2D integer index space, cell-centered. More...
 
class  BoxArray
 Ordered list of boxes tiling a level. More...
 
class  BoxHash
 Spatial index of a BoxArray's boxes via a bin grid. More...
 
struct  ChargeDensity
 Charge density f = q n. More...
 
struct  ChargeDensityRhs
 N-species Poisson RHS: f = Sum_s q_s n_s over ALL blocks of the system. More...
 
struct  ClusterParams
 Berger-Rigoutsos clustering parameters (configuration object). More...
 
struct  CoarseFineInterface
 
class  CompositeFacPoisson
 2-level COMPOSITE FAC Poisson solver (scalar). More...
 
struct  CompositeModel
 Composite physical model: one HYPERBOLIC brick + one source + one elliptic right-hand side. More...
 
struct  CompositeSource
 SUM of two source bricks: S(U, aux) = A.apply(U, aux) + B.apply(U, aux). More...
 
class  CondensedSchurSourceStepper
 Schur-condensed SOURCE STAGE, STANDALONE (transport frozen), GENERIC over any fluid block that exposes the Density / MomentumX / MomentumY roles (+ optional Energy). More...
 
struct  ConstArray4
 READ-only handle (const counterpart of Array4): same layout and same contract (POD device-copyable, global indices, no bounds checking). More...
 
struct  CoupledFreqKernel
 
struct  CoupledSourceKernel
 Device functor applying ONE coupled source over a box: captures the PODs by VALUE (input/output Array4, programs, constants) -> device-clean. More...
 
struct  CoupledSourceProgram
 BYTECODE description of a generic inter-species COUPLED SOURCE (cf. More...
 
struct  CoupledSystem
 Heterogeneous collection of equation blocks, parameterized by their exact types. More...
 
class  Coupler
 Single-block hyperbolic-elliptic coupler. More...
 
struct  CoverageMask
 
struct  CsProgram
 Fixed-capacity postfix program (POD device-copyable): len opcodes, arg read only by PushReg (register index). More...
 
class  DistributedFFTSolver
 DIRECT periodic Poisson solver (spectral FFT) DISTRIBUTED, models EllipticSolver. More...
 
class  DistributionMapping
 Owning MPI rank of each box, indexed by GLOBAL box index (parallel to a BoxArray). More...
 
struct  EigBounds
 Result of real_eig_minmax: real-part extremes + diagnostic. More...
 
class  ElectrostaticLorentzCondensation
 GENERIC builder of the condensed source stage for the electrostatic + Lorentz source (kind="electrostatic_lorentz" on the future Python facade side, PR5). More...
 
struct  EllipticProblem
 
struct  EllipticTag
 Builtin ELLIPTIC right-hand-side brick tag. More...
 
struct  EquationBlock
 Association of a PhysicalModel with its field U (MultiFab), its spatial scheme, its time policy and its boundary conditions. More...
 
struct  Euler
 2D compressible Euler for an ideal gas: HYPERBOLIC brick (HyperbolicModel concept). More...
 
struct  ExBVelocity
 Scalar advection by the E x B drift: v = (-d_y phi, d_x phi)/B0 (divergence-free). More...
 
struct  ExBVelocityPolar
 Scalar advection by the E x B drift in POLAR coordinates (r, theta) – "annular polar grid" effort, Phase 1. More...
 
class  Fab2D
 Single-grid data on a Box2D: VALID box + ng ghost layers, ncomp components, component-slow layout. More...
 
struct  FieldPostProcess
 
struct  FluxRegister
 
struct  ForwardEuler
 
class  GeometricMG
 
struct  Geometry
 Cartesian geometry of a level: index domain + physical bounds [xlo, xhi] x [ylo, yhi]. More...
 
struct  GravityCoupling
 Self-consistent coupling f = sign * 4piG * (rho - rho0). More...
 
struct  GravityForce
 Gravitational force rho g (+ work if 4 variables). More...
 
struct  GridContext
 Mesh + transport BC + aux shared by a block closures. More...
 
struct  HaloExchange
 Opaque state of an in-flight halo exchange, returned by fill_boundary_begin and consumed by fill_boundary_end. More...
 
struct  HaloJob
 One halo copy/transfer: the ghost region of box dst is filled from the shifted valid region of box src (shift sx, sy in cells for the periodic wrap; 0 for an interior neighbor). More...
 
struct  HaloSchedule
 Memoized schedule for ONE (Periodicity, domain) over a fixed layout. More...
 
class  HaloScheduleCache
 Small per-MultiFab cache of halo schedules, one entry per distinct (Periodicity, domain). More...
 
struct  HLLCFlux
 HLLCFlux (HLL + Contact wave, Toro): 3 waves, resolves the contact discontinuity. More...
 
struct  HLLFlux
 HLLFlux (Harten-Lax-van Leer): 2 signal speeds, less diffusive than Rusanov. More...
 
struct  IModel
 Hyperbolic model seen behind a virtual interface (runtime dispatch). More...
 
struct  ImplicitMask
 
struct  ImplicitSourceStepper
 
struct  IsothermalFlux
 ISOTHERMAL Euler flux (p = cs2 rho), 3 variables (rho, rho u, rho v). More...
 
struct  IsothermalFluxPolar
 ISOTHERMAL Euler flux in POLAR geometry (ring r, theta), 3 variables (rho, rho v_r, rho v_theta) – "polar fluid grid" effort, Path A step 1. More...
 
struct  KrylovResult
 Outcome of a Krylov solve: iterations performed, final relative residual, convergence flag. More...
 
struct  LevelHierarchy
 
struct  LimiterTag
 Tag of a reconstruction LIMITER: user-facing name + halo width (n_ghost) required by its stencil. More...
 
struct  LorentzEliminator
 LorentzEliminator: operator B = [[1,-w],[w,1]] and its analytic inverse. More...
 
struct  MagneticLorentzForce
 MAGNETIC Lorentz force q (v x B) on momentum, field B = B_z z_hat out of plane. More...
 
struct  Minmod
 minmod limiter: TVD (Total Variation Diminishing), 2 ghosts, order 2 in smooth regions. More...
 
struct  ModelAdapter
 Adapts a STATIC model M into IModel<M::n_vars>. More...
 
struct  ModelSpec
 Brick composition of a block plus parameters. More...
 
struct  ModuleCapabilities
 The STATIC transport capabilities the built _pops module provides (Spec 5 sec.13.12). More...
 
class  MultiFab
 Field distributed over a level: decomposition (BoxArray) + distribution (DistributionMapping) + ncomp components + ngrow ghosts. More...
 
struct  NewtonCellStat
 OUTPUT statistic of the Newton of ONE cell (device POD, written into the diagnostics scratch): res = ||F||_inf at exit; iters = iterations consumed; failed = 1 if the cell failed (non-finite residual, degenerate/non-finite pivot, or active tolerance not reached within budget), 0 otherwise; comp = index of the conserved COMPONENT carrying the max residual at exit (-1 if nothing implicit). More...
 
struct  NewtonOptions
 Options of the local Newton of the implicit source (backward-Euler). More...
 
struct  NewtonReport
 AGGREGATED report (whole block, all substeps of one advance) of the implicit-source Newton. More...
 
struct  NoCoupledSource
 NULL coupling source (default): apply() is a no-op. More...
 
struct  NoSlope
 First-order reconstruction (piecewise constant): zero slope, 1 ghost. More...
 
struct  NoSource
 No source: S(U, aux) = 0. More...
 
struct  OncePerStepCoupling
 Tag: solves the elliptic problem ONCE per step (aux frozen during the stages, cheaper). More...
 
struct  PatchBox
 INDEX-SPACE footprint of an AMR fine patch, exposed to Python by AmrSystem::patch_boxes(). More...
 
struct  PatchRange
 
struct  Periodicity
 Per-direction periodicity: halo wrapping in x and/or y during the exchange (false = open edge, left to the physical BCs). More...
 
struct  PerStageCoupling
 Tag: solves the elliptic problem at EVERY RK stage (aux follows the intermediate state, more precise). More...
 
class  PoissonFFT
 
class  PoissonFFTSolver
 
class  PolarCondensedSchurSourceStepper
 SOURCE STAGE condensed by Schur in POLAR geometry, STANDALONE (transport frozen), GENERIC over any polar fluid block that exposes the roles Density / MomentumX (radial) / MomentumY (azimuthal) (+ optional Energy). More...
 
struct  PolarGeometry
 
struct  PolarGridContext
 POLAR mesh + transport BC + aux shared by a block's closures (counterpart of GridContext). More...
 
struct  PolarKrylovResult
 Result of a polar BiCGStab solve: iterations, relative residual, convergence. More...
 
class  PolarPoissonSolver
 
class  PolarTensorKrylovSolver
 MATRIX-FREE BiCGStab Krylov solver for the FULL-tensor POLAR elliptic operator L_int(phi) = div(A grad phi), A = [[a_rr, a_rt], [a_tr, a_tt]] possibly NON symmetric. More...
 
struct  PotentialForce
 Electrostatic potential force (q/m) rho E on momentum (+ work on energy if 4 variables). More...
 
struct  RegMP
 
struct  RegridParams
 Regrid parameters (configuration object). More...
 
class  RemappedFFTSolver
 DIRECT periodic Poisson solver (spectral FFT) under MPI, presenting the SYSTEM LAYOUT, models EllipticSolver (ADC-287). More...
 
struct  RiemannTag
 Tag of a Riemann FLUX: name + model CAPABILITY needs (DOCUMENTARY: the real guard is an if constexpr per model at the call-site – these flags do NOT drive the dispatch, they document the contract and serve the tests). More...
 
struct  RoeFlux
 RoeFlux: Roe linearization + Harten entropy fix (acoustic waves). More...
 
struct  RuntimeParams
 FLAT carrier (fixed size, by value) of the runtime parameter values of a block. More...
 
struct  RusanovFlux
 RusanovFlux (local Lax-Friedrichs): robust flux, compatible with any minimal PhysicalModel. More...
 
struct  SchurCondensationOperator
 Result of the Schur assembly: the coefficient MultiFab of the tensor operator A_op and the condensed right-hand side. More...
 
struct  SingleModelEllipticRhs
 SINGLE-model RHS assembler: rhs(.,.,0) = model.elliptic_rhs(U) over the valid cells. More...
 
struct  SourceFreeModel
 SourceFreeModel<M>: adapter that cancels the source of M (explicit IMEX half-step). More...
 
struct  SourceStageOptions
 Settings of the Schur-condensed SOURCE STAGE (cf. More...
 
struct  SourceTag
 Builtin SOURCE brick tag. More...
 
struct  SpatialDiscretisation
 SpatialDiscretisation<LimiterT, NumericalFluxT>: tag-type bundling the reconstruction policy and the numerical flux policy into a single template parameter. More...
 
struct  SpeciesCharge
 Charge (with sign) and density component of a species for the elliptic RHS assembly. More...
 
struct  SSPRK2
 
struct  SSPRK2Step
 
struct  SSPRK3
 
struct  SSPRK3Step
 
struct  StateVec
 Conserved state vector of fixed size, known at compile time. More...
 
struct  SubcyclingSchedule
 
class  System
 Coupled multi-species system, composed at runtime from generic bricks. More...
 
class  SystemAssembler
 ASSEMBLES the fields (system Poisson + shared aux) and a block residual evaluator. More...
 
class  SystemBlockStore
 ORDERED registry of the System blocks + state marshaling helpers. More...
 
struct  SystemConfig
 Mesh and domain shared by all blocks (physical parameters are per block, in the ModelSpec). More...
 
class  SystemDriver
 ADVANCES the system: carries the schedule (per-species subcycling, adaptive multirate, implicit/IMEX delegated) and calls a TimeStepper. More...
 
struct  TagBox
 Dense grid of 0/1 markers over a box, input to Berger-Rigoutsos clustering. More...
 
class  TensorKrylovSolver
 
struct  TimePolicy
 
struct  TimePolicyTraits
 
struct  TimePolicyTraits< TimePolicy< MethodT, TreatmentT, SubstepsT, StrideT > >
 
struct  TransportTag
 Builtin TRANSPORT brick tag. More...
 
struct  TwoBlockChargeDensityRhs
 Two-block RHS: same computation as TwoFieldChargeDensityRhs but reads blocks 0 and 1 of a CoupledSystem (q0 n0 + q1 n1). More...
 
struct  TwoFieldChargeDensityRhs
 Two-field RHS: rhs = q0 * U0(.,.,comp0) + q1 * U1(.,.,comp1) (two-species charge density). More...
 
struct  UserTimeIntegrator
 
struct  VanLeer
 van Leer limiter: smooth, 2 ghosts, better order at extrema than Minmod. More...
 
struct  Variable
 A variable: name, physical role, component index in the state. More...
 
struct  VariableSet
 A model's variable set: kind (cons/prim), names, size, canonical roles (optional, parallel to names; absent -> Custom), and user_roles (optional string labels parallel to names, for components whose role is OUTSIDE the canonical enum). More...
 
struct  Weno5
 WENO5 tag policy: marks the stencil at 3 ghosts, delegates to weno5z. More...
 

Concepts

concept  CoupledSystemLike
 Minimal concept for coupled systems: n_blocks and for_each_block with a named functor.
 
concept  EquationBlockLike
 Minimal concept for equation blocks: Model, Spatial, Time, name, state, U().
 
concept  PhysicalModel
 Minimal contract of a physical model.
 
concept  HasStabilitySpeed
 OPTIONAL trait: stability speed lambda* replacing max_wave_speed in the block CFL.
 
concept  HasSourceFrequency
 OPTIONAL trait: local source frequency mu [1/s] (bound dt <= cfl / max mu, without h).
 
concept  HasStabilityDt
 OPTIONAL trait: direct admissible step per cell (bound dt <= min stability_dt, without cfl).
 
concept  HasPointwiseProjection
 Trait OPTIONNEL : PROJECTION PONCTUELLE post-pas U -> project(U, aux) (ADC-177).
 
concept  HasPrimitiveVars
 OPTIONAL extension of a PhysicalModel: primitive variables + cons<->prim conversions.
 
concept  HyperbolicPhysicalModel
 Hyperbolic brick of a model: flux + wave speed + variables + cons<->prim conversions.
 
concept  HyperbolicModel
 Old name (compat): HyperbolicPhysicalModel used to be HyperbolicModel.
 
concept  CoupledSourceFor
 Concept: C is a valid coupling source for System if System is a CoupledSystem and if C exposes apply(System&, const MultiFab& aux, Real dt) (updates the blocks over the step dt).
 
concept  EllipticOperator
 
concept  LinearSolver
 
concept  FieldPostProcessor
 
concept  EllipticSolver
 
concept  PolarEllipticSolver
 
concept  PolarLinearSolver
 Contract of the iterative POLAR elliptic operators: same shape as PolarEllipticSolver (cf.
 
concept  HasHLLCStructure
 HLLC capability: the model provides the CONTACT wave speed and the STAR STATE on side k.
 
concept  HasRoeDissipation
 Roe capability: the model provides its FULL Roe dissipation d = |A_roe(UL, UR)| (UR - UL) – Roe average, wave decomposition, entropy fix included (these are properties of the physical system, not the core).
 
concept  SpatialDiscretisationLike
 SpatialDiscretisationLike: concept validating a SpatialDiscretisation.
 
concept  LevelSetDomain
 
concept  DiffusiveModel
 DiffusiveModel: optional concept for models with isotropic scalar diffusion.
 
concept  ImplicitBlockStepper
 
concept  PartiallyImplicitModel
 
concept  HasSourceJacobian
 
concept  TimeStepper
 

Typedefs

template<class T >
using fab_allocator = std::allocator< T >
 
template<class T >
using comm_allocator = std::allocator< T >
 
using Real = double
 
using Variables = VariableSet
 Old name (compat): VariableSet used to be Variables. Kept for existing and generated code.
 
template<CoupledSystemLike System, class RhsAssembler , class Elliptic = GeometricMG>
using AmrSystemDriver = AmrSystemCoupler< System, RhsAssembler, Elliptic >
 
template<CoupledSystemLike System, class RhsAssembler , class Elliptic = GeometricMG>
using SystemCoupler = SystemDriver< System, RhsAssembler, Elliptic >
 
using ApplyFn = std::function< void(MultiFab &out, const MultiFab &in)>
 Matrix-free operator callback: out <- A(in).
 
using cplx = std::complex< double >
 
using EulerHLLCFlux2D = HLLCFlux
 VALIDITY-DOMAIN aliases naming the canonical Euler 2D fallback (n_vars == 4, rho/m_x/m_y/E layout, ideal-gas pressure).
 
using EulerRoeFlux2D = RoeFlux
 
using FirstOrder = SpatialDiscretisation< NoSlope, RusanovFlux >
 
using MusclMinmod = SpatialDiscretisation< Minmod, RusanovFlux >
 
using MusclVanLeer = SpatialDiscretisation< VanLeer, RusanovFlux >
 
using MusclVanLeerHLLC = SpatialDiscretisation< VanLeer, HLLCFlux >
 
using OwnershipPolicy = DistributionMapping
 
template<class MethodT = SSPRK2, int SubstepsT = 1, int StrideT = 1>
using ExplicitTime = TimePolicy< MethodT, TimeTreatment::Explicit, SubstepsT, StrideT >
 
template<class MethodT = UserTimeIntegrator, int SubstepsT = 1, int StrideT = 1>
using ImplicitTime = TimePolicy< MethodT, TimeTreatment::Implicit, SubstepsT, StrideT >
 
template<class MethodT = UserTimeIntegrator, int SubstepsT = 1, int StrideT = 1>
using IMEXTime = TimePolicy< MethodT, TimeTreatment::IMEX, SubstepsT, StrideT >
 
using PrescribedTime = TimePolicy< UserTimeIntegrator, TimeTreatment::Prescribed, 1, 1 >
 
using CompressibleFlux = Euler
 Compressible 2D Euler flux (reuses Euler: gamma, pressure, signed wave speeds).
 
using AmrCompiledBlockBuilder = std::function< AmrRuntimeBlock(const detail::SharedAmrLayout &layout, const std::string &name, const std::vector< double > &density, bool has_density, double gamma, int substeps, bool recon_prim, bool imex, int stride, const std::vector< std::string > &implicit_vars, const std::vector< std::string > &implicit_roles, double pos_floor)>
 DEFERRED builder of a COMPILED block on the multi-block hierarchy: receives the SHARED layout (created ONCE at lazy build, common to all blocks) plus the block parameters frozen at add time (name, initial density, gamma, substeps/stride, recon/imex, partial IMEX mask resolved into component indices), and returns the type-erased AmrRuntimeBlock of the block (captures the CONCRETE Model/Limiter/Flux via detail::dispatch_amr_block, the kernel stays COMPILED).
 

Enumerations

enum class  VariableKind { Conservative , Primitive }
 Kind of a variable set: conserved (U) or primitive (W). More...
 
enum class  VariableRole {
  Density , MomentumX , MomentumY , MomentumZ ,
  Energy , VelocityX , VelocityY , VelocityZ ,
  Pressure , Temperature , Scalar , Custom
}
 PHYSICAL role of a component. More...
 
enum class  CsOp : int {
  PushReg = 0 , Add = 1 , Sub = 2 , Mul = 3 ,
  Div = 4 , Neg = 5 , Pow = 6 , Sqrt = 7
}
 Opcodes of the postfix stack machine. More...
 
enum class  PoissonCadence { OncePerStep , PerSubstep }
 Re-solve frequency of the Poisson on AMR: OncePerStep (phi solved once per macro-step, frozen during the advance; cheapest); PerSubstep (phi re-solved before each species substep, more faithful for a field-driven transport, more expensive). More...
 
enum class  BCType { Periodic , Foextrap , Dirichlet }
 Boundary condition type for a face: Periodic (handled by fill_boundary), Foextrap (zero gradient, outflow/order-0 wall), Dirichlet (value imposed at the face by reflection). More...
 
enum class  PolarPrecond { Jacobi , RadialLine }
 Choice of the SIMPLE BiCGStab PRECONDITIONER (NO MG V-cycle – stagnation on polar 1/r^2, cf. More...
 
enum class  Spectrum : int { kReal = 0 , kComplexPair = 1 , kUnknown = 2 }
 Tri-state classification of a small block's spectrum (ADC-276), returned by pops::real_spectrum. More...
 
enum class  AmrTimeMethod : int { kEuler = 0 , kSsprk3 = 1 }
 
enum class  TimeTreatment { Explicit , Implicit , IMEX , Prescribed }
 
enum class  GeometryMode { None , Staircase , CutCell }
 TRANSPORT GEOMETRY MODE of the macro-step (T5-PR3 effort, disc wiring in System::step). More...
 
enum class  CapabilityTarget { kModule , kProduction , kAot }
 The lowering route whose static capabilities are queried. More...
 

Functions

void require_supported_ref_ratio (int ratio)
 Validates a requested AMR refinement ratio at the hierarchy boundary.
 
template<class Crit >
TagBox tag_cells (const MultiFab &mf, const Box2D &domain, Crit crit)
 Marks the valid cells where the predicate is true, on a TagBox covering the domain.
 
TagBox grow_tags (const TagBox &in, int n, const Box2D &domain)
 Grows the tags by n cells (square neighborhood), staying within the domain.
 
template<class Crit >
void regrid_level (AmrHierarchy &h, int coarse_lev, Crit crit, const RegridParams &rp={})
 (Re)builds level coarse_lev+1 from the tagging of level coarse_lev.
 
std::vector< Box2Dberger_rigoutsos (const TagBox &tags, const ClusterParams &p={})
 Cluster a TagBox into boxes covering the tagged cells (Berger-Rigoutsos), then final chop.
 
TagBox tag_union (const std::vector< TagBox > &parts)
 Union (cell-by-cell logical OR) of several TagBox sharing EXACTLY the same box.
 
ArenaStats arena_stats ()
 
void device_fence ()
 Device barrier: waits for in-flight kernels to finish before a HOST access to unified memory.
 
template<EquationBlockLike... Blocks>
 CoupledSystem (Blocks...) -> CoupledSystem< Blocks... >
 
template<class M >
POPS_HD constexpr int aux_comps ()
 Width of the aux channel a model CONSUMES.
 
constexpr int aux_canonical_index (std::string_view name)
 Component of the CANONICAL aux field name, or -1 if name is not a canonical field (it may then be a model-NAMED field, resolved per block by the facade).
 
constexpr std::string_view aux_canonical_name (int comp)
 Inverse: CANONICAL name of component comp, or an empty view if comp is not a canonical component (e.g.
 
VariableRole role_from_name (const std::string &s)
 Forward declaration: VariableSet::index_of(const std::string&) resolves a canonical role NAME via role_from_name (defined below) before matching a user-defined role label.
 
const char * role_name (VariableRole r)
 Human-readable name of a role (introspection, Python binding).
 
std::string names_csv (const VariableSet &vs)
 CSV of a VariableSet's names (separator ',').
 
std::string roles_csv (const VariableSet &vs)
 CSV of a VariableSet's roles (role_name, separator ',').
 
void parse_roles_into (VariableSet &vs, const std::string &csv)
 Inverse of roles_csv: fill vs.roles (and vs.user_roles for any NON-canonical token) from a roles CSV.
 
int coupling_role_index (const VariableSet &vs, VariableRole role, int fallback, const char *origin, const std::string &block)
 Resolve a REQUIRED canonical role to its component in vs, for a NAMED coupling (add_collision / add_thermal_exchange / ionization) that historically targeted the canonical layout.
 
template<class Model >
std::string var_names_meta ()
 A model's "names" metadata: "cons_csv|prim_csv" (separator '|' between the two sets).
 
template<class Model >
std::string roles_meta ()
 A model's "roles" metadata: "cons_roles_csv|prim_roles_csv" (empty side = roles not provided).
 
Real amr_mass_mb (const MultiFab &coarse, Real dx, Real dy)
 LOCAL mass: sum of u(.,.,0) * dx * dy over the valid cells of ALL local fabs, WITHOUT MPI reduction (the caller decides whether to all_reduce).
 
Real amr_max_drift_speed_mb (const MultiFab &aux0, Real B0)
 LOCAL max drift speed: max of |grad phi| / B0 (aux comp 1, 2 = grad phi) over the valid cells, WITHOUT floor (applied by the caller) nor MPI reduction.
 
Real amr_mass (const MultiFab &coarse, const Box2D &dom, Real dx, Real dy)
 Mono-box mass: degenerate case of amr_mass_mb (bit for bit). dom is ignored (kept for the API).
 
Real amr_max_drift_speed (const MultiFab &aux0, const Box2D &dom, Real B0)
 Mono-box max drift speed + floor 1e-12 (CFL guard). dom ignored (kept for the API).
 
std::pair< BoxArray, DistributionMappingregrid_compute_fine_layout (TagBox grown, const Box2D &pdom, int pk, int margin, bool coarse_replicated=true)
 Compute the fine layout (BoxArray + DistributionMapping) of a Berger-Rigoutsos regrid from the grown tags ALREADY dilated (grow_tags) on the PARENT domain pdom.
 
MultiFab regrid_field_on_layout (const BoxArray &fb, const DistributionMapping &dmap, const MultiFab &par, const MultiFab &old, int pk, int ngf, bool coarse_replicated=true)
 Rebuild ONE fine MultiFab on the IMPOSED layout fb / dmap (the same one for all blocks in multi-block): (a) piecewise-constant interpolation from the parent par where the new patch is not covered by the old fine, (b) carry-over of the existing fine data old where the old patch covers the new one.
 
template<class Crit >
void amr_regrid_finest (std::vector< AmrLevelMP > &L, std::vector< MultiFab > &aux, const Box2D &dom, Crit crit, int grow, int margin, int aux_ncomp=kAuxBaseComps, bool coarse_replicated=true)
 Regrid the finest level (L.back()) by Berger-Rigoutsos on the criterion crit applied to the parent: rebuilds the patches (fine data carry-over otherwise parent interp) + the aux.
 
void add_scaled_component (const MultiFab &U, Real q, int comp, MultiFab &rhs)
 rhs(.,.,0) += q * U(.,.,comp) over the valid cells.
 
template<class... Args>
auto make_system_coupler (Args &&... args)
 
HaloExchange fill_boundary_begin (MultiFab &mf, const Box2D &domain, Periodicity per={})
 Phase 1 (non-blocking): does the LOCAL halo copies and posts the Isend/Irecv of the distant halos.
 
void fill_boundary_end (MultiFab &mf, HaloExchange &h)
 Phase 2 (blocking): MPI_Waitall on the transfers posted by begin, then unpacks the received buffers into the ghosts.
 
void fill_boundary (MultiFab &mf, const Box2D &domain, Periodicity per={})
 BLOCKING halo exchange: begin then end immediately (no overlap).
 
std::int64_t halo_schedule_build_count ()
 Number of times fill_boundary has BUILT (enumerated) a halo schedule.
 
void reset_halo_schedule_build_count ()
 Resets the build counter (tests).
 
void fill_physical_bc_range (MultiFab &mf, const Box2D &domain, const BCRec &bc, int c0, int c1)
 Fills the OUT-OF-domain ghosts of the NON-periodic faces of mf according to bc (Foextrap or Dirichlet), for the COMPONENT RANGE [c0, c1).
 
void fill_physical_bc (MultiFab &mf, const Box2D &domain, const BCRec &bc)
 Fills the physical-face ghosts of ALL components per bc (historical entry point, bit-identical).
 
void fill_physical_bc (MultiFab &mf, const Box2D &domain, const BCRec &bc, int comp)
 ADC-369: fills the physical-face ghosts of a SINGLE component comp per bc – the per-field aux halo override.
 
BCRec aux_halo_override (const BCRec &shared, const AuxHaloPolicy &p)
 Builds the effective override BCRec for a per-field aux halo: starts from the SHARED aux BC shared (so periodic faces stay periodic) and replaces each NON-PERIODIC face with the policy p (type + Dirichlet value).
 
void fill_ghosts (MultiFab &mf, const Box2D &domain, const BCRec &bc)
 COMPLETE ghost filling: fill_boundary (interior + periodic, periodicity deduced from bc) THEN fill_physical_bc (physical edges).
 
void sync_host ()
 Makes the HOST residency valid before a host access (read/write from the host).
 
void sync_device ()
 Marks a DEVICE residency (upcoming kernel).
 
template<class F >
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 / Cuda depending on the Kokkos install).
 
template<class F >
Real for_each_cell_reduce_sum (const Box2D &b, F f)
 SUM reduction of f(i, j) over box b.
 
template<class F >
Real for_each_cell_reduce_max (const Box2D &b, F f)
 MAX reduction of f(i, j) over box b.
 
template<class F >
Real reduce_max_cell (const Box2D &b, F f)
 MAX reduction with a REDUCING FUNCTOR: f receives (i, j, Real& acc) and updates acc, passed DIRECTLY to Kokkos::parallel_reduce without a wrapper lambda (device-clean path for a kernel instantiated cross-TU).
 
template<class F >
Real reduce_min_cell (const Box2D &b, F f)
 
template<class F >
Real reduce_sum_cell (const Box2D &b, F f)
 SUM reduction with a REDUCING FUNCTOR: f receives (i, j, Real& acc) and accumulates, passed DIRECTLY to Kokkos::parallel_reduce without a wrapper lambda (device-clean cross-TU path).
 
POPS_HD constexpr int floor_div (int a, int b)
 Integer division of a by b rounded down (handles a < 0 AND b < 0). POPS_HD constexpr (kernels).
 
int suggest_bin (const BoxArray &ba)
 Recommended bin size for a BoxArray: the largest box extent (at least 1), so that neighboring boxes fall into adjacent bins (memory / selectivity trade-off).
 
POPS_HD int coarsen_index (int a, int r)
 Index of the coarse cell containing the fine cell a (FLOOR division by r, handles a < 0).
 
BoxArray coarsen (const BoxArray &ba, int r)
 Coarsens each box of the BoxArray by a ratio r (coarsen box by box, order preserved).
 
void parallel_copy (MultiFab &dst, const MultiFab &src)
 Copies the valid regions that OVERLAP from src to dst (same indices, no shift).
 
void average_down (const MultiFab &fine, MultiFab &coarse, int r, MultiFab &cfine)
 CONSERVATIVE average fine -> coarse (ratio r): coarse(I, J) = average of the r^2 fine cells of the block.
 
void average_down (const MultiFab &fine, MultiFab &coarse, int r)
 
void interpolate (const MultiFab &coarse, MultiFab &fine, int r, MultiFab &cfine)
 Interpolation coarse -> fine (ratio r) by piecewise-CONSTANT injection: each fine cell (including the box ghosts) receives the value of its coarse cell (coarsen_index).
 
void interpolate (const MultiFab &coarse, MultiFab &fine, int r)
 
void saxpy (MultiFab &y, Real a, const MultiFab &x)
 y <- y + a x over ALL components of the valid cells. Identical layouts required.
 
Real norm_inf (const MultiFab &mf, int comp=0)
 Infinity norm max |f(.,.,comp)| over the valid cells (LOCAL, without MPI all_reduce).
 
void lincomb (MultiFab &z, Real a, const MultiFab &x, Real b, const MultiFab &y)
 z <- a x + b y over ALL components of the valid cells. Identical layouts; aliasing safe.
 
Real dot (const MultiFab &x, const MultiFab &y, int comp=0)
 Dot product Sum_cells x.y over component comp, reduced over ALL ranks (all_reduce).
 
Real dot_all (const MultiFab &x, const MultiFab &y)
 FULL-component dot Sum_{cells, c} x(.,.,c) * y(.,.,c) over ALL components, reduced over ALL ranks (all_reduce).
 
Real reduce_sum (const MultiFab &mf, int comp=0)
 Sum Sum_cells f(.,.,comp) over component comp, reduced over ALL ranks (all_reduce_sum) – the compiled-Program P.sum / P.sum_component reduction.
 
Real reduce_max (const MultiFab &mf, int comp=0)
 Signed maximum max_cells f(.,.,comp) over component comp, reduced over ALL ranks (all_reduce_max) – the compiled-Program P.max reduction (SIGNED, not the magnitude – use norm_inf for max|f|).
 
Real reduce_min (const MultiFab &mf, int comp=0)
 Signed minimum min_cells f(.,.,comp) over component comp, reduced over ALL ranks (all_reduce_min) – the compiled-Program P.min reduction.
 
Real sum (const MultiFab &mf, int comp=0)
 Sum of the VALID cells of component comp, reduced over ALL ranks (all_reduce).
 
BCRec homogeneous_bc (const EllipticProblem &p)
 
template<class Solver , class... Args>
Solver make_elliptic_solver (const Geometry &geom, const BoxArray &ba, const EllipticProblem &problem, Args &&... args)
 
void field_postprocess (const MultiFab &phi, MultiFab &out, Real cx, Real cy, FieldPostProcess spec)
 
KrylovResult richardson_solve (const ApplyFn &A, MultiFab &phi, const MultiFab &rhs, Real omega, Real rel_tol, int max_iters)
 Richardson iteration x <- x + omega (b - A x), solving A x = b.
 
KrylovResult cg_solve (const ApplyFn &A, MultiFab &phi, const MultiFab &rhs, Real rel_tol, int max_iters)
 Conjugate Gradient, solving A x = b for an SPD operator A.
 
KrylovResult bicgstab_solve (const ApplyFn &A, const ApplyFn &precond, MultiFab &phi, const MultiFab &rhs, Real rel_tol, int max_iters)
 Preconditioned BiCGStab, solving A x = b for a general (possibly non-symmetric) operator A.
 
KrylovResult gmres_solve (const ApplyFn &A, const ApplyFn &precond, MultiFab &phi, const MultiFab &rhs, Real rel_tol, int max_iters, int restart=30)
 Left-preconditioned restarted GMRES(m), solving A x = b for a GENERAL (possibly NON-symmetric) operator A.
 
BCRec homogeneous (const BCRec &b)
 
bool is_pow2 (int n)
 
void dft1d_direct (cplx *a, int n, bool inv)
 
void fft1d (cplx *a, int n, bool inv)
 
POPS_HD Real eps_harmonic (Real ec, Real ev)
 
void apply_laplacian (const MultiFab &phi, const Geometry &geom, MultiFab &lap, const MultiFab *coef=nullptr, const MultiFab *eps=nullptr, const MultiFab *kappa=nullptr, const MultiFab *eps_y=nullptr, const MultiFab *a_xy=nullptr, const MultiFab *a_yx=nullptr)
 
void apply_divergence (const MultiFab &fx, const MultiFab &fy, const Geometry &geom, MultiFab &div_out, int cx=0, int cy=0)
 
void poisson_residual (MultiFab &phi, const MultiFab &f, const Geometry &geom, const BCRec &bc, MultiFab &res, const MultiFab *mask=nullptr, const MultiFab *coef=nullptr, const MultiFab *eps=nullptr, const MultiFab *kappa=nullptr, const MultiFab *eps_y=nullptr, const MultiFab *a_xy=nullptr, const MultiFab *a_yx=nullptr)
 
void gs_rb_sweep (MultiFab &phi, const MultiFab &f, const Geometry &geom, const BCRec &bc, const MultiFab *mask=nullptr, const MultiFab *coef=nullptr, const MultiFab *eps=nullptr, const MultiFab *kappa=nullptr, const MultiFab *eps_y=nullptr)
 
void gs_smooth (MultiFab &phi, const MultiFab &f, const Geometry &geom, const BCRec &bc, int nsweeps, const MultiFab *mask=nullptr, const MultiFab *coef=nullptr, const MultiFab *eps=nullptr, const MultiFab *kappa=nullptr, const MultiFab *eps_y=nullptr)
 
void zero_conductor (MultiFab &phi, const MultiFab &mask)
 
void apply_polar_tensor (const MultiFab &phi, const PolarGeometry &geom, MultiFab &lap, const MultiFab *a_rr, const MultiFab *a_tt, const MultiFab *a_rt, const MultiFab *a_tr)
 Applies L_int(phi) = div(A grad phi) in polar over the whole MultiFab.
 
template<class Model >
POPS_HD void hll_speeds (const Model &m, const typename Model::State &UL, const Aux &AL, const typename Model::State &UR, const Aux &AR, int dir, Real &sL, Real &sR)
 hll_speeds: Davis estimates for the signal speeds of the HLL/HLLC solvers.
 
template<class Model >
POPS_HD Model::State hll_flux_with_speeds (const Model &m, const typename Model::State &UL, const Aux &AL, const typename Model::State &UR, const Aux &AR, int dir, Real sL, Real sR)
 hll_flux_with_speeds: HLL flux from ALREADY estimated signal speeds (sL, sR).
 
POPS_HD Real weno5z (Real vm2, Real vm1, Real v0, Real vp1, Real vp2)
 weno5z: WENO5-Z reconstruction (Borges 2008) at one interface, on a 5-point stencil.
 
template<int N>
POPS_HD EigBounds real_eig_minmax (const Real(&A)[N][N], int max_iter_per_eig=100, bool *fallback=nullptr)
 Extremes of the REAL PARTS of the spectrum of a small dense block A, plus the largest |Im| encountered and a convergence indicator (see the file header for the full contract: Gershgorin fallback on non-convergence, max_im as a hyperbolicity-loss detector).
 
template<int N>
POPS_HD Spectrum real_spectrum (const Real(&A)[N][N], Real im_tol=Real(1e-5), int max_iter_per_eig=100)
 Classify the spectrum of a small dense block A as kReal / kComplexPair / kUnknown (ADC-276): a GENERIC, device-safe predicate over the SAME Francis-QR path as real_eig_minmax (no second algorithm to keep in sync).
 
template<int N>
POPS_HD bool roe_abs_apply (const Real(&A)[N][N], const Real(&dU)[N], Real(&out)[N], int max_iter=80, Real tol=Real(1e-13))
 Roe matrix-absolute-value applied to a state jump: out = |A| dU, with |A| the SPECTRAL absolute value A * sign(A).
 
template<class Limiter = NoSlope, class NumericalFlux = RusanovFlux, class Model , class LevelSet >
void assemble_rhs_eb (const Model &model, const MultiFab &U, const MultiFab &aux, const LevelSet &ls, const Geometry &geom, MultiFab &R, bool recon_prim=false, Real kappa_min=detail::kEbKappaMin, Real pos_floor=Real(0))
 assemble_rhs_eb<Limiter, NumericalFlux>: residual R = -div_eb F + S on a DISC in cut-cell / EB, with face apertures alpha_f in [0, 1] and volume fraction kappa derived from detail::cut_fraction (T5-PR1).
 
template<class Limiter = NoSlope, class NumericalFlux = RusanovFlux, class Model >
void assemble_rhs (const Model &model, const MultiFab &U, const MultiFab &aux, const Geometry &geom, MultiFab &R, bool recon_prim=false, Real pos_floor=Real(0))
 assemble_rhs<Limiter,NumericalFlux>: residual R = -div Fhat + S over all boxes.
 
template<class Limiter = NoSlope, class Model >
void assemble_rhs_hll_cached (const Model &model, const MultiFab &U, const MultiFab &aux, const Geometry &geom, MultiFab &R, MultiFab &cache, bool recon_prim=false, Real pos_floor=Real(0))
 assemble_rhs_hll_cached<Limiter>: residual R = -div Fhat + S at the HLL flux, wave speeds PRE-COMPUTED per cell (OPT-IN).
 
template<class Limiter = NoSlope, class NumericalFlux = RusanovFlux, class Model >
void assemble_rhs_masked (const Model &model, const MultiFab &U, const MultiFab &aux, const MultiFab &mask, const Geometry &geom, MultiFab &R, bool recon_prim=false, Real pos_floor=Real(0))
 assemble_rhs_masked<Limiter,NumericalFlux>: residual R = -div Fhat + S RESTRICTED to a 0/1 cell-centered domain mask (OPT-IN, T2 effort).
 
template<class Limiter = NoSlope, class NumericalFlux = RusanovFlux, class Model >
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.
 
template<class Model >
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).
 
template<class Model , class Limiter >
POPS_HD Model::State reconstruct (const Model &model, const ConstArray4 &u, int i, int j, int dir, Real sgn, const Limiter &lim, bool prim)
 reconstruct<Model,Limiter>: face value at (i,j) extrapolated in direction dir.
 
template<class Model , class Limiter >
POPS_HD Model::State reconstruct_pp (const Model &model, const ConstArray4 &u, int i, int j, int dir, Real sgn, const Limiter &lim, bool prim, Real pos_floor, int pos_comp)
 reconstruct_pp: reconstruct + zhang_shu_scale positivity limiter on the returned state.
 
Box2D xface_box (const Box2D &v)
 xface_box / yface_box: face boxes normal to x (resp.
 
Box2D yface_box (const Box2D &v)
 
template<class Limiter = NoSlope, class NumericalFlux = RusanovFlux, class Model >
void compute_face_fluxes (const Model &model, const MultiFab &U, const MultiFab &aux, MultiFab &Fx, MultiFab &Fy, Real dx=0, Real dy=0, bool recon_prim=false, Real pos_floor=Real(0))
 compute_face_fluxes<Limiter,NumericalFlux>: writes the face fluxes BEFORE divergence.
 
template<class Model >
POPS_HD void zhang_shu_scale (typename Model::State &s, const ConstArray4 &u, int i, int j, Real floor, int pos_comp)
 zhang_shu_scale: POSITIVITY limiter on a reconstructed face state – LOCAL ORDER-1 FALLBACK (vacuum-robust variant of the Zhang & Shu scaling, JCP 2010).
 
template<class Model >
POPS_HD Model::State load_state (const ConstArray4 &a, int i, int j)
 load_state<Model>: reads Model::n_vars scalars at (i,j) from an Array4.
 
template<int NComp = kAuxBaseComps>
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).
 
template<class Model >
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).
 
template<class Model >
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 bound, and its speed w = max(wx, wy).
 
template<class Model >
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.
 
template<class Model >
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.
 
template<class Model >
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.
 
template<class Model >
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).
 
template<class Limiter = NoSlope, class NumericalFlux = RusanovFlux, class Model >
void advance_amr (const Model &m, std::vector< AmrLevelMP > &levels, const Box2D &base_dom, Real dt, Periodicity base_per=Periodicity{true, true}, bool coarse_replicated=true, bool recon_prim=false, bool imex=false, const NewtonOptions &nopts={}, AmrTimeMethod tmethod=AmrTimeMethod::kEuler, Real pos_floor=Real(0))
 
template<class Limiter = NoSlope, class NumericalFlux = RusanovFlux, class Model >
void advance_amr (const Model &m, LevelHierarchy &h, Real dt)
 
void mf_fill_fine_ghosts_multi (MultiFab &Uf, const MultiFab &Uc_old, const MultiFab &Uc_new, Real frac)
 
void mf_average_down_multi (const MultiFab &Uf, MultiFab &Uc)
 
void fill_periodic_local (MultiFab &mf, const Box2D &dom)
 
template<class Limiter = NoSlope, class NumericalFlux = RusanovFlux, class Model >
void amr_step_2level_multipatch (const Model &m, MultiFab &Uc, const Box2D &dom, Real dxc, Real dyc, MultiFab &Uf, const MultiFab &auxc, const MultiFab &auxf, Real dt)
 
int mf_find_box (const MultiFab &mf, int I, int J)
 
BoxArray coarsen_grown (const BoxArray &ba, int ngrow, int r)
 
void mf_fill_fine_ghosts_mb (MultiFab &Uf, const MultiFab &Po, const MultiFab &Pn, Real frac, bool replicated_parent=true, Real pos_floor=Real(0), int pos_comp=0)
 
void mf_average_down_mb (const MultiFab &Uf, MultiFab &Uc)
 
template<class Model >
void mf_eval_rhs (const Model &m, const MultiFab &U, const MultiFab &aux, const MultiFab &Fx, const MultiFab &Fy, Real dx, Real dy, MultiFab &R)
 
void mf_advance_faces (MultiFab &U, const MultiFab &Fx, const MultiFab &Fy, Real dx, Real dy, Real dt)
 
template<class Model >
void mf_apply_source (const Model &m, MultiFab &U, const MultiFab &aux, Real dt)
 
template<class Model >
void mf_apply_source_treatment (const Model &m, MultiFab &U, const MultiFab &aux, Real dt, bool imex, const NewtonOptions &nopts={})
 
void mf_average_down (const MultiFab &Uf, MultiFab &Uc, int CI0, int CI1, int CJ0, int CJ1)
 
void fill_cf_ghost_cell (Array4 f, const ConstArray4 &co, const ConstArray4 &cn, int i, int j, int nc, Real frac, Real pos_floor=Real(0), int pos_comp=0)
 
void mf_fill_fine_ghosts_t (MultiFab &Uf, const MultiFab &Uc_old, const MultiFab &Uc_new, Real frac, Real pos_floor=Real(0), int pos_comp=0)
 
template<class Model >
POPS_HD bool model_is_implicit (int c)
 
template<class Model , int N>
POPS_HD bool is_implicit_component (const ImplicitMask< N > &mask, int c)
 
void validate_newton_options (const NewtonOptions &newton, const char *where)
 Range-validate a NewtonOptions POD; shared by System::add_block and AmrSystem::add_block, which carried this defensive check verbatim.
 
POPS_HD bool newton_finite (Real x)
 Finite? (device-safe, without <cmath>: NaN fails x == x; +-inf fails the bounds).
 
template<class Model >
void backward_euler_source (const Model &model, const MultiFab &aux, MultiFab &U, Real dt, const NewtonOptions &opts, const ImplicitMask< Model::n_vars > &mask={}, NewtonReport *report=nullptr)
 
template<class Model >
void backward_euler_source (const Model &model, const MultiFab &aux, MultiFab &U, Real dt, int iters=2, const ImplicitMask< Model::n_vars > &mask={})
 COMPATIBILITY: old signature with a bare iteration budget (iters = 2 historical).
 
template<class Limiter = NoSlope, class NumericalFlux = RusanovFlux, class Model >
void advance_ssprk2 (const Model &model, MultiFab &U, const MultiFab &aux, const Geometry &geom, const BCRec &bc, Real dt)
 
template<class Stepper , class RhsEval >
void run_explicit_substeps (RhsEval &&rhs, MultiFab &U, Real h, int n)
 
template<class Model >
void compute_fluxes_1c (const Model &m, const Fab2D &U, const Fab2D &aux, Fab2D &fx, Fab2D &fy)
 
template<class Model >
void advance_fab_1c (const Model &m, Fab2D &U, const Fab2D &aux, double dx, double dy, double dt, Fab2D &fx, Fab2D &fy)
 
void fill_periodic_fab (Fab2D &U, const Box2D &dom)
 
void fill_fine_ghosts_t (Fab2D &Uf, const Fab2D &Uco, const Fab2D &Ucn, double frac)
 
void average_down_fab (const Fab2D &Uf, Fab2D &Uc, int CI0, int CI1, int CJ0, int CJ1)
 
template<class Model >
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)
 
template<class TransportStep , class ImplicitSourceSolve >
void imex_euler_step (MultiFab &U, Real dt, TransportStep Texpl, ImplicitSourceSolve Simpl)
 
template<CoupledSystemLike System, class AdvanceBlock >
void advance_subcycled (System &system, Real dt, int macro_step, AdvanceBlock &&advance_block)
 
template<CoupledSystemLike System, class AdvanceBlock >
void advance_subcycled (System &system, Real dt, AdvanceBlock &&advance_block)
 
template<class TransportStep , class SourceStep >
void lie_step (MultiFab &U, Real dt, TransportStep T, SourceStep S)
 
template<class TransportStep , class SourceStep >
void strang_step (MultiFab &U, Real dt, TransportStep T, SourceStep S)
 
bool comm_active ()
 
void comm_init (int *=nullptr, char ***=nullptr)
 
void comm_finalize ()
 
int my_rank ()
 
int n_ranks ()
 
void barrier ()
 
double all_reduce_sum (double x)
 
double all_reduce_max (double x)
 
double all_reduce_min (double x)
 
long all_reduce_sum (long x)
 
void all_reduce_sum_inplace (double *, int)
 
void all_reduce_or_inplace (char *, int)
 
std::uint64_t part1by1 (std::uint64_t x)
 
std::uint64_t morton_key (std::uint32_t x, std::uint32_t y)
 
std::vector< int > morton_order (const BoxArray &ba)
 
DistributionMapping make_sfc_distribution (const BoxArray &ba, int nranks)
 
DistributionMapping make_knapsack_distribution (const BoxArray &ba, int nranks)
 
double load_imbalance (const BoxArray &ba, const DistributionMapping &dm, int nranks)
 
template<int N>
POPS_COLD_FN ImplicitMask< N > make_implicit_mask (const std::vector< int > &implicit_components)
 Builds the device-clean POD implicit mask of an N-variable model from a list of component indices (empty -> INACTIVE mask -> model default, bit-identical).
 
template<class Limiter , class Flux , class Model >
POPS_COLD_FN BlockClosures build_block (const Model &m, const GridContext &ctx, bool imex, bool recon_prim, const std::string &method="ssprk2", const std::vector< int > &implicit_components={}, const NewtonOptions &newton_opts={}, NewtonReport *newton_report=nullptr, Real pos_floor=Real(0), bool wave_speed_cache=false)
 Closures (advance + residual) for a frozen spatial scheme (Limiter x Flux).
 
template<class Model >
POPS_COLD_FN BlockClosures make_block_rusanov (const Model &m, const std::string &lim, const GridContext &ctx, bool imex, bool recon_prim, const std::string &method, const std::vector< int > &implicit_components, const NewtonOptions &newton_opts, NewtonReport *newton_report, Real pos_floor)
 Dispatch of the spatial scheme (limiter x Riemann flux) -> compiled closures.
 
template<class Model >
POPS_COLD_FN BlockClosures make_block_hll (const Model &m, const std::string &lim, const GridContext &ctx, bool imex, bool recon_prim, const std::string &method, const std::vector< int > &implicit_components, const NewtonOptions &newton_opts, NewtonReport *newton_report, Real pos_floor, bool wave_speed_cache)
 
template<class Model >
POPS_COLD_FN BlockClosures make_block_hllc (const Model &m, const std::string &lim, const GridContext &ctx, bool imex, bool recon_prim, const std::string &method, const std::vector< int > &implicit_components, const NewtonOptions &newton_opts, NewtonReport *newton_report, Real pos_floor)
 
template<class Model >
POPS_COLD_FN BlockClosures make_block_roe (const Model &m, const std::string &lim, const GridContext &ctx, bool imex, bool recon_prim, const std::string &method, const std::vector< int > &implicit_components, const NewtonOptions &newton_opts, NewtonReport *newton_report, Real pos_floor)
 
template<class Model >
POPS_COLD_FN BlockClosures make_block (const Model &m, const std::string &lim, const std::string &riem, const GridContext &ctx, bool imex, bool recon_prim, const std::string &method="ssprk2", const std::vector< int > &implicit_components={}, const NewtonOptions &newton_opts={}, NewtonReport *newton_report=nullptr, Real pos_floor=Real(0), bool wave_speed_cache=false)
 
int block_n_ghost (const std::string &lim)
 Number of ghosts required by the spatial scheme lim (single source: Limiter::n_ghost).
 
template<class Model >
std::function< Real(const MultiFab &)> make_max_speed (const Model &m, const GridContext &ctx)
 Closure of the speed used by the block CFL step.
 
template<class Model >
std::function< Real(const MultiFab &)> make_source_frequency (const Model &m, const GridContext &ctx)
 Closure of the block max source frequency (bound dt <= cfl * substeps / (stride * mu)).
 
template<class Model >
std::function< Real(const MultiFab &)> make_stability_dt (const Model &m, const GridContext &ctx)
 Closure of the block min admissible step (bound dt <= stability_dt * substeps / stride, WITHOUT cfl).
 
template<class Model >
std::function< void(const MultiFab &, MultiFab &)> make_poisson_rhs (const Model &m)
 Block contribution to the Poisson right-hand side: rhs += elliptic_rhs(U) (host loop).
 
template<class Model >
std::pair< std::function< void(const double *, double *)>, std::function< void(const double *, double *)> > make_cell_convert (const Model &m)
 PER-CELL (one cell) cons <-> prim conversions of the MODEL, type-erased over arrays of Model::n_vars doubles.
 
void derive_aux_polar (const MultiFab &phi, MultiFab &aux, const PolarGeometry &g)
 Derives the POLAR aux in the local basis (e_r, e_theta) from the potential phi resolved by PolarPoissonSolver: aux[0] = phi; aux[1] = grad_r = d phi/dr; aux[2] = grad_theta = (1/r) d phi/d theta.
 
template<class Limiter , class Flux , class Model >
BlockClosures build_block_polar (const Model &m, const PolarGridContext &ctx, bool recon_prim, const std::string &method, bool wall_radial, Real pos_floor=Real(0))
 Closures (advance + residual) of a POLAR block for a frozen spatial scheme (Limiter x Flux).
 
template<class Model >
BlockClosures make_block_polar (const Model &m, const std::string &lim, const std::string &riem, const PolarGridContext &ctx, bool recon_prim, const std::string &method, bool wall_radial, Real pos_floor=Real(0))
 Dispatch of the spatial scheme (frozen limiter, Riemann flux) -> compiled polar closures.
 
template<class Model >
std::function< Real(const MultiFab &)> make_max_speed_polar (const Model &m, const MultiFab *aux)
 Max wave-speed closure of the POLAR block (for the CFL step).
 
template<class Model >
std::function< Real(const MultiFab &)> make_cfl_speed_polar (const Model &m, const MultiFab *aux)
 CFL speed of the POLAR block: lambda* (HasStabilitySpeed trait) if the model declares it, otherwise max_wave_speed (historical PolarMaxSpeed, bit-identical) – SAME policy as cartesian make_max_speed.
 
template<class Model >
std::function< Real(const MultiFab &)> make_source_frequency_polar (const Model &m, const MultiFab *aux)
 Max source frequency of the POLAR block (HasSourceFrequency trait); EMPTY without the trait (the stepper does not query it, historical step policy).
 
template<class Model >
std::function< Real(const MultiFab &)> make_stability_dt_polar (const Model &m, const MultiFab *aux)
 Min admissible step of the POLAR block (HasStabilityDt trait); EMPTY without the trait.
 
template<class Model >
std::function< void(const MultiFab &, MultiFab &)> make_poisson_rhs_polar (const Model &m)
 Block contribution to the POLAR Poisson right-hand side: rhs += elliptic_rhs(U) (host loop).
 
std::vector< int > resolve_implicit_components_compiled (const std::string &block, const VariableSet &cons, const std::vector< std::string > &names, const std::vector< std::string > &roles)
 Resolves the partial IMEX MASK (implicit_vars / implicit_roles) of a COMPILED block into indices of conserved components, against the conservative descriptor cons of the CONCRETE Model (known here).
 
template<class Model >
void add_compiled_model (AmrSystem &sys, const std::string &name, Model model, const std::string &limiter="minmod", const std::string &riemann="rusanov", const std::string &recon="conservative", const std::string &time="explicit", double gamma=1.4, int substeps=1, int stride=1, const std::vector< std::string > &implicit_vars={}, const std::vector< std::string > &implicit_roles={}, double pos_floor=0.0)
 Wires model (concrete CompositeModel) as an AMR block of sys, with the requested scheme.
 
template<class Model >
void add_compiled_model (System &sys, const std::string &name, Model model, const std::string &limiter="minmod", const std::string &riemann="rusanov", const std::string &recon="conservative", const std::string &time="explicit", double gamma=1.4, int substeps=1, bool evolve=true, int stride=1, double positivity_floor=0)
 Adds model (CompositeModel) as a native block of sys with the requested scheme (limiter x riemann, reconstruction, time treatment).
 
int limiter_n_ghost (const std::string &lim)
 Halo width required by the limiter lim (source: kLimiters).
 
constexpr int limiter_n_ghost_ct (const char *lim)
 COMPILE-TIME variant of limiter_n_ghost (const char* literal): -1 if unknown.
 
void validate_limiter (const std::string &lim, const char *ctx="System")
 Validates a LIMITER tag against kLimiters.
 
void validate_riemann (const std::string &riem, bool polar=false, const char *ctx="System")
 Validates a Riemann FLUX tag against kRiemanns.
 
void throw_registry_dispatch_mismatch (const char *ctx, const char *kind, const std::string &tag)
 DEFENSE-IN-DEPTH guard: reached only if a VALID tag (already accepted by validate_*) is routed by NO branch of the if/else dispatch – this is an inconsistency between the registry (kLimiters/kRiemanns) and the dispatch, hence a programming bug, not a user input.
 
POPS_EXPORT std::string abi_key ()
 ABI key of the module (TU system.cpp).
 
template<class M >
std::unique_ptr< IModel< M::n_vars > > make_dynamic (M model={})
 Factory: wraps a static model in an owned IModel (unique_ptr).
 
std::string transport_tags_csv (bool polar=false)
 Pipe list of transport tags ("exb|compressible|isothermal"), as used in the dispatch rejection messages.
 
std::string source_tags_csv ()
 Pipe list of source / elliptic tags (e.g. "charge|background|gravity").
 
std::string elliptic_tags_csv ()
 
std::string transport_choices ()
 Quoted " | "-separated choices (e.g.
 
std::string source_choices ()
 
std::string elliptic_choices ()
 
bool is_transport (const std::string &tag)
 Membership against the builtin tables.
 
bool is_source (const std::string &tag)
 
bool is_elliptic (const std::string &tag)
 
int transport_n_vars (const std::string &tag)
 Conservative-variable count of a transport tag (source of truth for the static_assert below), or -1 if unknown.
 
constexpr int transport_n_vars_ct (const char *name)
 
std::string unknown_transport_msg (const std::string &tag)
 Rejection message for an unknown transport / elliptic tag, BYTE-IDENTICAL to the historical inline throws (the tag list now comes from the SINGLE table).
 
std::string unknown_elliptic_msg (const std::string &tag)
 
void validate_transport (const std::string &tag)
 Validates a transport / elliptic tag against the builtin registry.
 
void validate_elliptic (const std::string &tag)
 
ModuleCapabilities module_capabilities (CapabilityTarget target=CapabilityTarget::kModule)
 The module's STATIC capability facts for a given lowering route target (Spec 5 sec.13.12 / #36).
 
Arithmetic operators for StateVec (POPS_HD, device-clean).
template<int N>
POPS_HD StateVec< N > operator+ (StateVec< N > a, const StateVec< N > &b)
 
template<int N>
POPS_HD StateVec< N > operator- (StateVec< N > a, const StateVec< N > &b)
 
template<int N>
POPS_HD StateVec< N > operator* (Real s, StateVec< N > a)
 

Variables

constexpr int kAmrRefRatio = 2
 The native AMR refinement ratio between two consecutive levels.
 
constexpr Real kCflSpeedFloor = Real(1e-30)
 Speed FLOOR for the CFL step policies (audit 2026-06, explicit constant instead of the scattered literal 1e-30): w = max(reduced_speed, kCflSpeedFloor) avoids the division by zero when a block has no wave (frozen transport / null field).
 
constexpr std::pair< std::string_view, int > kAuxCanonicalNames []
 CANONICAL aux name -> component table (mirror of AUX_CANONICAL on the DSL side).
 
constexpr int kAuxMaxExtra = 4
 
constexpr int kAuxBaseComps = 3
 
constexpr int kAuxNamedBase = kAuxBaseComps + 2
 
constexpr int kAuxMaxComps = kAuxNamedBase + kAuxMaxExtra
 
constexpr int kCsMaxReg = 32
 
constexpr int kCsMaxStack = 32
 
constexpr int kCsMaxProg = 256
 
constexpr int kCsMaxTerms = 16
 
constexpr Real kRoeEntropyFixFraction = Real(0.1)
 Width of the RoeFlux Harten entropy-fix smoothing, as a fraction of the Roe sound speed (eps = kRoeEntropyFixFraction * c).
 
template<class Block >
constexpr int block_substeps_v = TimePolicyTraits<typename std::decay_t<Block>::Time>::substeps
 
template<class Block >
constexpr TimeTreatment block_time_treatment_v
 
template<class Block >
constexpr int block_stride_v = TimePolicyTraits<typename std::decay_t<Block>::Time>::stride
 
constexpr LimiterTag kLimiters []
 SINGLE SOURCE of the wired limiters (order = display priority: none < minmod < vanleer < weno5).
 
constexpr RiemannTag kRiemanns []
 SINGLE SOURCE of the wired Riemann fluxes (order = message "(rusanov|hll|hllc|roe)").
 
constexpr int kMaxRuntimeParams = 32
 Maximum number of runtime parameters per DSL block.
 
constexpr TransportTag kTransports []
 SINGLE SOURCE of the builtin transports (order = historical display priority, used by the CSV / choices messages).
 
constexpr SourceTag kSources []
 SINGLE SOURCE of the builtin sources.
 
constexpr EllipticTag kElliptics []
 SINGLE SOURCE of the builtin elliptic right-hand sides.
 
constexpr int kAbiVersion = 1
 Discrete, monotonic ABI revision of the module capability contract.
 

Typedef Documentation

◆ AmrCompiledBlockBuilder

using pops::AmrCompiledBlockBuilder = typedef std::function<AmrRuntimeBlock( const detail::SharedAmrLayout& layout, const std::string& name, const std::vector<double>& density, bool has_density, double gamma, int substeps, bool recon_prim, bool imex, int stride, const std::vector<std::string>& implicit_vars, const std::vector<std::string>& implicit_roles, double pos_floor)>

DEFERRED builder of a COMPILED block on the multi-block hierarchy: receives the SHARED layout (created ONCE at lazy build, common to all blocks) plus the block parameters frozen at add time (name, initial density, gamma, substeps/stride, recon/imex, partial IMEX mask resolved into component indices), and returns the type-erased AmrRuntimeBlock of the block (captures the CONCRETE Model/Limiter/Flux via detail::dispatch_amr_block, the kernel stays COMPILED).

Symmetric with the native add_block path: the (sole) difference is only that the types are known at add time (compiled model) rather than resolved from a ModelSpec at build. The SIGNATURE mentions FORWARD-DECLARED types: it is instantiated with a concrete callable only in add_compiled_model(AmrSystem&) (header amr_dsl_block.hpp) where those types are complete, and invoked only in python/amr_system.cpp. The trailing pos_floor (ADC-322) is the Zhang-Shu positivity floor of the block (0 = inactive), forwarded to dispatch_amr_block -> build_amr_block exactly like a native multi-block.

◆ AmrSystemDriver

template<CoupledSystemLike System, class RhsAssembler , class Elliptic = GeometricMG>
using pops::AmrSystemDriver = typedef AmrSystemCoupler<System, RhsAssembler, Elliptic>

◆ ApplyFn

using pops::ApplyFn = typedef std::function<void(MultiFab& out, const MultiFab& in)>

Matrix-free operator callback: out <- A(in).

The caller supplies any apply (e.g. fill ghosts + a stencil matvec). in is logically read-only (a const ref); a matvec that needs to refresh in's ghosts may do so, but must not change its valid cells. out is fully overwritten.

◆ comm_allocator

template<class T >
using pops::comm_allocator = typedef std::allocator<T>

◆ CompressibleFlux

using pops::CompressibleFlux = typedef Euler

Compressible 2D Euler flux (reuses Euler: gamma, pressure, signed wave speeds).

Compat alias: CompressibleFlux == Euler; the complete hyperbolic brick.

◆ cplx

using pops::cplx = typedef std::complex<double>

◆ EulerHLLCFlux2D

VALIDITY-DOMAIN aliases naming the canonical Euler 2D fallback (n_vars == 4, rho/m_x/m_y/E layout, ideal-gas pressure).

HLLCFlux/RoeFlux are GENERIC when the model supplies the HasHLLCStructure / HasRoeDissipation hooks and degrade to this Euler path otherwise; the aliases let a call site name the fallback assumption. The short names remain for compatibility (make_block and the generated .so reference them).

◆ EulerRoeFlux2D

using pops::EulerRoeFlux2D = typedef RoeFlux

◆ ExplicitTime

template<class MethodT = SSPRK2, int SubstepsT = 1, int StrideT = 1>
using pops::ExplicitTime = typedef TimePolicy<MethodT, TimeTreatment::Explicit, SubstepsT, StrideT>

◆ fab_allocator

template<class T >
using pops::fab_allocator = typedef std::allocator<T>

◆ FirstOrder

◆ IMEXTime

template<class MethodT = UserTimeIntegrator, int SubstepsT = 1, int StrideT = 1>
using pops::IMEXTime = typedef TimePolicy<MethodT, TimeTreatment::IMEX, SubstepsT, StrideT>

◆ ImplicitTime

template<class MethodT = UserTimeIntegrator, int SubstepsT = 1, int StrideT = 1>
using pops::ImplicitTime = typedef TimePolicy<MethodT, TimeTreatment::Implicit, SubstepsT, StrideT>

◆ MusclMinmod

◆ MusclVanLeer

◆ MusclVanLeerHLLC

◆ OwnershipPolicy

◆ PrescribedTime

◆ Real

using pops::Real = typedef double

◆ SystemCoupler

template<CoupledSystemLike System, class RhsAssembler , class Elliptic = GeometricMG>
using pops::SystemCoupler = typedef SystemDriver<System, RhsAssembler, Elliptic>

◆ Variables

using pops::Variables = typedef VariableSet

Old name (compat): VariableSet used to be Variables. Kept for existing and generated code.

Enumeration Type Documentation

◆ AmrTimeMethod

enum class pops::AmrTimeMethod : int
strong
Enumerator
kEuler 
kSsprk3 

◆ BCType

enum class pops::BCType
strong

Boundary condition type for a face: Periodic (handled by fill_boundary), Foextrap (zero gradient, outflow/order-0 wall), Dirichlet (value imposed at the face by reflection).

Enumerator
Periodic 
Foextrap 
Dirichlet 

◆ CapabilityTarget

enum class pops::CapabilityTarget
strong

The lowering route whose static capabilities are queried.

The two generated backends differ in one honest way: the production / native loader carries a real cell stride, the AOT / prototype flat-array path hardcodes stride=1 (cf. compiled_block_abi.hpp make_grid). kModule reports the route-agnostic facts (the AND-conservative stride, i.e. false).

Enumerator
kModule 
kProduction 
kAot 

◆ CsOp

enum class pops::CsOp : int
strong

Opcodes of the postfix stack machine.

STABLE integer values (part of the Python -> C++ ABI): do not reorder or reassign.

Enumerator
PushReg 
Add 
Sub 
Mul 
Div 
Neg 
Pow 
Sqrt 

◆ GeometryMode

enum class pops::GeometryMode
strong

TRANSPORT GEOMETRY MODE of the macro-step (T5-PR3 effort, disc wiring in System::step).

  • None: full Cartesian domain (default). Transport uses assemble_rhs (historical path). BIT-IDENTICAL to history as long as no disc is set.
  • Staircase: disc approximated by a cell-centered 0/1 MASK (active/inactive face gate, staircase boundary). Transport uses assemble_rhs_masked (T2 effort).
  • CutCell: disc as cut-cell / embedded-boundary (continuous alpha_f apertures plus volume fraction kappa). Transport uses assemble_rhs_eb (T5-PR1/PR2 efforts). The mode is held by the System (set_disc_domain mode= / set_geometry_mode) and read by the stepper to DISPATCH each block transport advance. None stays the untouched production path.
Enumerator
None 
Staircase 
CutCell 

◆ PoissonCadence

enum class pops::PoissonCadence
strong

Re-solve frequency of the Poisson on AMR: OncePerStep (phi solved once per macro-step, frozen during the advance; cheapest); PerSubstep (phi re-solved before each species substep, more faithful for a field-driven transport, more expensive).

Enumerator
OncePerStep 
PerSubstep 

◆ PolarPrecond

enum class pops::PolarPrecond
strong

Choice of the SIMPLE BiCGStab PRECONDITIONER (NO MG V-cycle – stagnation on polar 1/r^2, cf.

header). Two options, both "simple" (no multigrid hierarchy):

  • Jacobi: pure diagonal M^{-1} = diag^{-1}. The simplest, but the iteration count GROWS like 1/h^2 (ill-conditioned Laplacian): useful as a sanity check, poor on a fine grid.
  • RadialLine: inverts EXACTLY the RADIAL tridiagonal of the diagonal block per theta line (Thomas, like the direct solver), the azimuthal block diagonal being lumped. Attacks the STRONGLY coupled radial direction (and the 1/r^2 anisotropy via the lumped diagonal), leaving to Krylov only the residual azimuthal coupling: iteration count NEARLY INDEPENDENT of h. Stays "simple" (no MG, no coarse grid). DEFAULT.
Enumerator
Jacobi 
RadialLine 

◆ Spectrum

enum class pops::Spectrum : int
strong

Tri-state classification of a small block's spectrum (ADC-276), returned by pops::real_spectrum.

kUnknown is the NON-CONVERGENCE outcome and is NEVER kReal: a switch over it that omits kUnknown is a visible bug, which is the point – the caller (e.g. a native realizability projector) must treat a non-converged block conservatively, not assume a real spectrum.

Enumerator
kReal 
kComplexPair 
kUnknown 

◆ TimeTreatment

enum class pops::TimeTreatment
strong
Enumerator
Explicit 
Implicit 
IMEX 
Prescribed 

◆ VariableKind

enum class pops::VariableKind
strong

Kind of a variable set: conserved (U) or primitive (W).

Used as a tag in VariableSet; do not use it to dispatch numerical logic.

Enumerator
Conservative 
Primitive 

◆ VariableRole

enum class pops::VariableRole
strong

PHYSICAL role of a component.

Lets you address a component by its MEANING (index_of(MomentumX)) rather than by a magic index u[1]: a coupled source can target "the momentum of a given species" without hard-coding the index. Custom = role not provided.

Enumerator
Density 
MomentumX 
MomentumY 
MomentumZ 
Energy 
VelocityX 
VelocityY 
VelocityZ 
Pressure 
Temperature 
Scalar 
Custom 

Function Documentation

◆ abi_key()

POPS_EXPORT std::string pops::abi_key ( )

ABI key of the module (TU system.cpp).

POPS_EXPORT: exported so that add_native_block can read the key of the already-loaded module and compare it to the one baked into the .so loader. Defined out-of-line (system.cpp) to freeze the key at the compilation OF THE MODULE.

+ Here is the caller graph for this function:

◆ add_compiled_model() [1/2]

template<class Model >
void pops::add_compiled_model ( AmrSystem sys,
const std::string &  name,
Model  model,
const std::string &  limiter = "minmod",
const std::string &  riemann = "rusanov",
const std::string &  recon = "conservative",
const std::string &  time = "explicit",
double  gamma = 1.4,
int  substeps = 1,
int  stride = 1,
const std::vector< std::string > &  implicit_vars = {},
const std::vector< std::string > &  implicit_roles = {},
double  pos_floor = 0.0 
)

Wires model (concrete CompositeModel) as an AMR block of sys, with the requested scheme.

The build is DEFERRED (like add_block): the captured closures are invoked at the first step/mass/density via ensure_built(), after set_refinement / set_poisson / set_density.

MONO-BLOCK (a single add_compiled_model): historical AmrCouplerMP<Model> path (mono_builder), bit-identical. MULTI-BLOCK (>= 2 blocks, compiled and/or native mixed; capstone v): the block is materialized as a type-erased AmrRuntimeBlock on the layout SHARED by the multi_builder, exactly like native add_block. We freeze BOTH builders here (the facade chooses the routing at ensure_built). time: "explicit" (forward Euler source) or "imex" (stiff implicit source via backward_euler_source, explicit transport carried by the reflux). Any other treatment is refused. stride: HOLD-THEN-CATCH-UP cadence of the block in multi-block (1 = each macro-step). implicit_vars / implicit_roles: partial IMEX mask of the block (multi-block; requires time=imex). pos_floor: Zhang-Shu positivity floor (ADC-322; 0 = inactive, bit-identical). Stored on the block (mono path reads AmrBuildParams::pos_floor) AND forwarded to the multi-block builder, so the .so floors the Density-role face states like a native add_block.

Exceptions
std::runtime_errorif the system is already built or if time/recon are out of domain.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ add_compiled_model() [2/2]

template<class Model >
void pops::add_compiled_model ( System sys,
const std::string &  name,
Model  model,
const std::string &  limiter = "minmod",
const std::string &  riemann = "rusanov",
const std::string &  recon = "conservative",
const std::string &  time = "explicit",
double  gamma = 1.4,
int  substeps = 1,
bool  evolve = true,
int  stride = 1,
double  positivity_floor = 0 
)

Adds model (CompositeModel) as a native block of sys with the requested scheme (limiter x riemann, reconstruction, time treatment).

gamma is used by set_density (rest energy, 4 vars).

pops::System sys(cfg);
// model: an pops::dsl model compiled into a CompositeModel at build time (the production seam;
// runs the exact add_block path on the System's real grid, no copy).
pops::add_compiled_model(sys, "flow", model, "minmod", "hll", "conservative", "explicit");
sys.set_poisson("charge_density", "geometric_mg");
sys.step_cfl(0.4);
Coupled multi-species system, composed at runtime from generic bricks.
Definition system.hpp:89
void add_compiled_model(AmrSystem &sys, const std::string &name, Model model, const std::string &limiter="minmod", const std::string &riemann="rusanov", const std::string &recon="conservative", const std::string &time="explicit", double gamma=1.4, int substeps=1, int stride=1, const std::vector< std::string > &implicit_vars={}, const std::vector< std::string > &implicit_roles={}, double pos_floor=0.0)
Wires model (concrete CompositeModel) as an AMR block of sys, with the requested scheme.
Definition amr_dsl_block.hpp:1028
+ Here is the call graph for this function:

◆ add_scaled_component()

void pops::add_scaled_component ( const MultiFab U,
Real  q,
int  comp,
MultiFab rhs 
)
inline

rhs(.,.,0) += q * U(.,.,comp) over the valid cells.

Accumulation brick of the N-species elliptic RHS (identical layouts between U and rhs).

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

◆ advance_amr() [1/2]

template<class Limiter = NoSlope, class NumericalFlux = RusanovFlux, class Model >
void pops::advance_amr ( const Model &  m,
LevelHierarchy h,
Real  dt 
)

◆ advance_amr() [2/2]

template<class Limiter = NoSlope, class NumericalFlux = RusanovFlux, class Model >
void pops::advance_amr ( const Model &  m,
std::vector< AmrLevelMP > &  levels,
const Box2D base_dom,
Real  dt,
Periodicity  base_per = Periodicity{true, true},
bool  coarse_replicated = true,
bool  recon_prim = false,
bool  imex = false,
const NewtonOptions nopts = {},
AmrTimeMethod  tmethod = AmrTimeMethod::kEuler,
Real  pos_floor = Real(0) 
)

◆ advance_fab_1c()

template<class Model >
void pops::advance_fab_1c ( const Model &  m,
Fab2D U,
const Fab2D aux,
double  dx,
double  dy,
double  dt,
Fab2D fx,
Fab2D fy 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ advance_ssprk2()

template<class Limiter = NoSlope, class NumericalFlux = RusanovFlux, class Model >
void pops::advance_ssprk2 ( const Model &  model,
MultiFab U,
const MultiFab aux,
const Geometry geom,
const BCRec bc,
Real  dt 
)
+ Here is the call graph for this function:

◆ advance_subcycled() [1/2]

template<CoupledSystemLike System, class AdvanceBlock >
void pops::advance_subcycled ( System system,
Real  dt,
AdvanceBlock &&  advance_block 
)
+ Here is the call graph for this function:

◆ advance_subcycled() [2/2]

template<CoupledSystemLike System, class AdvanceBlock >
void pops::advance_subcycled ( System system,
Real  dt,
int  macro_step,
AdvanceBlock &&  advance_block 
)
+ Here is the caller graph for this function:

◆ all_reduce_max()

double pops::all_reduce_max ( double  x)
inline
+ Here is the caller graph for this function:

◆ all_reduce_min()

double pops::all_reduce_min ( double  x)
inline
+ Here is the caller graph for this function:

◆ all_reduce_or_inplace()

void pops::all_reduce_or_inplace ( char *  ,
int   
)
inline
+ Here is the caller graph for this function:

◆ all_reduce_sum() [1/2]

double pops::all_reduce_sum ( double  x)
inline
+ Here is the caller graph for this function:

◆ all_reduce_sum() [2/2]

long pops::all_reduce_sum ( long  x)
inline

◆ all_reduce_sum_inplace()

void pops::all_reduce_sum_inplace ( double *  ,
int   
)
inline
+ Here is the caller graph for this function:

◆ amr_mass()

Real pops::amr_mass ( const MultiFab coarse,
const Box2D dom,
Real  dx,
Real  dy 
)
inline

Mono-box mass: degenerate case of amr_mass_mb (bit for bit). dom is ignored (kept for the API).

+ Here is the call graph for this function:

◆ amr_mass_mb()

Real pops::amr_mass_mb ( const MultiFab coarse,
Real  dx,
Real  dy 
)
inline

LOCAL mass: sum of u(.,.,0) * dx * dy over the valid cells of ALL local fabs, WITHOUT MPI reduction (the caller decides whether to all_reduce).

Canonical multi-box form.

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

◆ amr_max_drift_speed()

Real pops::amr_max_drift_speed ( const MultiFab aux0,
const Box2D dom,
Real  B0 
)
inline

Mono-box max drift speed + floor 1e-12 (CFL guard). dom ignored (kept for the API).

+ Here is the call graph for this function:

◆ amr_max_drift_speed_mb()

Real pops::amr_max_drift_speed_mb ( const MultiFab aux0,
Real  B0 
)
inline

LOCAL max drift speed: max of |grad phi| / B0 (aux comp 1, 2 = grad phi) over the valid cells, WITHOUT floor (applied by the caller) nor MPI reduction.

Host loop (std::hypot).

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

◆ amr_regrid_finest()

template<class Crit >
void pops::amr_regrid_finest ( std::vector< AmrLevelMP > &  L,
std::vector< MultiFab > &  aux,
const Box2D dom,
Crit  crit,
int  grow,
int  margin,
int  aux_ncomp = kAuxBaseComps,
bool  coarse_replicated = true 
)

Regrid the finest level (L.back()) by Berger-Rigoutsos on the criterion crit applied to the parent: rebuilds the patches (fine data carry-over otherwise parent interp) + the aux.

grow: tag dilation; margin: nesting; aux_ncomp: rebuilt aux width; coarse_replicated: ownership policy of level 0. NO-OP if < 2 levels or no patch.

aux_ncomp: width of the rebuilt aux channel (default kAuxBaseComps = 3). The coupler, which knows the Model, propagates aux_comps<Model>() so that a model reading extra fields (B_z, ...) keeps the room after regrid. Since the Model is not in scope here (free function on the criterion only), the width is PROPAGATED as a parameter; default 3 -> MultiFab(..., 3, 1) allocation strictly bit-identical to the historical one.

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

◆ amr_step_2level()

template<class Model >
void pops::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 
)
+ Here is the call graph for this function:

◆ amr_step_2level_multipatch()

template<class Limiter = NoSlope, class NumericalFlux = RusanovFlux, class Model >
void pops::amr_step_2level_multipatch ( const Model &  m,
MultiFab Uc,
const Box2D dom,
Real  dxc,
Real  dyc,
MultiFab Uf,
const MultiFab auxc,
const MultiFab auxf,
Real  dt 
)
+ Here is the call graph for this function:

◆ apply_divergence()

void pops::apply_divergence ( const MultiFab fx,
const MultiFab fy,
const Geometry geom,
MultiFab div_out,
int  cx = 0,
int  cy = 0 
)
inline
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ apply_laplacian()

void pops::apply_laplacian ( const MultiFab phi,
const Geometry geom,
MultiFab lap,
const MultiFab coef = nullptr,
const MultiFab eps = nullptr,
const MultiFab kappa = nullptr,
const MultiFab eps_y = nullptr,
const MultiFab a_xy = nullptr,
const MultiFab a_yx = nullptr 
)
inline
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ apply_polar_tensor()

void pops::apply_polar_tensor ( const MultiFab phi,
const PolarGeometry geom,
MultiFab lap,
const MultiFab a_rr,
const MultiFab a_tt,
const MultiFab a_rt,
const MultiFab a_tr 
)
inline

Applies L_int(phi) = div(A grad phi) in polar over the whole MultiFab.

Ghosts of phi assumed filled (theta periodic, r physical). a_rr/a_tt: diagonal coefficients (1 component, centers; nullptr -> uniform coefficient 1, isotropic). a_rt/a_tr: cross terms (nullptr -> absent).

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

◆ arena_stats()

ArenaStats pops::arena_stats ( )
inline

◆ assemble_rhs()

template<class Limiter = NoSlope, class NumericalFlux = RusanovFlux, class Model >
void pops::assemble_rhs ( const Model &  model,
const MultiFab U,
const MultiFab aux,
const Geometry geom,
MultiFab R,
bool  recon_prim = false,
Real  pos_floor = Real(0) 
)

assemble_rhs<Limiter,NumericalFlux>: residual R = -div Fhat + S over all boxes.

Main entry point of the Cartesian spatial operator. The limiter (reconstruction) AND the numerical flux are template parameters chosen at compile time (default: NoSlope + RusanovFlux). recon_prim = true enables reconstruction in primitive variables if the model exposes HasPrimitiveVars. For the diffusive term, see DiffusiveModel. INVARIANT: the operator does not modify U, aux – it only writes R. No ghost fill.

+ Here is the call graph for this function:

◆ assemble_rhs_eb()

template<class Limiter = NoSlope, class NumericalFlux = RusanovFlux, class Model , class LevelSet >
void pops::assemble_rhs_eb ( const Model &  model,
const MultiFab U,
const MultiFab aux,
const LevelSet &  ls,
const Geometry geom,
MultiFab R,
bool  recon_prim = false,
Real  kappa_min = detail::kEbKappaMin,
Real  pos_floor = Real(0) 
)

assemble_rhs_eb<Limiter, NumericalFlux>: residual R = -div_eb F + S on a DISC in cut-cell / EB, with face apertures alpha_f in [0, 1] and volume fraction kappa derived from detail::cut_fraction (T5-PR1).

This is the EB generalization of the T2 mask path (assemble_rhs_masked, 0/1 gates): the immersed boundary is no longer crenellated, the scheme is 2nd order for smooth transport inside the disc, and the mass is conserved TO MACHINE PRECISION (no flux crosses the wall).

Template Parameters
Limiterreconstruction (NoSlope / Minmod / VanLeer / Weno5), like the Cartesian operator.
NumericalFluxflux policy (RusanovFlux by default).
Parameters
lsPOPS_HD callable level set (e.g. detail::DiscDomain): ls < 0 inside.
kappa_minvolume fraction floor (small-cell clamp), default kEbKappaMin.

IMPLEMENTATION in TWO PASSES (structure REUSED from the polar operator): pass 1 computes the FACE fluxes weighted by alpha_f into temporary MultiFabs; pass 2 differences and divides by kappa_eff. NO mask MultiFab is required: cell activity AND face apertures all derive from the SINGLE level set (single geometric source), like cut_fraction.

BOUNDARY CONDITIONS: the caller fills the ghosts (fill_ghosts) before the call, as for assemble_rhs. Faces touching an inactive cell are CLOSED by the kernel (immersed wall), so the physical BC of the square box does not influence the interior disc (the EB masks it).

INVARIANT: SEPARATE entry point; the default path (assemble_rhs) stays bit-identical as long as it does NOT call this overload.

+ Here is the call graph for this function:

◆ assemble_rhs_hll_cached()

template<class Limiter = NoSlope, class Model >
void pops::assemble_rhs_hll_cached ( const Model &  model,
const MultiFab U,
const MultiFab aux,
const Geometry geom,
MultiFab R,
MultiFab cache,
bool  recon_prim = false,
Real  pos_floor = Real(0) 
)

assemble_rhs_hll_cached<Limiter>: residual R = -div Fhat + S at the HLL flux, wave speeds PRE-COMPUTED per cell (OPT-IN).

Two passes: (1) fill_wave_speed_cache fills cache on grow(valid, 1); (2) the kernel reads the scratch and bounds each face by min/max of the two cells. cache must have the layout of U, 4 components, >= 1 ghost (re-allocated by the caller). With NoSlope: BIT-IDENTICAL to assemble_rhs<NoSlope, HLLFlux> (cf. the section header). The model MUST expose wave_speeds (guaranteed by the HLL dispatch).

+ Here is the call graph for this function:

◆ assemble_rhs_masked()

template<class Limiter = NoSlope, class NumericalFlux = RusanovFlux, class Model >
void pops::assemble_rhs_masked ( const Model &  model,
const MultiFab U,
const MultiFab aux,
const MultiFab mask,
const Geometry geom,
MultiFab R,
bool  recon_prim = false,
Real  pos_floor = Real(0) 
)

assemble_rhs_masked<Limiter,NumericalFlux>: residual R = -div Fhat + S RESTRICTED to a 0/1 cell-centered domain mask (OPT-IN, T2 effort).

On an inactive cell R = 0 (not advanced); on an active cell, the normal flux of a face whose neighbor is inactive is set to zero (FV wall). Result: the mass over the active sub-domain is CONSERVED to machine precision (no flux crosses the boundary) – property validated by the active-sub-domain mass-conservation test.

mask must have the SAME layout as U (same BoxArray / DistributionMapping) and carry at least 1 ghost (reading the neighbors i-1/i+1/j-1/j+1 up to the edge). This entry point is SEPARATE from assemble_rhs: the default path (System::step) stays strictly bit-identical as long as it does NOT call this overload.

+ Here is the call graph for this function:

◆ assemble_rhs_polar()

template<class Limiter = NoSlope, class NumericalFlux = RusanovFlux, class Model >
void pops::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.

The limiter (reconstruction) and the numerical flux are template parameters, like the Cartesian operator. First computes the FACE fluxes (r-weighted radial, azimuthal) into temporary MultiFabs, then differences. All kernels are device-callable (named functors).

BOUNDARY CONDITIONS: theta PERIODIC (the caller fills the azimuthal ghosts via periodic fill_boundary). r PHYSICAL: the caller fills the radial ghosts (wall / outflow). The radial fluxes at the r_min (i = lo) and r_max (i = hi+1) faces are computed from the ghost states (free outflow), EXCEPT if wall_radial == true: then the radial flux at both physical boundary faces is forced to ZERO (SOLID no-penetration WALL), which makes the mass Sum n r dr dtheta conserved TO MACHINE precision whatever v_r (the radial term telescopes exactly). wall_radial == false (default) reproduces EXACTLY the history (MMS, azimuthal conservation – cf. test_polar_transport_mms).

+ Here is the call graph for this function:

◆ aux_canonical_index()

constexpr int pops::aux_canonical_index ( std::string_view  name)
constexpr

Component of the CANONICAL aux field name, or -1 if name is not a canonical field (it may then be a model-NAMED field, resolved per block by the facade).

HOST-only constexpr.

◆ aux_canonical_name()

constexpr std::string_view pops::aux_canonical_name ( int  comp)
constexpr

Inverse: CANONICAL name of component comp, or an empty view if comp is not a canonical component (e.g.

a model-named field at kAuxNamedBase + k). HOST-only constexpr.

◆ aux_comps()

template<class M >
POPS_HD constexpr int pops::aux_comps ( )
constexpr

Width of the aux channel a model CONSUMES.

Returns M::n_aux if the model declares it (extra fields: B_z, T_e...), otherwise kAuxBaseComps (= 3: phi/grad_x/grad_y). Drives the number of components that load_aux reads and that the system allocates. A model without n_aux -> 3 -> bit-identical to history (extra Aux fields at 0, never read). Lives in this header (contract) and not in the spatial operator, so that CompositeModel can propagate n_aux without pulling in all the numerics.

◆ aux_halo_override()

BCRec pops::aux_halo_override ( const BCRec shared,
const AuxHaloPolicy p 
)
inline

Builds the effective override BCRec for a per-field aux halo: starts from the SHARED aux BC shared (so periodic faces stay periodic) and replaces each NON-PERIODIC face with the policy p (type + Dirichlet value).

Feeding the result to fill_physical_bc(mf, domain, bc, comp) re-fills only that component's physical-face ghosts with the field's own policy.

+ Here is the caller graph for this function:

◆ average_down() [1/2]

void pops::average_down ( const MultiFab fine,
MultiFab coarse,
int  r 
)
inline
+ Here is the call graph for this function:

◆ average_down() [2/2]

void pops::average_down ( const MultiFab fine,
MultiFab coarse,
int  r,
MultiFab cfine 
)
inline

CONSERVATIVE average fine -> coarse (ratio r): coarse(I, J) = average of the r^2 fine cells of the block.

Writes the coarse cells covered by fine (via parallel_copy from a local fine-coarsen grid); copies min(ncomp). Preserves the integral (sum * dV) of the fine over the covered area.

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

◆ average_down_fab()

void pops::average_down_fab ( const Fab2D Uf,
Fab2D Uc,
int  CI0,
int  CI1,
int  CJ0,
int  CJ1 
)
inline
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ backward_euler_source() [1/2]

template<class Model >
void pops::backward_euler_source ( const Model &  model,
const MultiFab aux,
MultiFab U,
Real  dt,
const NewtonOptions opts,
const ImplicitMask< Model::n_vars > &  mask = {},
NewtonReport report = nullptr 
)
+ Here is the caller graph for this function:

◆ backward_euler_source() [2/2]

template<class Model >
void pops::backward_euler_source ( const Model &  model,
const MultiFab aux,
MultiFab U,
Real  dt,
int  iters = 2,
const ImplicitMask< Model::n_vars > &  mask = {} 
)

COMPATIBILITY: old signature with a bare iteration budget (iters = 2 historical).

Equivalent to NewtonOptions{max_iters = iters} without report -> historical path bit-identical. Kept for existing callers (AMR couplers, ImplicitSourceStepper, tests).

◆ barrier()

void pops::barrier ( )
inline

◆ berger_rigoutsos()

std::vector< Box2D > pops::berger_rigoutsos ( const TagBox tags,
const ClusterParams p = {} 
)
inline

Cluster a TagBox into boxes covering the tagged cells (Berger-Rigoutsos), then final chop.

Parameters
tagstag grid to cover (index space of tags.box).
pparameters (target efficiency, min/max box sizes).
Returns
boxes in the index space of tags.box, each of size <= p.max_box_size.
+ Here is the caller graph for this function:

◆ bicgstab_solve()

KrylovResult pops::bicgstab_solve ( const ApplyFn A,
const ApplyFn precond,
MultiFab phi,
const MultiFab rhs,
Real  rel_tol,
int  max_iters 
)
inline

Preconditioned BiCGStab, solving A x = b for a general (possibly non-symmetric) operator A.

The algorithm and the fixed scratch footprint are copied from TensorKrylovSolver::solve; only the operator/preconditioner are lifted to callbacks. The preconditioner precond is OPTIONAL: an empty std::function means the identity (unpreconditioned BiCGStab), in which case phat = p and shat = s directly and the two phat/shat scratch fields are not allocated.

All dot products (rho, rhat.v, t.t, t.s) are COLLECTIVE (pops::dot -> all_reduce_sum): called on every rank, identical trip count, no rank-divergent break. Scratch (r, rhat, p, v, s, t, and phat/shat when preconditioned) is allocated ONCE and reused across the loop.

Parameters
Amatrix-free operator out <- A(in).
precondmatrix-free preconditioner out <- M^{-1}(in); EMPTY -> identity.
phiunknown, IN (initial guess) / OUT (solution).
rhsright-hand side b (unchanged).
rel_tolstop when ||r|| <= rel_tol * ||b||.
max_itersiteration budget; <= 0 throws std::invalid_argument.
Returns
iterations, relative residual, convergence flag.
+ Here is the call graph for this function:

◆ block_n_ghost()

int pops::block_n_ghost ( const std::string &  lim)
inline

Number of ghosts required by the spatial scheme lim (single source: Limiter::n_ghost).

Used for the allocation of a block state MultiFab, so that the wide WENO5 stencil (5 points, 3 ghosts) does not read out of bounds – cf. AmrSystem allocates with Limiter::n_ghost (PR #22). Default 2 (MUSCL) for an unknown limiter: that is the historical allocation, hence bit-identical.

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

◆ build_block()

template<class Limiter , class Flux , class Model >
POPS_COLD_FN BlockClosures pops::build_block ( const Model &  m,
const GridContext ctx,
bool  imex,
bool  recon_prim,
const std::string &  method = "ssprk2",
const std::vector< int > &  implicit_components = {},
const NewtonOptions newton_opts = {},
NewtonReport newton_report = nullptr,
Real  pos_floor = Real(0),
bool  wave_speed_cache = false 
)

Closures (advance + residual) for a frozen spatial scheme (Limiter x Flux).

The RK math comes from the core TimeStepper: in explicit, SSPRK2 (default), SSPRK3 or ForwardEuler ("euler", order 1, fidelity to first-order references – validation, never default) according to method; ForwardEuler + backward_euler_source in IMEX. The closures are NAMED FUNCTORS (cf. namespace detail) and not lambdas: the add_compiled_model path (first instantiation from an external TU) then emits cleanly under nvcc. method affects ONLY the explicit advance (IMEX keeps its ForwardEuler half-step + implicit source); "ssprk2" reproduces the historical advance (bit-identical). In IMEX (imex), method "imexrk_ars222" selects the IMEX-RK ARS(2,2,2) family (order 2, advance PARALLEL to AdvanceImex, full cartesian only); any other value keeps the historical backward-Euler IMEX (order 1, bit-identical). implicit_components: indices of the conserved variables to handle IMPLICITLY in the IMEX source (mask CARRIED BY THE BLOCK, overrides the model default). EMPTY (default) -> inactive mask -> model default is_implicit -> bit-identical. No effect outside IMEX (the explicit has no implicit step). The optional EMBEDDED-BOUNDARY transport advances (advance_masked / advance_eb) are built when ctx carries the System level-set domain (ctx.domain_mask / ctx.eb_domain, T5-PR3 work); otherwise they stay empty and the stepper falls back on advance (bit-identical). STABLE addresses of Impl members, read BY POINTER at step time -> the add_block / set_disc_domain order is indifferent. The embedded-boundary advances MIMIC advance (same RK / IMEX, same limiter / flux); only the transport residual is dispatched (assemble_rhs_masked / _eb).

◆ build_block_polar()

template<class Limiter , class Flux , class Model >
BlockClosures pops::build_block_polar ( const Model &  m,
const PolarGridContext ctx,
bool  recon_prim,
const std::string &  method,
bool  wall_radial,
Real  pos_floor = Real(0) 
)

Closures (advance + residual) of a POLAR block for a frozen spatial scheme (Limiter x Flux).

The RK math comes from the core TimeStepper (SSPRK2 / SSPRK3). NAMED FUNCTORS (see namespace detail). Counterpart of cartesian build_block, but without IMEX (Phase 2b scalar ExB transport: no stiff source). wall_radial: solid radial wall (no-penetration) -> mass conservation to machine precision.

◆ cg_solve()

KrylovResult pops::cg_solve ( const ApplyFn A,
MultiFab phi,
const MultiFab rhs,
Real  rel_tol,
int  max_iters 
)
inline

Conjugate Gradient, solving A x = b for an SPD operator A.

Standard preconditioner-free CG. Allocates THREE scratch fields (r, p, Ap), reused across the loop. The dot products (rho, p.Ap) are COLLECTIVE (pops::dot): called on every rank, identical trip count.

NOTE: A must be symmetric positive-definite. A non-SPD operator may stall or diverge (use bicgstab_solve instead).

Parameters
ASPD matrix-free operator out <- A(in).
phiunknown, IN (initial guess) / OUT (solution).
rhsright-hand side b (unchanged).
rel_tolstop when ||r|| <= rel_tol * ||b||.
max_itersiteration budget; <= 0 throws std::invalid_argument.
Returns
iterations, relative residual, convergence flag.
+ Here is the call graph for this function:

◆ coarsen()

BoxArray pops::coarsen ( const BoxArray ba,
int  r 
)
inline

Coarsens each box of the BoxArray by a ratio r (coarsen box by box, order preserved).

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

◆ coarsen_grown()

BoxArray pops::coarsen_grown ( const BoxArray ba,
int  ngrow,
int  r 
)
inline
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ coarsen_index()

POPS_HD int pops::coarsen_index ( int  a,
int  r 
)
inline

Index of the coarse cell containing the fine cell a (FLOOR division by r, handles a < 0).

POPS_HD: called inside the interpolation / coarse->fine injection kernels. Thin adapter over floor_div (box2d.hpp): same floor division, bit-identical result.

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

◆ comm_active()

bool pops::comm_active ( )
inline

◆ comm_finalize()

void pops::comm_finalize ( )
inline

◆ comm_init()

void pops::comm_init ( int *  = nullptr,
char ***  = nullptr 
)
inline

◆ compute_face_fluxes()

template<class Limiter = NoSlope, class NumericalFlux = RusanovFlux, class Model >
void pops::compute_face_fluxes ( const Model &  model,
const MultiFab U,
const MultiFab aux,
MultiFab Fx,
MultiFab Fy,
Real  dx = 0,
Real  dy = 0,
bool  recon_prim = false,
Real  pos_floor = Real(0) 
)

compute_face_fluxes<Limiter,NumericalFlux>: writes the face fluxes BEFORE divergence.

Fx(i,j) = flux at the face between (i-1,j) and (i,j), i in [lo..hi+1]. Fy(i,j) = flux between (i,j-1) and (i,j), j in [lo..hi+1]. Brick required by the AMR reflux: assemble_rhs computes -div F directly and discards the face fluxes, but the reflux must see them to correct the coarse-fine interfaces. For a DiffusiveModel, the Fickian flux F_diff = -nu (u_R-u_L)/h is added (its divergence reproduces EXACTLY +nu Lap(u) of assemble_rhs, and stays visible to the reflux). dx=0, dy=0 by default: not read for a non-diffusive model (hyperbolic bit-identical).

+ Here is the call graph for this function:

◆ compute_fluxes_1c()

template<class Model >
void pops::compute_fluxes_1c ( const Model &  m,
const Fab2D U,
const Fab2D aux,
Fab2D fx,
Fab2D fy 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CoupledSystem()

template<EquationBlockLike... Blocks>
pops::CoupledSystem ( Blocks...  ) -> CoupledSystem< Blocks... >

◆ coupling_role_index()

int pops::coupling_role_index ( const VariableSet vs,
VariableRole  role,
int  fallback,
const char *  origin,
const std::string &  block 
)
inline

Resolve a REQUIRED canonical role to its component in vs, for a NAMED coupling (add_collision / add_thermal_exchange / ionization) that historically targeted the canonical layout.

A genuinely ROLELESS set (roles empty: a legacy / dynamic block that declares no roles) returns the canonical fallback – backward compatible. A ROLES-BEARING set that declares some roles but NOT role THROWS: a silent fallback to fallback would apply the coupling to the WRONG component. origin / block name the error.

+ Here is the call graph for this function:

◆ derive_aux_polar()

void pops::derive_aux_polar ( const MultiFab phi,
MultiFab aux,
const PolarGeometry g 
)
inline

Derives the POLAR aux in the local basis (e_r, e_theta) from the potential phi resolved by PolarPoissonSolver: aux[0] = phi; aux[1] = grad_r = d phi/dr; aux[2] = grad_theta = (1/r) d phi/d theta.

This is the layout expected by ExBVelocityPolar (v_r = -grad_theta/B, v_theta = grad_r/B).

KEY INVARIANT (cause of the fixed bug): phi is allocated by the direct solver WITHOUT ghost (mono-box). We thus NEVER read a radial index out of domain: the radial derivative is CENTERED in the interior and one-sided second order at both walls (i = lo: forward; i = hi: backward), without touching phi(lo-1) / phi(hi+1). In theta (PERIODIC) we wrap the index (j-1 -> jhi, j+1 -> jlo) instead of reading the nonexistent azimuthal ghost. Pure HOST loop (phi host-resident after solve()). Does NOT fill the ghosts of the aux: the caller does it AFTER (fill_ghosts: theta periodic, r physical) for the transport. PRECONDITION nr >= 3 (the one-sided second-order stencil reads p(i+2)/p(i-2) at the walls): IMPOSED upstream by check_geometry (python/system.cpp) and pops.PolarMesh (nr >= 3), not merely assumed.

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

◆ device_fence()

void pops::device_fence ( )
inline

Device barrier: waits for in-flight kernels to finish before a HOST access to unified memory.

No-op outside Kokkos (and if nothing has been launched).

+ Here is the caller graph for this function:

◆ dft1d_direct()

void pops::dft1d_direct ( cplx a,
int  n,
bool  inv 
)
inline
+ Here is the caller graph for this function:

◆ dot()

Real pops::dot ( const MultiFab x,
const MultiFab y,
int  comp = 0 
)
inline

Dot product Sum_cells x.y over component comp, reduced over ALL ranks (all_reduce).

COLLECTIVE, MANDATORY UNDER MPI: must be called on every rank (including empty), otherwise deadlock. FP NOTE: not bit-identical across backends under Kokkos; the all-reduce returns the same value to all ranks (no desynchronization of the Krylov stopping criterion).

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

◆ dot_all()

Real pops::dot_all ( const MultiFab x,
const MultiFab y 
)
inline

FULL-component dot Sum_{cells, c} x(.,.,c) * y(.,.,c) over ALL components, reduced over ALL ranks (all_reduce).

The vector inner product for a MULTI-component (vector / state-valued) Krylov solve: the residual / search-direction norms must cover EVERY component, not just component 0, or the loop converges on component 0 alone and leaves the others unsolved. For a single-component field this is exactly dot(x, y) (one component, component 0), so the scalar Krylov path stays BIT-IDENTICAL.

COLLECTIVE, MANDATORY UNDER MPI: like dot, all_reduce_sum runs on every rank (an empty rank contributes 0); the per-component local sums are summed BEFORE the single all-reduce so the reduction structure matches dot per component (same per-tile Kokkos::Sum, deterministic).

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

◆ elliptic_choices()

std::string pops::elliptic_choices ( )
inline
+ Here is the call graph for this function:

◆ elliptic_tags_csv()

std::string pops::elliptic_tags_csv ( )
inline
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ eps_harmonic()

POPS_HD Real pops::eps_harmonic ( Real  ec,
Real  ev 
)
inline
+ Here is the caller graph for this function:

◆ fft1d()

void pops::fft1d ( cplx a,
int  n,
bool  inv 
)
inline
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ field_postprocess()

void pops::field_postprocess ( const MultiFab phi,
MultiFab out,
Real  cx,
Real  cy,
FieldPostProcess  spec 
)
inline
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fill_boundary()

void pops::fill_boundary ( MultiFab mf,
const Box2D domain,
Periodicity  per = {} 
)
inline

BLOCKING halo exchange: begin then end immediately (no overlap).

Fills the intra-level + periodic ghosts of mf; per sets the wrapping, domain the periodic fold.

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

◆ fill_boundary_begin()

HaloExchange pops::fill_boundary_begin ( MultiFab mf,
const Box2D domain,
Periodicity  per = {} 
)
inline

Phase 1 (non-blocking): does the LOCAL halo copies and posts the Isend/Irecv of the distant halos.

Returns the handle to pass to fill_boundary_end. Between begin and end the caller can advance the interior. No-op if mf has no ghost. domain is used for periodic wrapping per.

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

◆ fill_boundary_end()

void pops::fill_boundary_end ( MultiFab mf,
HaloExchange h 
)
inline

Phase 2 (blocking): MPI_Waitall on the transfers posted by begin, then unpacks the received buffers into the ghosts.

h MUST come from the matching fill_boundary_begin on the same mf. No-op in serial (no request).

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

◆ fill_cf_ghost_cell()

void pops::fill_cf_ghost_cell ( Array4  f,
const ConstArray4 co,
const ConstArray4 cn,
int  i,
int  j,
int  nc,
Real  frac,
Real  pos_floor = Real(0),
int  pos_comp = 0 
)
inline
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fill_fine_ghosts_t()

void pops::fill_fine_ghosts_t ( Fab2D Uf,
const Fab2D Uco,
const Fab2D Ucn,
double  frac 
)
inline
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fill_ghosts()

void pops::fill_ghosts ( MultiFab mf,
const Box2D domain,
const BCRec bc 
)
inline

COMPLETE ghost filling: fill_boundary (interior + periodic, periodicity deduced from bc) THEN fill_physical_bc (physical edges).

Usual entry point before assembling a residual.

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

◆ fill_periodic_fab()

void pops::fill_periodic_fab ( Fab2D U,
const Box2D dom 
)
inline
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fill_periodic_local()

void pops::fill_periodic_local ( MultiFab mf,
const Box2D dom 
)
inline
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fill_physical_bc() [1/2]

void pops::fill_physical_bc ( MultiFab mf,
const Box2D domain,
const BCRec bc 
)
inline

Fills the physical-face ghosts of ALL components per bc (historical entry point, bit-identical).

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

◆ fill_physical_bc() [2/2]

void pops::fill_physical_bc ( MultiFab mf,
const Box2D domain,
const BCRec bc,
int  comp 
)
inline

ADC-369: fills the physical-face ghosts of a SINGLE component comp per bc – the per-field aux halo override.

Applied AFTER the shared aux fill so a model-named field (component kAuxNamedBase+k) can carry its own boundary policy (foextrap / dirichlet), overriding the shared aux BC for that component only. It can even override the domain periodicity for that component (a Foextrap/Dirichlet face re-fills a ghost that the shared periodic wrap had filled). Default paths never call this.

+ Here is the call graph for this function:

◆ fill_physical_bc_range()

void pops::fill_physical_bc_range ( MultiFab mf,
const Box2D domain,
const BCRec bc,
int  c0,
int  c1 
)
inline

Fills the OUT-OF-domain ghosts of the NON-periodic faces of mf according to bc (Foextrap or Dirichlet), for the COMPONENT RANGE [c0, c1).

No-op if there is no ghost or everything is periodic. PRECONDITION: fill_boundary has already filled the interior/periodic (the x-faces read the y/theta ghosts already filled to extend the radial BC into the halo, and the y-faces read the x ghosts for the corners). CORNERS of the 9-point stencil: the x-face BC is extended to the EXTENDED j range (y/theta ghosts included), so that the corner (x-physical CROSSED with y-periodic/neighbor) – read by the cross terms of a 9-point operator (e.g. PolarTensorKrylovSolver) – is correct even in MULTI-BOX. The all-component entry point fill_physical_bc(mf, domain, bc) and the single-component override fill_physical_bc(mf, domain, bc, comp) (ADC-369, per-field aux halo) both delegate here.

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

◆ fill_wave_speed_cache()

template<class Model >
void pops::fill_wave_speed_cache ( const Model &  model,
const MultiFab U,
const MultiFab aux,
MultiFab cache 
)
inline

fill_wave_speed_cache: fills the per-cell wave speed scratch (lo_x, hi_x, lo_y, hi_y).

Evaluated on the VALID box grown by one ghost (grow(v, 1)): a valid cell's face speed reads the cached speed of its neighbor, so the scratch must cover one ghost on each side. cache must have the SAME layout as U (same BoxArray / DistributionMapping), 4 components and >= 1 ghost. U carries its ghosts already filled (fill_ghosts); aux carries at least 1 ghost (read at the neighbor cells, like assemble_rhs).

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

◆ floor_div()

POPS_HD constexpr int pops::floor_div ( int  a,
int  b 
)
constexpr

Integer division of a by b rounded down (handles a < 0 AND b < 0). POPS_HD constexpr (kernels).

+ Here is the caller graph for this function:

◆ for_each_cell()

template<class F >
void pops::for_each_cell ( const Box2D b,
f 
)

Applies f to EACH cell (i, j) of box b (bounds inclusive), via Kokkos::parallel_for (Serial / OpenMP / Cuda depending on the Kokkos install).

f is taken by value and MUST be device-callable (annotated POPS_HD, captures POD by value). No order guarantee.

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

◆ for_each_cell_reduce_max()

template<class F >
Real pops::for_each_cell_reduce_max ( const Box2D b,
f 
)

MAX reduction of f(i, j) over box b.

f device-callable (POPS_HD). EXACT everywhere (max is associative/commutative in IEEE754, rounding-free) -> bit-identical across Kokkos spaces. Blocking.

◆ for_each_cell_reduce_sum()

template<class F >
Real pops::for_each_cell_reduce_sum ( const Box2D b,
f 
)

SUM reduction of f(i, j) over box b.

f device-callable (POPS_HD) returning the value to accumulate. FP WARNING: Kokkos::Sum reassociates the sum per tile (deterministic/idempotent but not bit-identical to a lexicographic sum), for all Kokkos spaces. Blocking host-side.

+ Here is the caller graph for this function:

◆ gmres_solve()

KrylovResult pops::gmres_solve ( const ApplyFn A,
const ApplyFn precond,
MultiFab phi,
const MultiFab rhs,
Real  rel_tol,
int  max_iters,
int  restart = 30 
)
inline

Left-preconditioned restarted GMRES(m), solving A x = b for a GENERAL (possibly NON-symmetric) operator A.

Where CG needs an SPD A and BiCGStab can break down on a strongly non-symmetric one, GMRES minimises the (preconditioned) residual over the growing Krylov subspace and is the robust choice for a non-self-adjoint operator (e.g. an advection-diffusion / condensed-Schur block).

Math: classic restarted GMRES. The inner cycle builds an Arnoldi basis of M^{-1}A by MODIFIED Gram-Schmidt, accumulating the upper-Hessenberg matrix H; Givens rotations triangularise H incrementally so the least-squares residual ||beta e1 - H y|| is read off the last rotated component WITHOUT a matvec. Every restart steps (or at convergence) the iterate is updated from the back-substituted y and the cycle restarts on the fresh residual. The preconditioner precond is OPTIONAL: an empty std::function means the identity (unpreconditioned GMRES). Left preconditioning is used (the minimised residual is M^{-1}(b - A x)); with the identity that is the true residual, so the stopping test ||r|| <= rel_tol * ||b|| matches CG / BiCGStab exactly.

ALLOC-ONCE: the (restart+1) Arnoldi basis MultiFabs, plus w / r / Mb scratch, are allocated ONCE (co-distributed with phi) before the restart loop and reused across every cycle – no MultiFab allocation inside the loop. The small (restart+1) x restart Hessenberg least-squares lives on fixed-size stack arrays (H, the Givens cs/sn, the rotated rhs g, the solution y): no Eigen / LAPACK and no device-side dynamic allocation; restart is capped at kGmresRestartMax (50) so the stack footprint stays bounded. All inner products go through detail::krylov_dot (COLLECTIVE all_reduce, multi-component aware), so the loop is rank-divergence free and solves EVERY component of a vector / state field.

Parameters
Amatrix-free operator out <- A(in).
precondmatrix-free preconditioner out <- M^{-1}(in); EMPTY -> identity.
phiunknown, IN (initial guess) / OUT (solution).
rhsright-hand side b (unchanged).
rel_tolstop when ||r|| <= rel_tol * ||b||.
max_iterstotal matvec budget across restarts; <= 0 throws std::invalid_argument.
restartGMRES restart length m (basis size); clamped to [1, kGmresRestartMax]. Default 30.
Returns
iterations, relative residual, convergence flag.
+ Here is the call graph for this function:

◆ grow_tags()

TagBox pops::grow_tags ( const TagBox in,
int  n,
const Box2D domain 
)
inline

Grows the tags by n cells (square neighborhood), staying within the domain.

Parameters
ndilation radius (buffer); used for nesting and to anticipate the motion of structures.
domainbounds the neighborhood: no tag is placed outside the domain.
Returns
new TagBox over in.box, marked over the union of the square neighborhoods of the tagged cells.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gs_rb_sweep()

void pops::gs_rb_sweep ( MultiFab phi,
const MultiFab f,
const Geometry geom,
const BCRec bc,
const MultiFab mask = nullptr,
const MultiFab coef = nullptr,
const MultiFab eps = nullptr,
const MultiFab kappa = nullptr,
const MultiFab eps_y = nullptr 
)
inline
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gs_smooth()

void pops::gs_smooth ( MultiFab phi,
const MultiFab f,
const Geometry geom,
const BCRec bc,
int  nsweeps,
const MultiFab mask = nullptr,
const MultiFab coef = nullptr,
const MultiFab eps = nullptr,
const MultiFab kappa = nullptr,
const MultiFab eps_y = nullptr 
)
inline
+ Here is the call graph for this function:

◆ halo_schedule_build_count()

std::int64_t pops::halo_schedule_build_count ( )
inline

Number of times fill_boundary has BUILT (enumerated) a halo schedule.

A reused (cached) schedule does NOT increment it, so a stable layout filled K times reports 1. Test hook for cache engagement; not part of the public numerical API.

◆ hll_flux_with_speeds()

template<class Model >
POPS_HD Model::State pops::hll_flux_with_speeds ( const Model &  m,
const typename Model::State &  UL,
const Aux AL,
const typename Model::State &  UR,
const Aux AR,
int  dir,
Real  sL,
Real  sR 
)
inline

hll_flux_with_speeds: HLL flux from ALREADY estimated signal speeds (sL, sR).

Body of HLLFlux AFTER hll_speeds: same supersonic branches (FL if sL >= 0, FR if sR <= 0), same HLL combination. Extracted as a free function for the OPT-IN path that pre-computes the wave speeds PER CELL (cache) then bounds each face by min/max of the two adjacent cells, instead of recalling model.wave_speeds per face (cf. assemble_rhs_hll_cached). For reconstructed states equal to the cell values (NoSlope) this path is ALGEBRAICALLY identical to HLLFlux. POPS_HD.

+ Here is the caller graph for this function:

◆ hll_speeds()

template<class Model >
POPS_HD void pops::hll_speeds ( const Model &  m,
const typename Model::State &  UL,
const Aux AL,
const typename Model::State &  UR,
const Aux AR,
int  dir,
Real sL,
Real sR 
)
inline

hll_speeds: Davis estimates for the signal speeds of the HLL/HLLC solvers.

sL = min(sL_left, sL_right), sR = max(sR_left, sR_right). Requires model.wave_speeds(U, aux, dir, lo, hi) -> signed speeds (cf. Euler). Shared by HLLFlux and HLLCFlux. POPS_HD.

+ Here is the caller graph for this function:

◆ homogeneous()

BCRec pops::homogeneous ( const BCRec b)
inline
+ Here is the caller graph for this function:

◆ homogeneous_bc()

BCRec pops::homogeneous_bc ( const EllipticProblem p)
inline
+ Here is the call graph for this function:

◆ imex_euler_step()

template<class TransportStep , class ImplicitSourceSolve >
void pops::imex_euler_step ( MultiFab U,
Real  dt,
TransportStep  Texpl,
ImplicitSourceSolve  Simpl 
)

◆ interpolate() [1/2]

void pops::interpolate ( const MultiFab coarse,
MultiFab fine,
int  r 
)
inline
+ Here is the call graph for this function:

◆ interpolate() [2/2]

void pops::interpolate ( const MultiFab coarse,
MultiFab fine,
int  r,
MultiFab cfine 
)
inline

Interpolation coarse -> fine (ratio r) by piecewise-CONSTANT injection: each fine cell (including the box ghosts) receives the value of its coarse cell (coarsen_index).

Copies min(ncomp). First brings the coarse values onto a local fine-coarsen grid (parallel_copy).

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

◆ is_elliptic()

bool pops::is_elliptic ( const std::string &  tag)
inline
+ Here is the caller graph for this function:

◆ is_implicit_component()

template<class Model , int N>
POPS_HD bool pops::is_implicit_component ( const ImplicitMask< N > &  mask,
int  c 
)
inline

◆ is_pow2()

bool pops::is_pow2 ( int  n)
inline
+ Here is the caller graph for this function:

◆ is_source()

bool pops::is_source ( const std::string &  tag)
inline

◆ is_transport()

bool pops::is_transport ( const std::string &  tag)
inline

Membership against the builtin tables.

+ Here is the caller graph for this function:

◆ lie_step()

template<class TransportStep , class SourceStep >
void pops::lie_step ( MultiFab U,
Real  dt,
TransportStep  T,
SourceStep  S 
)

◆ limiter_n_ghost()

int pops::limiter_n_ghost ( const std::string &  lim)
inline

Halo width required by the limiter lim (source: kLimiters).

Default 2 (MUSCL) for an unknown limiter: this is the HISTORICAL allocation of block_n_ghost -> bit-identical (the make_block dispatch will throw anyway on an invalid limiter). Used to size the state MultiFab of a block (wide WENO5 stencil: 5 points, 3 ghosts).

+ Here is the caller graph for this function:

◆ limiter_n_ghost_ct()

constexpr int pops::limiter_n_ghost_ct ( const char *  lim)
constexpr

COMPILE-TIME variant of limiter_n_ghost (const char* literal): -1 if unknown.

Used ONLY by the non-drift static_assert on the block_builder.hpp side (this TU sees BOTH kLimiters AND the ::n_ghost constants of the types) – guards that the table never diverges from the real types.

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

◆ lincomb()

void pops::lincomb ( MultiFab z,
Real  a,
const MultiFab x,
Real  b,
const MultiFab y 
)
inline

z <- a x + b y over ALL components of the valid cells. Identical layouts; aliasing safe.

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

◆ load_aux()

template<int NComp = kAuxBaseComps>
POPS_HD Aux pops::load_aux ( const ConstArray4 a,
int  i,
int  j 
)
inline

load_aux<NComp>: reads NComp components of the auxiliary from an Array4 at (i,j).

The first 3 components (phi, grad_x, grad_y) are the base contract. Components >= 3 (B_z, T_e...) are read only if NComp > their canonical index (if constexpr guard -> zero codegen for NComp = kAuxBaseComps = 3: bit-identical). The extra fields are governed by POPS_AUX_FIELDS (state.hpp): adding a field => 1 line in POPS_AUX_FIELDS, not in this path. POPS_HD.

+ Here is the caller graph for this function:

◆ load_imbalance()

double pops::load_imbalance ( const BoxArray ba,
const DistributionMapping dm,
int  nranks 
)
inline
+ Here is the call graph for this function:

◆ load_state()

template<class Model >
POPS_HD Model::State pops::load_state ( const ConstArray4 a,
int  i,
int  j 
)
inline

load_state<Model>: reads Model::n_vars scalars at (i,j) from an Array4.

Returns a StateVec<n_vars> initialized from components 0..n_vars-1 of the channel. POPS_HD, zero allocation. Does NOT read components beyond n_vars.

◆ make_block()

template<class Model >
POPS_COLD_FN BlockClosures pops::make_block ( const Model &  m,
const std::string &  lim,
const std::string &  riem,
const GridContext ctx,
bool  imex,
bool  recon_prim,
const std::string &  method = "ssprk2",
const std::vector< int > &  implicit_components = {},
const NewtonOptions newton_opts = {},
NewtonReport newton_report = nullptr,
Real  pos_floor = Real(0),
bool  wave_speed_cache = false 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ make_block_hll()

template<class Model >
POPS_COLD_FN BlockClosures pops::make_block_hll ( const Model &  m,
const std::string &  lim,
const GridContext ctx,
bool  imex,
bool  recon_prim,
const std::string &  method,
const std::vector< int > &  implicit_components,
const NewtonOptions newton_opts,
NewtonReport newton_report,
Real  pos_floor,
bool  wave_speed_cache 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ make_block_hllc()

template<class Model >
POPS_COLD_FN BlockClosures pops::make_block_hllc ( const Model &  m,
const std::string &  lim,
const GridContext ctx,
bool  imex,
bool  recon_prim,
const std::string &  method,
const std::vector< int > &  implicit_components,
const NewtonOptions newton_opts,
NewtonReport newton_report,
Real  pos_floor 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ make_block_polar()

template<class Model >
BlockClosures pops::make_block_polar ( const Model &  m,
const std::string &  lim,
const std::string &  riem,
const PolarGridContext ctx,
bool  recon_prim,
const std::string &  method,
bool  wall_radial,
Real  pos_floor = Real(0) 
)

Dispatch of the spatial scheme (frozen limiter, Riemann flux) -> compiled polar closures.

Two fluxes wired in polar, SAME template injection point as the cartesian one (build_block_polar carries the Flux parameter down to assemble_rhs_polar<Limiter, Flux>):

  • "rusanov": RusanovFlux, requires only max_wave_speed (valid for scalar ExB AND the isothermal fluid) – DEFAULT, strictly bit-identical to history;
  • "hll": HLLFlux (signed waves), GATE identical to the cartesian one (make_block) on the presence of model.wave_speeds. The polar isothermal fluid (IsothermalFluxPolar: inherits IsothermalFlux::wave_speeds) is eligible -> HLL less diffusive than Rusanov on the ring. The scalar ExB (ExBVelocityPolar, no wave_speeds) -> CLEAR rejection. HLLC/Roe stay NOT wired in polar (assume n_vars==4 Euler with energy, without a polar energy-flux brick) -> explicit rejection. "weno5" routes assemble_rhs_polar onto the WENO5-Z reconstruction (3 ghosts) like the cartesian one. wall_radial: solid radial wall (mass conservation to machine precision; see build_block_polar).
+ Here is the call graph for this function:

◆ make_block_roe()

template<class Model >
POPS_COLD_FN BlockClosures pops::make_block_roe ( const Model &  m,
const std::string &  lim,
const GridContext ctx,
bool  imex,
bool  recon_prim,
const std::string &  method,
const std::vector< int > &  implicit_components,
const NewtonOptions newton_opts,
NewtonReport newton_report,
Real  pos_floor 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ make_block_rusanov()

template<class Model >
POPS_COLD_FN BlockClosures pops::make_block_rusanov ( const Model &  m,
const std::string &  lim,
const GridContext ctx,
bool  imex,
bool  recon_prim,
const std::string &  method,
const std::vector< int > &  implicit_components,
const NewtonOptions newton_opts,
NewtonReport newton_report,
Real  pos_floor 
)

Dispatch of the spatial scheme (limiter x Riemann flux) -> compiled closures.

HLLC / Roe guarded by requires: they demand a 4-variable transport exposing pressure (otherwise an explicit error). "weno5" = WENO5-Z reconstruction (order 5, 5-point stencil, 3 ghosts); spatial_operator routes to weno5z when Limiter::n_ghost >= 3 (the caller must allocate 3 ghosts, cf. block_n_ghost). method chooses the EXPLICIT advance (ssprk2 by default, ssprk3 | euler optional); no effect in IMEX. implicit_components: IMEX implicit mask carried by the block (indices; empty = model default, bit-identical). cf. build_block.

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

◆ make_cell_convert()

template<class Model >
std::pair< std::function< void(const double *, double *)>, std::function< void(const double *, double *)> > pops::make_cell_convert ( const Model &  m)

PER-CELL (one cell) cons <-> prim conversions of the MODEL, type-erased over arrays of Model::n_vars doubles.

First = primitive -> conservative (M.to_conservative, init from the primitives), second = conservative -> primitive (M.to_primitive, diagnostic). Captures the model by value (frozen when the block is added). For a model WITHOUT a conversion (pure scalar, no hyperbolic brick) both are the IDENTITY – exact for a scalar transport (prim == cons). Model::Prim shares the Model::n_vars width of State (HyperbolicPhysicalModel contract), so the flat arrays align component by component. Shared by add_block (native) and add_compiled_model (compiled): the SAME conversion serves both paths.

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

◆ make_cfl_speed_polar()

template<class Model >
std::function< Real(const MultiFab &)> pops::make_cfl_speed_polar ( const Model &  m,
const MultiFab aux 
)

CFL speed of the POLAR block: lambda* (HasStabilitySpeed trait) if the model declares it, otherwise max_wave_speed (historical PolarMaxSpeed, bit-identical) – SAME policy as cartesian make_max_speed.

◆ make_dynamic()

template<class M >
std::unique_ptr< IModel< M::n_vars > > pops::make_dynamic ( model = {})

Factory: wraps a static model in an owned IModel (unique_ptr).

◆ make_elliptic_solver()

template<class Solver , class... Args>
Solver pops::make_elliptic_solver ( const Geometry geom,
const BoxArray ba,
const EllipticProblem problem,
Args &&...  args 
)
inline

◆ make_implicit_mask()

template<int N>
POPS_COLD_FN ImplicitMask< N > pops::make_implicit_mask ( const std::vector< int > &  implicit_components)

Builds the device-clean POD implicit mask of an N-variable model from a list of component indices (empty -> INACTIVE mask -> model default, bit-identical).

Any index outside [0, N) is ignored here (the validation / clear message lives on the System::add_block side, which resolves names/roles into indices and throws on an absent name/role).

◆ make_knapsack_distribution()

DistributionMapping pops::make_knapsack_distribution ( const BoxArray ba,
int  nranks 
)
inline
+ Here is the call graph for this function:

◆ make_max_speed()

template<class Model >
std::function< Real(const MultiFab &)> pops::make_max_speed ( const Model &  m,
const GridContext ctx 
)

Closure of the speed used by the block CFL step.

If the model declares the OPTIONAL stability_speed trait (HasStabilitySpeed), THAT is what drives the CFL (stability lambda*); otherwise STRICT fallback on max_wave_speed (historical behavior, bit-identical). The Riemann solvers always read max_wave_speed: this choice only changes the step policy.

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

◆ make_max_speed_polar()

template<class Model >
std::function< Real(const MultiFab &)> pops::make_max_speed_polar ( const Model &  m,
const MultiFab aux 
)

Max wave-speed closure of the POLAR block (for the CFL step).

aux points to the System's aux (stable address): the polar ExB speed comes from grad_r / grad_theta of the aux.

◆ make_poisson_rhs()

template<class Model >
std::function< void(const MultiFab &, MultiFab &)> pops::make_poisson_rhs ( const Model &  m)

Block contribution to the Poisson right-hand side: rhs += elliptic_rhs(U) (host loop).

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

◆ make_poisson_rhs_polar()

template<class Model >
std::function< void(const MultiFab &, MultiFab &)> pops::make_poisson_rhs_polar ( const Model &  m)

Block contribution to the POLAR Poisson right-hand side: rhs += elliptic_rhs(U) (host loop).

◆ make_sfc_distribution()

DistributionMapping pops::make_sfc_distribution ( const BoxArray ba,
int  nranks 
)
inline
+ Here is the call graph for this function:

◆ make_source_frequency()

template<class Model >
std::function< Real(const MultiFab &)> pops::make_source_frequency ( const Model &  m,
const GridContext ctx 
)

Closure of the block max source frequency (bound dt <= cfl * substeps / (stride * mu)).

EMPTY (null std::function) if the model does not declare the trait -> the stepper ignores it (historical behavior).

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

◆ make_source_frequency_polar()

template<class Model >
std::function< Real(const MultiFab &)> pops::make_source_frequency_polar ( const Model &  m,
const MultiFab aux 
)

Max source frequency of the POLAR block (HasSourceFrequency trait); EMPTY without the trait (the stepper does not query it, historical step policy).

◆ make_stability_dt()

template<class Model >
std::function< Real(const MultiFab &)> pops::make_stability_dt ( const Model &  m,
const GridContext ctx 
)

Closure of the block min admissible step (bound dt <= stability_dt * substeps / stride, WITHOUT cfl).

EMPTY if the model does not declare the trait -> ignored by the stepper (historical).

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

◆ make_stability_dt_polar()

template<class Model >
std::function< Real(const MultiFab &)> pops::make_stability_dt_polar ( const Model &  m,
const MultiFab aux 
)

Min admissible step of the POLAR block (HasStabilityDt trait); EMPTY without the trait.

◆ make_system_coupler()

template<class... Args>
auto pops::make_system_coupler ( Args &&...  args)

◆ max_source_frequency_mf()

template<class Model >
Real pops::max_source_frequency_mf ( const Model &  model,
const MultiFab U,
const MultiFab aux 
)
inline

Global max of the source frequency (HasSourceFrequency trait). 0 if the source does not constrain.

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

◆ max_stability_speed_mf()

template<class Model >
Real pops::max_stability_speed_mf ( const Model &  model,
const MultiFab U,
const MultiFab aux 
)
inline

Global max of the STABILITY speed (HasStabilitySpeed trait) – counterpart of max_wave_speed_mf.

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

◆ max_wave_speed_hotspot_mf()

template<class Model >
void pops::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 
)
inline

dt_hotspot diagnostic (ADC-182): the cell (GLOBAL indices) that dominates the block's transport CFL bound, and its speed w = max(wx, wy).

ON DEMAND only – two full passes (max then location by bit-exact equality), step_cfl does not touch it (bit-identical). MPI: all_reduce of the max then all_reduce_min of the encoded index (+inf on the non-holder ranks). nx: domain width (encoding j*nx + i).

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

◆ max_wave_speed_mf()

template<class Model >
Real pops::max_wave_speed_mf ( const Model &  model,
const MultiFab U,
const MultiFab aux 
)
inline

max_wave_speed_mf: global max of the wave speed over the whole MultiFab (CFL).

Reduce over all local boxes then all_reduce_max over all MPI ranks. Without the all_reduce, each rank only sees its boxes and step_cfl computes a different dt per rank (desynchronization / divergence). In serial all_reduce_max is the identity. For a model without transport (max_wave_speed = 0 everywhere) -> returns 0 (step unconstrained).

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

◆ mf_advance_faces()

void pops::mf_advance_faces ( MultiFab U,
const MultiFab Fx,
const MultiFab Fy,
Real  dx,
Real  dy,
Real  dt 
)
inline
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mf_apply_source()

template<class Model >
void pops::mf_apply_source ( const Model &  m,
MultiFab U,
const MultiFab aux,
Real  dt 
)
inline
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mf_apply_source_treatment()

template<class Model >
void pops::mf_apply_source_treatment ( const Model &  m,
MultiFab U,
const MultiFab aux,
Real  dt,
bool  imex,
const NewtonOptions nopts = {} 
)
inline

◆ mf_average_down()

void pops::mf_average_down ( const MultiFab Uf,
MultiFab Uc,
int  CI0,
int  CI1,
int  CJ0,
int  CJ1 
)
inline
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mf_average_down_mb()

void pops::mf_average_down_mb ( const MultiFab Uf,
MultiFab Uc 
)
inline
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mf_average_down_multi()

void pops::mf_average_down_multi ( const MultiFab Uf,
MultiFab Uc 
)
inline
+ Here is the call graph for this function:

◆ mf_eval_rhs()

template<class Model >
void pops::mf_eval_rhs ( const Model &  m,
const MultiFab U,
const MultiFab aux,
const MultiFab Fx,
const MultiFab Fy,
Real  dx,
Real  dy,
MultiFab R 
)
inline
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mf_fill_fine_ghosts_mb()

void pops::mf_fill_fine_ghosts_mb ( MultiFab Uf,
const MultiFab Po,
const MultiFab Pn,
Real  frac,
bool  replicated_parent = true,
Real  pos_floor = Real(0),
int  pos_comp = 0 
)
inline
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mf_fill_fine_ghosts_multi()

void pops::mf_fill_fine_ghosts_multi ( MultiFab Uf,
const MultiFab Uc_old,
const MultiFab Uc_new,
Real  frac 
)
inline
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mf_fill_fine_ghosts_t()

void pops::mf_fill_fine_ghosts_t ( MultiFab Uf,
const MultiFab Uc_old,
const MultiFab Uc_new,
Real  frac,
Real  pos_floor = Real(0),
int  pos_comp = 0 
)
inline
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mf_find_box()

int pops::mf_find_box ( const MultiFab mf,
int  I,
int  J 
)
inline
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ min_stability_dt_mf()

template<class Model >
Real pops::min_stability_dt_mf ( const Model &  model,
const MultiFab U,
const MultiFab aux 
)
inline

Global min of the declared admissible step (HasStabilityDt trait), via max(1/dt) (cf.

InvStabilityDtKernel).

Returns
0 if NO cell constrains (the block imposes no bound).
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ model_is_implicit()

template<class Model >
POPS_HD bool pops::model_is_implicit ( int  c)
inline

◆ module_capabilities()

ModuleCapabilities pops::module_capabilities ( CapabilityTarget  target = CapabilityTarget::kModule)
inline

The module's STATIC capability facts for a given lowering route target (Spec 5 sec.13.12 / #36).

All values come from compile-time tokens, never a Python computation:

  • abi_version = pops::kAbiVersion;
  • supports_uniform / supports_amr = true (both runtimes are built into _pops);
  • supports_mpi = POPS_HAS_MPI;
  • supports_gpu = POPS_HAS_KOKKOS AND a device token (else false, conservatively honest);
  • supports_stride = true for the production / native route, false for the AOT / prototype route (which hardcodes stride=1) and for the route-agnostic kModule query;
  • supports_named_fields = true (the named-aux transport exists, kAuxNamedBase / aux_field);
  • supports_partial_imex_mask = false (NO C++ path backs it – reporting true would be a lie).

◆ morton_key()

std::uint64_t pops::morton_key ( std::uint32_t  x,
std::uint32_t  y 
)
inline
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ morton_order()

std::vector< int > pops::morton_order ( const BoxArray ba)
inline
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ my_rank()

int pops::my_rank ( )
inline
+ Here is the caller graph for this function:

◆ n_ranks()

int pops::n_ranks ( )
inline
+ Here is the caller graph for this function:

◆ names_csv()

std::string pops::names_csv ( const VariableSet vs)
inline

CSV of a VariableSet's names (separator ',').

Building block of the TEXT metadata that a generated .so exposes: the extern "C" ABI does not carry a C++ object, so we serialize to a string.

+ Here is the caller graph for this function:

◆ newton_finite()

POPS_HD bool pops::newton_finite ( Real  x)
inline

Finite? (device-safe, without <cmath>: NaN fails x == x; +-inf fails the bounds).

Used by the INSTRUMENTED Newton path only (the default path tests nothing, bit-identical).

+ Here is the caller graph for this function:

◆ norm_inf()

Real pops::norm_inf ( const MultiFab mf,
int  comp = 0 
)
inline

Infinity norm max |f(.,.,comp)| over the valid cells (LOCAL, without MPI all_reduce).

EXACT on all backends (max without rounding, associative/commutative) -> bit-identical everywhere.

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

◆ operator*()

template<int N>
POPS_HD StateVec< N > pops::operator* ( Real  s,
StateVec< N >  a 
)

◆ operator+()

template<int N>
POPS_HD StateVec< N > pops::operator+ ( StateVec< N >  a,
const StateVec< N > &  b 
)

◆ operator-()

template<int N>
POPS_HD StateVec< N > pops::operator- ( StateVec< N >  a,
const StateVec< N > &  b 
)

◆ parallel_copy()

void pops::parallel_copy ( MultiFab dst,
const MultiFab src 
)
inline

Copies the valid regions that OVERLAP from src to dst (same indices, no shift).

General redistribution between two MultiFab over the same domain with different decompositions. Copies min(ncomp) components. A dst cell not covered by src is left intact.

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

◆ parse_roles_into()

void pops::parse_roles_into ( VariableSet vs,
const std::string &  csv 
)
inline

Inverse of roles_csv: fill vs.roles (and vs.user_roles for any NON-canonical token) from a roles CSV.

A canonical token (role_from_name) maps to its enum with an empty user label; a non-canonical token maps to VariableRole::Custom keeping the token as its user-role label, so a user role survives the .so ABI round-trip. user_roles stays EMPTY when every token is canonical (bit-identical to historical roleless / canonical blocks). Empty csv leaves both empty.

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

◆ part1by1()

std::uint64_t pops::part1by1 ( std::uint64_t  x)
inline
+ Here is the caller graph for this function:

◆ poisson_residual()

void pops::poisson_residual ( MultiFab phi,
const MultiFab f,
const Geometry geom,
const BCRec bc,
MultiFab res,
const MultiFab mask = nullptr,
const MultiFab coef = nullptr,
const MultiFab eps = nullptr,
const MultiFab kappa = nullptr,
const MultiFab eps_y = nullptr,
const MultiFab a_xy = nullptr,
const MultiFab a_yx = nullptr 
)
inline
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ real_eig_minmax()

template<int N>
POPS_HD EigBounds pops::real_eig_minmax ( const Real(&)  A[N][N],
int  max_iter_per_eig = 100,
bool *  fallback = nullptr 
)
inline

Extremes of the REAL PARTS of the spectrum of a small dense block A, plus the largest |Im| encountered and a convergence indicator (see the file header for the full contract: Gershgorin fallback on non-convergence, max_im as a hyperbolicity-loss detector).

max_iter_per_eig: QR iteration cap per active block (default 100). The historical EISPACK heuristic (30) does not suffice on near-degenerate companion blocks (near-double eigenvalues) where deflation crawls: such a 5x5 block needs ~42 iterations, and below 30 it silently fell back (wave speed over-estimated ~9x). 100 leaves more than double the margin; the overhead is paid ONLY by pathological blocks (healthy cases converge in a few iterations). 0 forces the fallback AS SOON AS an active block >= 3 exists (useful for testing the caller's contract); a matrix that deflates entirely into 1x1 / 2x2 blocks (quasi-triangular) never iterates and converges even at cap 0. fallback: if non-null, receives true when the Gershgorin fallback triggered (spectrum NOT computed), false otherwise. Default nullptr -> behavior unchanged for any existing caller; mirror of !EigBounds::converged, for whoever wants only the flag (e.g. OR over several blocks).

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

◆ real_spectrum()

template<int N>
POPS_HD Spectrum pops::real_spectrum ( const Real(&)  A[N][N],
Real  im_tol = Real(1e-5),
int  max_iter_per_eig = 100 
)
inline

Classify the spectrum of a small dense block A as kReal / kComplexPair / kUnknown (ADC-276): a GENERIC, device-safe predicate over the SAME Francis-QR path as real_eig_minmax (no second algorithm to keep in sync).

im_tol is the RELATIVE imaginary tolerance of EigBounds::all_real (default 1e-5, scaled by max(|lmin|, |lmax|, 1); covers a real multiplicity up to m=3, the 3x3 target – see EigBounds::all_real for the tolerance contract, multiplicity coverage, and the relative-tolerance asymmetry). NON-CONVERGENCE under max_iter_per_eig returns kUnknown BEFORE any max_im read, so the Gershgorin fallback's max_im = 0 convention can never be mistaken for a real spectrum. Intended consumer: a native realizability / hyperbolicity check on small Jacobian or moment blocks (e.g. a 3x3 HyQMOM15 sub-block) with no NumPy and no host callback; the core stays free of any model specifics. Need the extremes too? Call real_eig_minmax and use the EigBounds predicates directly.

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

◆ reconstruct()

template<class Model , class Limiter >
POPS_HD Model::State pops::reconstruct ( const Model &  model,
const ConstArray4 u,
int  i,
int  j,
int  dir,
Real  sgn,
const Limiter &  lim,
bool  prim 
)
inline

reconstruct<Model,Limiter>: face value at (i,j) extrapolated in direction dir.

sgn = +1 -> +dir face of (i,j); sgn = -1 -> -dir face. Reconstructs in PRIMITIVE variables if prim == true AND if Model exposes HasPrimitiveVars (positivity of rho and p for Euler); otherwise in conservative variables. The returned state is ALWAYS conservative. NoSlope (n_ghost == 1): zero slope, prim has no effect – pure conservative path. INVARIANT: POINTWISE function, does NOT loop over the grid. POPS_HD.

+ Here is the call graph for this function:

◆ reconstruct_pp()

template<class Model , class Limiter >
POPS_HD Model::State pops::reconstruct_pp ( const Model &  model,
const ConstArray4 u,
int  i,
int  j,
int  dir,
Real  sgn,
const Limiter &  lim,
bool  prim,
Real  pos_floor,
int  pos_comp 
)
inline

reconstruct_pp: reconstruct + zhang_shu_scale positivity limiter on the returned state.

(i, j) is the SOURCE cell of the reconstruction: it is to ITS average that the face state is brought back. pos_floor <= 0 -> strictly identical to reconstruct (short-circuit). POPS_HD.

◆ reduce_max()

Real pops::reduce_max ( const MultiFab mf,
int  comp = 0 
)
inline

Signed maximum max_cells f(.,.,comp) over component comp, reduced over ALL ranks (all_reduce_max) – the compiled-Program P.max reduction (SIGNED, not the magnitude – use norm_inf for max|f|).

COLLECTIVE, MANDATORY UNDER MPI: an empty rank seeds -inf so the all_reduce_max ignores it. EXACT everywhere (max without rounding, associative/commutative).

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

◆ reduce_max_cell()

template<class F >
Real pops::reduce_max_cell ( const Box2D b,
f 
)

MAX reduction with a REDUCING FUNCTOR: f receives (i, j, Real& acc) and updates acc, passed DIRECTLY to Kokkos::parallel_reduce without a wrapper lambda (device-clean path for a kernel instantiated cross-TU).

Bit-exactness identical to for_each_cell_reduce_max.

+ Here is the caller graph for this function:

◆ reduce_min()

Real pops::reduce_min ( const MultiFab mf,
int  comp = 0 
)
inline

Signed minimum min_cells f(.,.,comp) over component comp, reduced over ALL ranks (all_reduce_min) – the compiled-Program P.min reduction.

COLLECTIVE, MANDATORY UNDER MPI: an empty rank seeds +inf so the all_reduce_min ignores it. EXACT everywhere (min without rounding, associative/commutative).

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

◆ reduce_min_cell()

template<class F >
Real pops::reduce_min_cell ( const Box2D b,
f 
)
+ Here is the caller graph for this function:

◆ reduce_sum()

Real pops::reduce_sum ( const MultiFab mf,
int  comp = 0 
)
inline

Sum Sum_cells f(.,.,comp) over component comp, reduced over ALL ranks (all_reduce_sum) – the compiled-Program P.sum / P.sum_component reduction.

COLLECTIVE, MANDATORY UNDER MPI: called on every rank (an empty rank contributes 0), like dot. Same per-tile Kokkos::Sum FP guarantees as dot.

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

◆ reduce_sum_cell()

template<class F >
Real pops::reduce_sum_cell ( const Box2D b,
f 
)

SUM reduction with a REDUCING FUNCTOR: f receives (i, j, Real& acc) and accumulates, passed DIRECTLY to Kokkos::parallel_reduce without a wrapper lambda (device-clean cross-TU path).

Same FP guarantees as for_each_cell_reduce_sum (Kokkos::Sum reassociated per tile, deterministic/idempotent).

+ Here is the caller graph for this function:

◆ regrid_compute_fine_layout()

std::pair< BoxArray, DistributionMapping > pops::regrid_compute_fine_layout ( TagBox  grown,
const Box2D pdom,
int  pk,
int  margin,
bool  coarse_replicated = true 
)
inline

Compute the fine layout (BoxArray + DistributionMapping) of a Berger-Rigoutsos regrid from the grown tags ALREADY dilated (grow_tags) on the PARENT domain pdom.

pk: parent level (the cross-rank MPI reduction only happens for pk==0 distributed); margin: nesting; coarse_replicated: ownership policy of level 0. Fine level coords = parent x2. Returns an EMPTY BoxArray if there is nothing to refine (the caller then keeps the current grid). MPI-safe: under a distributed coarse level, the global OR of the tags (all_reduce_or) guarantees IDENTICAL patches on all ranks (otherwise incompatible dmaps).

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

◆ regrid_field_on_layout()

MultiFab pops::regrid_field_on_layout ( const BoxArray fb,
const DistributionMapping dmap,
const MultiFab par,
const MultiFab old,
int  pk,
int  ngf,
bool  coarse_replicated = true 
)
inline

Rebuild ONE fine MultiFab on the IMPOSED layout fb / dmap (the same one for all blocks in multi-block): (a) piecewise-constant interpolation from the parent par where the new patch is not covered by the old fine, (b) carry-over of the existing fine data old where the old patch covers the new one.

ngf: fine ghost width (inherited from the old level being replaced); coarse_replicated: ownership policy of level 0 (distributed parent -> parallel_copy + fence). This is the BODY of the old amr_regrid_finest, without the layout computation. The parent's pk is passed to decide whether the parent is replicated (pk != 0 -> always distributed). Returns the new MultiFab.

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

◆ regrid_level()

template<class Crit >
void pops::regrid_level ( AmrHierarchy h,
int  coarse_lev,
Crit  crit,
const RegridParams rp = {} 
)

(Re)builds level coarse_lev+1 from the tagging of level coarse_lev.

Template Parameters
Crittagging predicate (ConstArray4, i, j) -> bool.
Parameters
hhierarchy modified in place (fine level installed, or finer levels removed if no tag).
coarse_levcoarse level source of the tagging; the built fine level is coarse_lev+1.
rpparameters (tag buffer, clustering). Steps: tag -> grow -> Berger-Rigoutsos -> refine(ref_ratio) -> interpolation from the coarse level, then a copy of the old fine level where it existed to preserve accuracy.

◆ require_supported_ref_ratio()

void pops::require_supported_ref_ratio ( int  ratio)
inline

Validates a requested AMR refinement ratio at the hierarchy boundary.

Parameters
ratiorefinement ratio requested for an AMR hierarchy.
Exceptions
std::invalid_argumentif ratio is not the supported value.
+ Here is the caller graph for this function:

◆ reset_halo_schedule_build_count()

void pops::reset_halo_schedule_build_count ( )
inline

Resets the build counter (tests).

◆ resolve_implicit_components_compiled()

std::vector< int > pops::resolve_implicit_components_compiled ( const std::string &  block,
const VariableSet cons,
const std::vector< std::string > &  names,
const std::vector< std::string > &  roles 
)
inline

Resolves the partial IMEX MASK (implicit_vars / implicit_roles) of a COMPILED block into indices of conserved components, against the conservative descriptor cons of the CONCRETE Model (known here).

SAME strict logic as resolve_implicit_components of amr_system.cpp (missing name/role -> error; unique sorted indices) – replicated here because this header does not depend on the facade .cpp. EMPTY input -> empty -> inactive mask (full backward-Euler). Used by the multi-block runtime builder.

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

◆ richardson_solve()

KrylovResult pops::richardson_solve ( const ApplyFn A,
MultiFab phi,
const MultiFab rhs,
Real  omega,
Real  rel_tol,
int  max_iters 
)
inline

Richardson iteration x <- x + omega (b - A x), solving A x = b.

Simplest matrix-free relaxation; converges for any A whose eigenvalues lie in (0, 2/omega) (e.g. an SPD operator with omega below 1/lambda_max). Allocates ONE scratch (r), reused across the loop.

Parameters
Amatrix-free operator out <- A(in).
phiunknown, IN (initial guess) / OUT (solution).
rhsright-hand side b (unchanged).
omegarelaxation factor.
rel_tolstop when ||r|| <= rel_tol * ||b||.
max_itersiteration budget; <= 0 throws std::invalid_argument.
Returns
iterations, relative residual, convergence flag.
+ Here is the call graph for this function:

◆ roe_abs_apply()

template<int N>
POPS_HD bool pops::roe_abs_apply ( const Real(&)  A[N][N],
const Real(&)  dU[N],
Real(&)  out[N],
int  max_iter = 80,
Real  tol = Real(1e-13) 
)
inline

Roe matrix-absolute-value applied to a state jump: out = |A| dU, with |A| the SPECTRAL absolute value A * sign(A).

sign(A) is computed by the determinant-free, infinity-norm-SCALED Newton matrix-sign iteration S_{k+1} = 1/2 (mu S_k + 1/mu S_k^-1), mu = sqrt(||S^-1||/||S||), which converges quadratically for a real spectrum off the imaginary axis. For a real-diagonalizable A this is EXACTLY R |Lambda| R^-1 dU – the Roe dissipation of the reference flux_ROE_local.m (whose Harten floor |lambda| < 1e-6 is inactive at O(1) wave speeds, so omitting it here is exact for the smooth eigenmode / diocotron states this targets).

Returns false (out untouched) and leaves the dissipation to the caller (e.g. a spectral-radius Rusanov bound from real_eig_minmax) when |A| is not a faithful real spectral function:

  • the spectrum is not real (real_spectrum != kReal): A * sign(A) would keep the sign-of-real-part of a complex eigenvalue, NOT its modulus, so it would diverge from the reference;
  • A is singular / near-singular (a zero eigenvalue is on the imaginary axis: sign undefined) or the iteration does not converge within max_iter. POPS_HD, no allocation, N <= 16 (the dense-eig stack-buffer limit).
+ Here is the call graph for this function:

◆ role_from_name()

VariableRole pops::role_from_name ( const std::string &  s)
inline

Forward declaration: VariableSet::index_of(const std::string&) resolves a canonical role NAME via role_from_name (defined below) before matching a user-defined role label.

Inverse of role_name: physical role from its stable name (Custom if unknown).

Used to reconstruct a VariableSet with roles from TEXT metadata (e.g. the string carried by a compiled / dynamic .so: the extern "C" ABI carries only strings, not the enum).

+ Here is the caller graph for this function:

◆ role_name()

const char * pops::role_name ( VariableRole  r)
inline

Human-readable name of a role (introspection, Python binding).

Stable: used as a key on the application side.

+ Here is the caller graph for this function:

◆ roles_csv()

std::string pops::roles_csv ( const VariableSet vs)
inline

CSV of a VariableSet's roles (role_name, separator ',').

A component carrying a user-defined role label (user_roles, Custom role) emits its LABEL instead of "custom", so the user role round-trips through the .so ABI (parse_roles_into is the inverse). EMPTY if the model does not provide its roles (vs.roles empty): the consumer then falls back to indices (backward compatibility).

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

◆ roles_meta()

template<class Model >
std::string pops::roles_meta ( )

A model's "roles" metadata: "cons_roles_csv|prim_roles_csv" (empty side = roles not provided).

+ Here is the call graph for this function:

◆ run_explicit_substeps()

template<class Stepper , class RhsEval >
void pops::run_explicit_substeps ( RhsEval &&  rhs,
MultiFab U,
Real  h,
int  n 
)
inline

◆ rusanov_flux()

template<class Model >
POPS_HD Model::State pops::rusanov_flux ( const Model &  m,
const typename Model::State &  UL,
const Aux AL,
const typename Model::State &  UR,
const Aux AR,
int  dir 
)
inline

rusanov_flux: free compat, delegates to RusanovFlux{} (policy of numerical_flux.hpp).

Kept for the serial references (GPU demos, unit tests) that call rusanov_flux directly. Prefer RusanovFlux{} passed as a template for new calls. POPS_HD.

+ Here is the caller graph for this function:

◆ saxpy()

void pops::saxpy ( MultiFab y,
Real  a,
const MultiFab x 
)
inline

y <- y + a x over ALL components of the valid cells. Identical layouts required.

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

◆ source_choices()

std::string pops::source_choices ( )
inline
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ source_tags_csv()

std::string pops::source_tags_csv ( )
inline

Pipe list of source / elliptic tags (e.g. "charge|background|gravity").

+ Here is the call graph for this function:

◆ strang_step()

template<class TransportStep , class SourceStep >
void pops::strang_step ( MultiFab U,
Real  dt,
TransportStep  T,
SourceStep  S 
)

◆ suggest_bin()

int pops::suggest_bin ( const BoxArray ba)
inline

Recommended bin size for a BoxArray: the largest box extent (at least 1), so that neighboring boxes fall into adjacent bins (memory / selectivity trade-off).

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

◆ sum()

Real pops::sum ( const MultiFab mf,
int  comp = 0 
)
inline

Sum of the VALID cells of component comp, reduced over ALL ranks (all_reduce).

COLLECTIVE under MPI. FP NOTE: Kokkos::Sum reassociates per tile (deterministic/idempotent, not bit-identical to a lexicographic sum).

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

◆ sync_device()

void pops::sync_device ( )
inline

Marks a DEVICE residency (upcoming kernel).

Under unified memory: NO-OP (host writes are already visible from the device); exists to document the intent and to accommodate a future deep_copy host->device on a non-unified path.

+ Here is the caller graph for this function:

◆ sync_host()

void pops::sync_host ( )
inline

Makes the HOST residency valid before a host access (read/write from the host).

Under unified memory = a targeted device_fence() (waits for in-flight kernels).

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

◆ tag_cells()

template<class Crit >
TagBox pops::tag_cells ( const MultiFab mf,
const Box2D domain,
Crit  crit 
)

Marks the valid cells where the predicate is true, on a TagBox covering the domain.

Template Parameters
Critpredicate (ConstArray4, i, j) -> bool, evaluated on the valid cells of each fab.
Parameters
mfsource field (local: only iterates over the rank's local fabs).
domaindomain covered by the returned TagBox (level index space).
Returns
TagBox over domain, marked where crit is true.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tag_union()

TagBox pops::tag_union ( const std::vector< TagBox > &  parts)
inline

Union (cell-by-cell logical OR) of several TagBox sharing EXACTLY the same box.

Building block of the multi-block tag-union regrid (conservative regrid = common hierarchy, co-located cells, union of tags; docs/AMR_REGRID_UNION_TAGS_DESIGN.md step R3).

Parameters
partsTagBox to merge; all MUST cover the same parent domain.
Returns
TagBox on the common box, marked where at least one member was; empty list -> empty TagBox.
Exceptions
std::runtime_errorif a box disagrees (linear indexing would mix two geometries).
+ Here is the caller graph for this function:

◆ throw_registry_dispatch_mismatch()

void pops::throw_registry_dispatch_mismatch ( const char *  ctx,
const char *  kind,
const std::string &  tag 
)
inline

DEFENSE-IN-DEPTH guard: reached only if a VALID tag (already accepted by validate_*) is routed by NO branch of the if/else dispatch – this is an inconsistency between the registry (kLimiters/kRiemanns) and the dispatch, hence a programming bug, not a user input.

Replaces the old final throw "unknown limiter" / "unknown Riemann flux", now unreachable since the centralized validation precedes the dispatch. kind = "limiter" or "flux".

+ Here is the caller graph for this function:

◆ transport_choices()

std::string pops::transport_choices ( )
inline

Quoted " | "-separated choices (e.g.

"'exb' | 'compressible' | 'isothermal'"), as used in the completeness messages of validate_model_spec.

+ Here is the call graph for this function:

◆ transport_n_vars()

int pops::transport_n_vars ( const std::string &  tag)
inline

Conservative-variable count of a transport tag (source of truth for the static_assert below), or -1 if unknown.

_ct is the COMPILE-TIME variant used by the non-drift static_assert in model_factory.hpp (that TU sees both this table and the brick types). The char compare is inlined to keep this header self-contained (no shared ct_str_eq -> no ODR coupling with dispatch_tags.hpp).

◆ transport_n_vars_ct()

constexpr int pops::transport_n_vars_ct ( const char *  name)
constexpr

◆ transport_tags_csv()

std::string pops::transport_tags_csv ( bool  polar = false)
inline

Pipe list of transport tags ("exb|compressible|isothermal"), as used in the dispatch rejection messages.

polar restricts to the polar-wired subset ("exb|isothermal") for the polar message.

+ Here is the caller graph for this function:

◆ unknown_elliptic_msg()

std::string pops::unknown_elliptic_msg ( const std::string &  tag)
inline
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unknown_transport_msg()

std::string pops::unknown_transport_msg ( const std::string &  tag)
inline

Rejection message for an unknown transport / elliptic tag, BYTE-IDENTICAL to the historical inline throws (the tag list now comes from the SINGLE table).

No context prefix: every model dispatch site shares this exact message (unlike the limiter / flux validators of dispatch_tags.hpp, which carry a per-call-site context because the same tag appears under System / AMR / polar prefixes).

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

◆ validate_elliptic()

void pops::validate_elliptic ( const std::string &  tag)
inline
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ validate_limiter()

void pops::validate_limiter ( const std::string &  lim,
const char *  ctx = "System" 
)
inline

Validates a LIMITER tag against kLimiters.

Throws if unknown, with the HISTORICAL message "<ctx>: unknown limiter '<lim>'" (some tests grep "unknown limiter"). ctx = call-site prefix ("System", "add_block(AmrSystem, multi-blocks)", "add_compiled_model(AmrSystem)", "System (polar)") -> message STRICTLY identical to the old inline throw of each dispatch.

+ Here is the caller graph for this function:

◆ validate_newton_options()

void pops::validate_newton_options ( const NewtonOptions newton,
const char *  where 
)
inline

Range-validate a NewtonOptions POD; shared by System::add_block and AmrSystem::add_block, which carried this defensive check verbatim.

where prefixes each message ("System::add_block" / "AmrSystem::add_block"). fail_policy is already a valid integer (the bindings resolve it from the string "none"/"warn"/"throw"); the range stays defensive. This does NOT decide whether non-default options are ALLOWED – the time='imex' gate (and System's extra newton_diagnostics term in the non-default test) differ between the two callers and remain at each call site.

◆ validate_riemann()

void pops::validate_riemann ( const std::string &  riem,
bool  polar = false,
const char *  ctx = "System" 
)
inline

Validates a Riemann FLUX tag against kRiemanns.

polar: annular geometry (rusanov and hll are wired there). Throws if unknown (cartesian) or not wired in polar, with the HISTORICAL messages (some tests grep "Riemann flux", "rusanov", "unsupported"). Does NOT validate the model capabilities (hll/hllc/roe on a transport without signed waves / without pressure): these guards stay if constexpr PER MODEL at the call-site, with their "requires ..." messages unchanged.

+ Here is the caller graph for this function:

◆ validate_transport()

void pops::validate_transport ( const std::string &  tag)
inline

Validates a transport / elliptic tag against the builtin registry.

Throws the historical message on an unknown tag. The string->TYPE routing stays a per-site if chain (compile-time bricks); these validators give the SHARED rejection so the dispatch's final throw becomes a defense-in-depth registry/dispatch-consistency guard (never reached once the tag is accepted here). The validate-first invariant is specific to the model_factory dispatch; the per-transport binding seams (python/system.cpp, python/amr_system.cpp) instead reuse unknown_transport_msg as their if/else tail rejection (same message, single-sourced), since they route to per-TU builds rather than to types.

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

◆ var_names_meta()

template<class Model >
std::string pops::var_names_meta ( )

A model's "names" metadata: "cons_csv|prim_csv" (separator '|' between the two sets).

Read as-is by the consumer (System) via the optional symbol pops_compiled_var_names.

+ Here is the call graph for this function:

◆ weno5z()

POPS_HD Real pops::weno5z ( Real  vm2,
Real  vm1,
Real  v0,
Real  vp1,
Real  vp2 
)
inline

weno5z: WENO5-Z reconstruction (Borges 2008) at one interface, on a 5-point stencil.

Returns the reconstructed value at the face BETWEEN v0 and vp1 (face +dir of cell v0). For the -dir face, call weno5z(vp2, vp1, v0, vm1, vm2) (reversed stencil). POPS_HD. INVARIANT: purely combinatorial computation, no branch on signs – the beta and tau5 indicators are squares, always >= 0; only the absolute value of (b0-b2) is taken via a ternary (device-safe, avoids std::abs). Must NOT be called directly by a mesh user: go through the Weno5 policy and the reconstruct function of spatial_operator.hpp.

+ Here is the caller graph for this function:

◆ xface_box()

Box2D pops::xface_box ( const Box2D v)
inline

xface_box / yface_box: face boxes normal to x (resp.

y) associated with a cell box.

xface_box(v): nx+1 x ny (i in [lo..hi+1], j in [lo..hi]). yface_box(v): nx x ny+1 (i in [lo..hi], j in [lo..hi+1]). Used to size the MultiFab Fx, Fy received by compute_face_fluxes.

+ Here is the caller graph for this function:

◆ yface_box()

Box2D pops::yface_box ( const Box2D v)
inline
+ Here is the caller graph for this function:

◆ zero_conductor()

void pops::zero_conductor ( MultiFab phi,
const MultiFab mask 
)
inline
+ Here is the call graph for this function:

◆ zhang_shu_scale()

template<class Model >
POPS_HD void pops::zhang_shu_scale ( typename Model::State &  s,
const ConstArray4 u,
int  i,
int  j,
Real  floor,
int  pos_comp 
)
inline

zhang_shu_scale: POSITIVITY limiter on a reconstructed face state – LOCAL ORDER-1 FALLBACK (vacuum-robust variant of the Zhang & Shu scaling, JCP 2010).

If component pos_comp (Density role) of the face state s falls below floor, the WHOLE face state is replaced by the average of its SOURCE cell u(i,j,.) (locally zero slope). WHY not the paper's colinear theta-scaling (s <- ubar + theta (s - ubar), theta such that rho_face = floor): in CONSERVATIVE variables at the edge of a QUASI-VACUUM (a ~1e-6 background under a ~1e6 top-hat contrast), it sets rho_face = floor while leaving a face momentum O(average) -> the face VELOCITY v = m/rho diverges (~1e6) -> the Rusanov wave speed blows up whereas dt was chosen BEFORE on the cell velocities -> immediate blow-up (measured: NaN within a couple of steps, independent of the floor value). The paper couples its limiter to the recomputed CFL bound; here the fallback to the average bounds the face velocity by CONSTRUCTION (v_face = v_cell), stays conservative (the average is not touched), positive as soon as the average is, and degrades the order only on the offending faces (WENO5 intact everywhere else). Inactive if floor <= 0 (bit-identical path) or if the face is already >= floor. Motivation: WENO5 undershoots at the top-hat jump with 1e6 contrast -> negative face rho -> 1/rho and the Lorentz source detonate -> NaN (positivity-fallback provenance: docs/validation/HEADER_PROVENANCE.md). POINTWISE device-clean function. POPS_HD.

Variable Documentation

◆ block_stride_v

template<class Block >
constexpr int pops::block_stride_v = TimePolicyTraits<typename std::decay_t<Block>::Time>::stride
constexpr

◆ block_substeps_v

template<class Block >
constexpr int pops::block_substeps_v = TimePolicyTraits<typename std::decay_t<Block>::Time>::substeps
constexpr

◆ block_time_treatment_v

template<class Block >
constexpr TimeTreatment pops::block_time_treatment_v
constexpr
Initial value:
=
TimePolicyTraits<typename std::decay_t<Block>::Time>::treatment

◆ kAbiVersion

constexpr int pops::kAbiVersion = 1
inlineconstexpr

Discrete, monotonic ABI revision of the module capability contract.

Bump when the SHAPE of ModuleCapabilities (its fields / their meaning) changes, so a per-artifact manifest baked into an older .so (pops_compiled_manifest) can be told apart from a newer module at load time. Distinct from the textual pops::abi_key() (compiler / std / header signature): that detects a toolchain ABI break, this versions the capability vocabulary.

◆ kAmrRefRatio

constexpr int pops::kAmrRefRatio = 2
inlineconstexpr

The native AMR refinement ratio between two consecutive levels.

Only the value 2 is supported today; see require_supported_ref_ratio.

◆ kAuxBaseComps

constexpr int pops::kAuxBaseComps = 3
inlineconstexpr

◆ kAuxCanonicalNames

constexpr std::pair<std::string_view, int> pops::kAuxCanonicalNames[]
inlineconstexpr
Initial value:
= {
{"phi", 0},
{"grad_x", 1},
{"grad_y", 2},
#define POPS_AUX_NAME_ENTRY(name, idx)
}

CANONICAL aux name -> component table (mirror of AUX_CANONICAL on the DSL side).

The base-contract names are wired explicitly (components 0..2, NOT part of POPS_AUX_FIELDS); the EXTRA fields come from the X-macro (single source). Adding a canonical extra field = 1 line in POPS_AUX_FIELDS, this table follows automatically.

◆ kAuxMaxComps

constexpr int pops::kAuxMaxComps = kAuxNamedBase + kAuxMaxExtra
inlineconstexpr

◆ kAuxMaxExtra

constexpr int pops::kAuxMaxExtra = 4
inlineconstexpr

◆ kAuxNamedBase

constexpr int pops::kAuxNamedBase = kAuxBaseComps + 2
inlineconstexpr

◆ kCflSpeedFloor

constexpr Real pops::kCflSpeedFloor = Real(1e-30)
inlineconstexpr

Speed FLOOR for the CFL step policies (audit 2026-06, explicit constant instead of the scattered literal 1e-30): w = max(reduced_speed, kCflSpeedFloor) avoids the division by zero when a block has no wave (frozen transport / null field).

WARNING: a system in which ALL the speeds are null then receives a step ~cfl*h/1e-30, enormous – that is the historical behavior assumed (such a step transports nothing); diagnose it via last_dt_bound() == "degenerate" on the System side. Shared by System::step_cfl/step_adaptive and AmrRuntime::step_cfl.

◆ kCsMaxProg

constexpr int pops::kCsMaxProg = 256
inlineconstexpr

◆ kCsMaxReg

constexpr int pops::kCsMaxReg = 32
inlineconstexpr

◆ kCsMaxStack

constexpr int pops::kCsMaxStack = 32
inlineconstexpr

◆ kCsMaxTerms

constexpr int pops::kCsMaxTerms = 16
inlineconstexpr

◆ kElliptics

constexpr EllipticTag pops::kElliptics[]
inlineconstexpr
Initial value:
= {
{"charge", "rho - q : charge density (Poisson source)"},
{"background", "alpha (rho - n0) : neutralizing background"},
{"gravity", "sign * 4 pi G (rho - rho0) : gravitational coupling"},
}

SINGLE SOURCE of the builtin elliptic right-hand sides.

◆ kLimiters

constexpr LimiterTag pops::kLimiters[]
inlineconstexpr
Initial value:
= {
{"none", 1}, {"minmod", 2}, {"vanleer", 2}, {"weno5", 3}}

SINGLE SOURCE of the wired limiters (order = display priority: none < minmod < vanleer < weno5).

◆ kMaxRuntimeParams

constexpr int pops::kMaxRuntimeParams = 32
inlineconstexpr

Maximum number of runtime parameters per DSL block.

Bound deliberately large (a reasonable physical model has a few); overflow is diagnosed on the Python side at codegen. Keeps the structure fixed-size (no allocation -> device-copyable by value).

◆ kRiemanns

constexpr RiemannTag pops::kRiemanns[]
inlineconstexpr
Initial value:
= {{"rusanov", false, false, false, true},
{"hll", true, false, false, true},
{"hllc", false, true, false, false},
{"roe", false, false, true, false}}

SINGLE SOURCE of the wired Riemann fluxes (order = message "(rusanov|hll|hllc|roe)").

◆ kRoeEntropyFixFraction

constexpr Real pops::kRoeEntropyFixFraction = Real(0.1)
inlineconstexpr

Width of the RoeFlux Harten entropy-fix smoothing, as a fraction of the Roe sound speed (eps = kRoeEntropyFixFraction * c).

DOCUMENTED constant rather than hidden in the kernel; SPECIFIC to Euler/Roe (cf. the comment in RoeFlux::operator()).

◆ kSources

constexpr SourceTag pops::kSources[]
inlineconstexpr
Initial value:
= {
{"none", 1, "neutral: no source term"},
{"potential", 3, "(q/m) rho E electrostatic force"},
{"gravity", 3, "rho g gravity force"},
{"magnetic", 3, "q v x B_z magnetized Lorentz force (explicit regime)"},
{"lorentz", 3, "alias of 'magnetic'"},
{"potential_magnetic", 3, "electrostatic + Lorentz, summed"},
{"potential_lorentz", 3, "alias of 'potential_magnetic'"},
}

SINGLE SOURCE of the builtin sources.

◆ kTransports

constexpr TransportTag pops::kTransports[]
inlineconstexpr
Initial value:
= {
{"exb", 1, true, "scalar ExB drift advection, v = (-d_y phi, d_x phi) / B0"},
{"compressible", 4, false, "compressible Euler, 4 var (rho, rho u, rho v, E)"},
{"isothermal", 3, true, "isothermal Euler, 3 var (rho, rho u, rho v)"},
}

SINGLE SOURCE of the builtin transports (order = historical display priority, used by the CSV / choices messages).

These are GENERIC bricks, NOT named scenarios: a scenario (diocotron, ...) is a composition named on the application side (adc_cases), never a row here.