include/pops/coupling/single/coupler.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
|
coupler.hpp
Go to the documentation of this file.
11#include <pops/numerics/time/integrators/time_steppers.hpp> // SSPRK2Step / SSPRK3Step (shared scheme)
75 static_assert(EllipticSolver<Elliptic>, "the Coupler elliptic backend must model EllipticSolver");
Helpers shared by the three couplers (single-block Coupler, SystemAssembler, AmrSystemCoupler) for th...
BoxArray: the set of boxes tiling a level (disjoint, covering).
Coupler(const Model &model, const Geometry &geom, const BoxArray &ba, const BCRec &bcU, const BCRec &bcPhi, std::function< bool(Real, Real)> active={}, std::function< Real(Real, Real)> bz={})
Definition coupler.hpp:85
void solve_fields(const MultiFab &U)
Solve phi and derive aux = (phi, grad phi) for U WITHOUT advancing in time (useful to estimate the E ...
Definition coupler.hpp:169
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.
Definition elliptic_solver.hpp:30
Hyperbolic-elliptic temporal coupling policies (compile-time tag types).
DistributionMapping: maps each box (by global index) to its owning MPI rank.
DESCRIPTIVE types of the elliptic stage: EllipticProblem (problem definition) and FieldPostProcess (f...
Elliptic (Poisson) RIGHT-HAND-SIDE assemblers: single-model and N-species.
EllipticSolver concept: common contract for elliptic solvers at the MultiFab level (solve D phi = f),...
Fab2D: single-grid data on a Box2D (in-house equivalent of AMReX's FArrayBox); Array4 / ConstArray4: ...
for_each_cell and reductions: the parallelism SEAM over the cells of a Box2D; sync_host / sync_device...
GeometricMG: in-house geometric multigrid (V-cycle) for the elliptic operator, Gauss-Seidel smoother ...
Geometry: index-space (Box2D) <-> Cartesian physical-space mapping; PolarGeometry: SIBLING for a glob...
MultiFab arithmetic (saxpy, lincomb, norm_inf, dot) over VALID cells.
MultiFab: a field DISTRIBUTED over a level (equivalent of AMReX's MultiFab).
void coupler_eval_rhs(const MultiFab &state, MultiFab &rhs, const Model &model)
Assemble the single-model elliptic RHS: rhs = model.elliptic_rhs(U) on valid cells (delegated to Sing...
Definition coupler.hpp:53
void fill_bz_box(Fab2D &f, const Box2D &box, const Geometry &g, const Bz &bz)
Writes B_z(x, y) at component kAuxBaseComps on box box of fab f, sampling bz at the cell centers of g...
Definition aux_fill.hpp:42
void coupler_grad_phi(const MultiFab &phi, MultiFab &aux, Real cx, Real cy)
Set aux = (phi, d phi/dx, d phi/dy) by centered differences (factors cx, cy = 1/(2 dx),...
Definition coupler.hpp:64
Definition amr_hierarchy.hpp:29
@ Explicit
POPS_HD constexpr int aux_comps()
Width of the aux channel a model CONSUMES.
Definition physical_model.hpp:67
void field_postprocess(const MultiFab &phi, MultiFab &out, Real cx, Real cy, FieldPostProcess spec)
Definition elliptic_problem.hpp:104
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
PHYSICAL boundary conditions at the domain edge (BCType, BCRec, fill_physical_bc, fill_ghosts).
Interface reconstruction policies: MUSCL limiters and WENO5-Z.
"Spatial method" aggregate: reconstruction (limiter) + numerical flux in one named type.
Cartesian spatial operator: assembles R(U, aux) = -div F + S over the cells of a level.
Boundary conditions for the FOUR faces of the domain (type + associated Dirichlet value).
Definition physical_bc.hpp:29
Definition elliptic_problem.hpp:73
Cartesian geometry of a level: index domain + physical bounds [xlo, xhi] x [ylo, yhi].
Definition geometry.hpp:20
POPS_HD Real dy() const
Grid spacing in y (= (yhi - ylo) / domain.ny()). POPS_HD.
Definition geometry.hpp:33
POPS_HD Real dx() const
Grid spacing in x (= (xhi - xlo) / domain.nx()). POPS_HD.
Definition geometry.hpp:31
First-order reconstruction (piecewise constant): zero slope, 1 ghost.
Definition reconstruction.hpp:26
Tag: solves the elliptic problem at EVERY RK stage (aux follows the intermediate state,...
Definition coupling_policy.hpp:17
RusanovFlux (local Lax-Friedrichs): robust flux, compatible with any minimal PhysicalModel.
Definition numerical_flux.hpp:55
Definition time_steppers.hpp:61
void take_step(RhsEval &&rhs, MultiFab &U, Real dt, Scratch &s) const
Definition time_steppers.hpp:73
Definition time_steppers.hpp:90
void take_step(RhsEval &&rhs, MultiFab &U, Real dt, Scratch &s) const
Definition time_steppers.hpp:104
SINGLE-model RHS assembler: rhs(.,.,0) = model.elliptic_rhs(U) over the valid cells.
Definition elliptic_rhs.hpp:43
Definition time_integrator.hpp:46
Scheme tags (SSPRK2, SSPRK3, UserTimeIntegrator), TimeTreatment enum and per-block time policies: tem...
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