include/pops/runtime/builders/block/block_builder_polar.hpp Source File¶
|
adc_cpp 0.3.0
Model-free C++23 core for coupled hyperbolic-elliptic systems on adaptive (AMR) meshes, with MPI and GPU (Kokkos) backends
|
block_builder_polar.hpp
Go to the documentation of this file.
10#include <pops/numerics/spatial/operators/polar_operator.hpp> // assemble_rhs_polar (REUSED verbatim)
11#include <pops/numerics/time/integrators/time_steppers.hpp> // SSPRK2Step / SSPRK3Step (core RK math)
13#include <pops/physics/bricks/bricks.hpp> // ExBVelocityPolar, CompositeModel, source/elliptic bricks
14#include <pops/runtime/config/dispatch_tags.hpp> // UNIQUE registry of tags (validate_limiter/riemann)
16#include <pops/runtime/builders/factory/model_factory.hpp> // detail::dispatch_source / dispatch_elliptic (REUSED)
17#include <pops/runtime/dynamic/model_registry.hpp> // transport_tags_csv: polar-wired transport list (ADC-331)
76 // single-sourced via transport_tags_csv(/*polar=*/true). 'compressible' (Euler with energy) has no
98 // AUTOMATIC resolution by roles (audit sec.5), IDENTICAL to the cartesian one (bind_variable_roles
302 // CENTRALIZED VALIDATION (registry dispatch_tags.hpp) BEFORE the dispatch: in polar, rusanov AND
324 // GATE IDENTICAL TO THE CARTESIAN ONE (block_builder.hpp make_block, 'hll' branch): HLL is available
325 // as soon as a model exposes its SIGNED wave speeds model.wave_speeds (the polar isothermal fluid
412std::function<Real(const MultiFab&)> make_stability_dt_polar(const Model& m, const MultiFab* aux) {
BoxArray: the set of boxes tiling a level (disjoint, covering).
Umbrella for composable GENERIC physics bricks (compat).
ConstArray4 const_array() const
READ handle (POD device-copyable) over this Fab. Valid as long as the Fab lives.
Definition fab2d.hpp:96
Array4 array()
WRITE handle (POD device-copyable) over this Fab. Valid as long as the Fab lives.
Definition fab2d.hpp:91
Field distributed over a level: decomposition (BoxArray) + distribution (DistributionMapping) + ncomp...
Definition multifab.hpp:33
Fab2D & fab(int li)
Local fab at index li (0 <= li < local_size()), for writing.
Definition multifab.hpp:67
const Box2D & box(int li) const
VALID box of local fab li.
Definition multifab.hpp:71
int local_size() const
Number of fabs OWNED by this rank (bound on local indices).
Definition multifab.hpp:65
Parallel seam: minimal MPI abstraction (rank/size + collectives) with serial fallback.
OPTIONAL trait: local source frequency mu [1/s] (bound dt <= cfl / max mu, without h).
Definition physical_model.hpp:137
OPTIONAL trait: direct admissible step per cell (bound dt <= min stability_dt, without cfl).
Definition physical_model.hpp:143
OPTIONAL trait: stability speed lambda* replacing max_wave_speed in the block CFL.
Definition physical_model.hpp:131
SINGLE registry of spatial scheme tags (limiters + Riemann fluxes): shared source of truth for ALL di...
Geometry: index-space (Box2D) <-> Cartesian physical-space mapping; PolarGeometry: SIBLING for a glob...
Block grid context plus closures, shared between System (which installs them) and block_builder....
Assemble a CompositeModel from a ModelSpec (bricks + parameters).
SINGLE registry of builtin MODEL BRICK tags (transport / source / elliptic): the shared source of tru...
Flat specification of a model: chosen bricks plus their parameters.
MultiFab: a field DISTRIBUTED over a level (equivalent of AMReX's MultiFab).
void fill_ghosts_polar(MultiFab &U, const Box2D &dom, const BCRec &bc)
Fills the ghosts of a MultiFab on the polar grid (theta periodic + r physical).
Definition block_builder_polar.hpp:116
void dispatch_model_polar(const ModelSpec &m, Visitor &&visitor)
Assembles the POLAR CompositeModel designated by m and calls visitor(model).
Definition block_builder_polar.hpp:95
POPS_COLD_FN void dispatch_elliptic(const ModelSpec &m, Visitor &&v)
Builds the elliptic right-hand-side brick and calls v(elliptic).
Definition model_factory.hpp:105
POPS_COLD_FN void bind_variable_roles(Brick &brk, const VariableSet &cons)
AUTOMATIC resolution by ROLES (audit sec.5): fills the component indices of a SOURCE or ELLIPTIC bric...
Definition model_factory.hpp:135
void dispatch_transport_polar(const ModelSpec &m, Visitor &&v)
Builds the POLAR transport brick and calls v(transport).
Definition block_builder_polar.hpp:70
Definition amr_hierarchy.hpp:29
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 step...
Definition block_builder_polar.hpp:402
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 ...
Definition dispatch_tags.hpp:138
void validate_riemann(const std::string &riem, bool polar=false, const char *ctx="System")
Validates a Riemann FLUX tag against kRiemanns.
Definition dispatch_tags.hpp:111
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.
Definition block_builder_polar.hpp:412
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.
Definition block_builder_polar.hpp:298
void validate_limiter(const std::string &lim, const char *ctx="System")
Validates a LIMITER tag against kLimiters.
Definition dispatch_tags.hpp:99
Real min_stability_dt_mf(const Model &model, const MultiFab &U, const MultiFab &aux)
Global min of the declared admissible step (HasStabilityDt trait), via max(1/dt) (cf.
Definition wave_speed.hpp:222
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,...
Definition block_builder_polar.hpp:392
Real max_source_frequency_mf(const Model &model, const MultiFab &U, const MultiFab &aux)
Global max of the source frequency (HasSourceFrequency trait). 0 if the source does not constrain.
Definition wave_speed.hpp:209
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).
Definition block_builder_polar.hpp:421
std::string transport_tags_csv(bool polar=false)
Pipe list of transport tags ("exb|compressible|isothermal"), as used in the dispatch rejection messag...
Definition model_registry.hpp:114
Real max_stability_speed_mf(const Model &model, const MultiFab &U, const MultiFab &aux)
Global max of the STABILITY speed (HasStabilitySpeed trait) – counterpart of max_wave_speed_mf.
Definition wave_speed.hpp:197
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).
Definition block_builder_polar.hpp:265
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).
Definition block_builder_polar.hpp:359
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 PolarPoiss...
Definition block_builder_polar.hpp:231
void fill_ghosts(MultiFab &mf, const Box2D &domain, const BCRec &bc)
COMPLETE ghost filling: fill_boundary (interior + periodic, periodicity deduced from bc) THEN fill_ph...
Definition physical_bc.hpp:227
Single-interface numerical flux policies: Rusanov, HLL, HLLC, Roe.
PHYSICAL boundary conditions at the domain edge (BCType, BCRec, fill_physical_bc, fill_ghosts).
Additive POLAR spatial operator: R = -div_polar F + S on an annular grid (r, theta).
Interface reconstruction policies: MUSCL limiters and WENO5-Z.
WRITE POD handle (raw pointer + strides) over a Fab2D buffer, indexed by (i, j, c) IN GLOBAL INDICES ...
Definition fab2d.hpp:29
POINTWISE auxiliary fields shared with the physics: single coupling channel.
Definition state.hpp:123
Boundary conditions for the FOUR faces of the domain (type + associated Dirichlet value).
Definition physical_bc.hpp:29
std::function< void(MultiFab &, Real, int)> advance
(U, dt, n): n substeps of dt/n
Definition grid_context.hpp:62
std::function< void(MultiFab &, MultiFab &)> rhs_into
R <- -div F + S (Poisson frozen)
Definition grid_context.hpp:66
Composite physical model: one HYPERBOLIC brick + one source + one elliptic right-hand side.
Definition composite.hpp:30
READ-only handle (const counterpart of Array4): same layout and same contract (POD device-copyable,...
Definition fab2d.hpp:44
Scalar advection by the E x B drift in POLAR coordinates (r, theta) – "annular polar grid" effort,...
Definition hyperbolic.hpp:81
ISOTHERMAL Euler flux in POLAR geometry (ring r, theta), 3 variables (rho, rho v_r,...
Definition hyperbolic.hpp:241
ISOTHERMAL Euler flux (p = cs2 rho), 3 variables (rho, rho u, rho v).
Definition hyperbolic.hpp:127
std::string transport
REQUIRED (unset): "exb" | "compressible" | "isothermal".
Definition model_spec.hpp:28
double vacuum_floor
IsothermalFlux: quasi-vacuum density floor for u=m/max(rho,floor) (ADC-77).
Definition model_spec.hpp:36
Definition geometry.hpp:59
POPS_HD Real r_cell(int i) const
Radius at the CENTER of radial cell i (i = 0 -> r_min + dr/2).
Definition geometry.hpp:73
POLAR mesh + transport BC + aux shared by a block's closures (counterpart of GridContext).
Definition block_builder_polar.hpp:49
MultiFab * aux
System's aux (phi, grad_r, grad_theta); NOT owned.
Definition block_builder_polar.hpp:53
PolarGeometry geom
ring (r_min, r_max, dr, dtheta)
Definition block_builder_polar.hpp:52
BCRec bc
BC: r (xlo/xhi) physical, theta (ylo/yhi) periodic.
Definition block_builder_polar.hpp:51
Box2D dom
index domain (without ghost): nx() = nr, ny() = ntheta
Definition block_builder_polar.hpp:50
A model's variable set: kind (cons/prim), names, size, canonical roles (optional, parallel to names; ...
Definition variables.hpp:58
EXPLICIT polar advance: n substeps of the Stepper stepper (SSPRK2 by default, SSPRK3 optional) on the...
Definition block_builder_polar.hpp:141
void operator()(MultiFab &U, Real dt, int n) const
Definition block_builder_polar.hpp:147
Real pos_floor
Zhang-Shu positivity limiter (<= 0: inactive, bit-identical)
Definition block_builder_polar.hpp:146
bool wall_radial
Definition block_builder_polar.hpp:145
Polar residual functor R = -div_polar F + S (fill_ghosts then assemble_rhs_polar).
Definition block_builder_polar.hpp:125
void operator()(MultiFab &U, MultiFab &R) const
Definition block_builder_polar.hpp:131
Real pos_floor
Zhang-Shu positivity limiter (<= 0: inactive, bit-identical)
Definition block_builder_polar.hpp:130
const PolarGridContext * ctx
Definition block_builder_polar.hpp:127
Max wave-speed functor of the POLAR block: reduction over the valid cells of max_wave_speed(model,...
Definition block_builder_polar.hpp:174
Real operator()(const MultiFab &U) const
Definition block_builder_polar.hpp:177
POLAR Poisson contribution functor: rhs += elliptic_rhs(U) (pure HOST loop).
Definition block_builder_polar.hpp:203
void operator()(const MultiFab &U, MultiFab &rhs) const
Definition block_builder_polar.hpp:205
Frozen polar residual (fill_ghosts + assemble_rhs_polar) installed as the block's rhs_into (eval_rhs)...
Definition block_builder_polar.hpp:156
void operator()(MultiFab &U, MultiFab &R) const
Definition block_builder_polar.hpp:162
Real pos_floor
Zhang-Shu positivity limiter (<= 0: inactive, bit-identical)
Definition block_builder_polar.hpp:161
Definition block_builder_polar.hpp:375
Real operator()(const MultiFab &U) const
Definition block_builder_polar.hpp:378
Definition block_builder_polar.hpp:381
Real operator()(const MultiFab &U) const
Definition block_builder_polar.hpp:384
Optional STEP BOUND closures of the POLAR block (StabilityPolicy, audit wave 3): same device reductio...
Definition block_builder_polar.hpp:369
Real operator()(const MultiFab &U) const
Definition block_builder_polar.hpp:372
Time integrators as first-class OBJECTS with a take_step method: TimeStepper concept,...
Base scalar types and the POPS_HD macro (host+device portability).
Generated by