include/pops/coupling/schur/amr/amr_condensed_schur_source_stepper.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
|
amr_condensed_schur_source_stepper.hpp
Go to the documentation of this file.
3#include <pops/coupling/schur/source/condensed_schur_source_stepper.hpp> // CondensedSchurSourceStepper (#126) + detail kernels
5#include <pops/coupling/schur/core/schur_condensation.hpp> // ElectrostaticLorentzCondensation (assemble per level)
6#include <pops/numerics/elliptic/mg/composite_fac_poisson.hpp> // CompositeFacPoisson (composite FAC elliptic solve)
7#include <pops/numerics/time/amr/reflux/amr_reflux_mf.hpp> // mf_average_down_mb (fine -> coarse cascade)
110 // compiled path (build_amr_compiled) ALWAYS allocates a seed fine level, EMPTY after regrid when
125 // reconstruction PER LEVEL and average_down cascade. Phase 4a frame: 2 levels, 1..N fine patches
127 // coarse replicated mono-block, MONO-RANK. Beyond that -> clear error (> 2 levels / MPI / multi-block
153 // COMPLETE fine BoxArray (1..N patches): the FAC is built on this tiling; the patches being separated
168 // --- B_z 1-component per level (coarse: extracted from coarse_bz; fine: bilerp of the coarse) ---
187 // eps_x == eps_y for the Schur (A_xx = A_yy = 1 + c rho/det): we write eps_x into the single eps of the
188 // composite and eps_y into a discarded scratch. f_composite = -rhs_schur (sign convention #126).
219 // coarse phi^{n+1} (extrapolated in place into fac_->phi_coarse()) -> published into coarse_phi.
Umbrella for the AMR MultiFab stack: includes the numerics/time sub-headers in dependency order (flux...
AMR multi-patch subcycling engine (several fine boxes per level): 2-level step (amr_step_2level_multi...
Schur-condensed SOURCE stage over an AMR hierarchy.
Definition amr_condensed_schur_source_stepper.hpp:54
void step(std::vector< AmrLevelMP > &levels, MultiFab &coarse_phi, const MultiFab &coarse_bz, int c_bz, Real theta, Real dt)
Condensed SOURCE stage, IN-PLACE on the hierarchy levels and the coarse potential coarse_phi.
Definition amr_condensed_schur_source_stepper.hpp:105
int momentum_y_comp() const
Definition amr_condensed_schur_source_stepper.hpp:142
int momentum_x_comp() const
Definition amr_condensed_schur_source_stepper.hpp:141
AmrCondensedSchurSourceStepper(const VariableSet &vars, int c_rho, int c_mx, int c_my, int c_E, const Geometry &coarse_geom, const BoxArray &coarse_ba, const BCRec &bcPhi, Real alpha, int n_precond_vcycles=1)
EXPLICIT-COMPONENT variant (audit wave 3, parity with the System steppers): roles carried by the ABI ...
Definition amr_condensed_schur_source_stepper.hpp:73
int density_comp() const
Definition amr_condensed_schur_source_stepper.hpp:140
const KrylovResult & last_solve() const
Diagnostic of the last coarse stage solve (BiCGStab iterations, relative residual,...
Definition amr_condensed_schur_source_stepper.hpp:138
AmrCondensedSchurSourceStepper(const VariableSet &vars, const Geometry &coarse_geom, const BoxArray &coarse_ba, const BCRec &bcPhi, Real alpha, int n_precond_vcycles=1)
vars: descriptor of the fluid block (MUST expose Density / MomentumX / MomentumY; Energy optional).
Definition amr_condensed_schur_source_stepper.hpp:63
void set_krylov(Real tol, int max_iters)
Tolerance / budget of the COARSE stage Krylov solve (delegated to the uniform stage #126; historical ...
Definition amr_condensed_schur_source_stepper.hpp:91
int energy_comp() const
Definition amr_condensed_schur_source_stepper.hpp:143
bool has_energy() const
true if the model carries an Energy role (energy update active in the coarse stage).
Definition amr_condensed_schur_source_stepper.hpp:94
void set_krylov(Real tol, int max_iters)
Tolerance / iteration budget of the stage Krylov solve (BiCGStab).
Definition condensed_schur_source_stepper.hpp:277
int density_comp() const
Definition condensed_schur_source_stepper.hpp:283
int momentum_x_comp() const
Definition condensed_schur_source_stepper.hpp:284
int energy_comp() const
Definition condensed_schur_source_stepper.hpp:286
const KrylovResult & last_solve() const
Diagnostic of the last solve (BiCGStab iterations, relative residual, convergence).
Definition condensed_schur_source_stepper.hpp:272
void step(MultiFab &state, MultiFab &phi, const MultiFab &bz_field, int c_bz, Real theta, Real dt)
Condensed SOURCE STAGE, IN-PLACE on state and phi.
Definition condensed_schur_source_stepper.hpp:190
int momentum_y_comp() const
Definition condensed_schur_source_stepper.hpp:285
Owning MPI rank of each box, indexed by GLOBAL box index (parallel to a BoxArray).
Definition distribution_mapping.hpp:19
GENERIC builder of the condensed source stage for the electrostatic + Lorentz source (kind="electrost...
Definition schur_condensation.hpp:153
Field distributed over a level: decomposition (BoxArray) + distribution (DistributionMapping) + ncomp...
Definition multifab.hpp:33
const DistributionMapping & dmap() const
GLOBAL distribution (owner rank per box).
Definition multifab.hpp:58
const BoxArray & box_array() const
GLOBAL decomposition of the level (all boxes, all ranks).
Definition multifab.hpp:56
CompositeFacPoisson: 2-level AMR COMPOSITE elliptic solver (Fast Adaptive Composite,...
CondensedSchurSourceStepper: Schur-condensed SOURCE STAGE (level 4 of docs/SCHUR_CONDENSATION_DESIGN....
POPS_HD Real fac_bilerp_coarse(const ConstArray4 &C, int i, int j, int r)
BILINEAR interpolation of the coarse potential (cell-centered, C with ghosts) at the CENTER of the fi...
Definition composite_fac_poisson.hpp:70
Definition amr_hierarchy.hpp:29
void for_each_cell(const Box2D &b, F f)
Applies f to EACH cell (i, j) of box b (bounds inclusive), via Kokkos::parallel_for (Serial / OpenMP ...
Definition for_each.hpp:138
void mf_average_down_mb(const MultiFab &Uf, MultiFab &Uc)
Definition amr_subcycling.hpp:305
void device_fence()
Device barrier: waits for in-flight kernels to finish before a HOST access to unified memory.
Definition kokkos_env.hpp:43
constexpr int kAmrRefRatio
The native AMR refinement ratio between two consecutive levels.
Definition refinement_ratio.hpp:30
@ Energy
@ Density
@ MomentumX
@ MomentumY
BCType
Boundary condition type for a face: Periodic (handled by fill_boundary), Foextrap (zero gradient,...
Definition physical_bc.hpp:25
@ Foextrap
@ Periodic
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 source of truth for the native AMR refinement ratio.
BUILDER (NOT solver) of the Schur-condensed source stage of the implicit source coupling potential / ...
Boundary conditions for the FOUR faces of the domain (type + associated Dirichlet value).
Definition physical_bc.hpp:29
Cartesian geometry of a level: index domain + physical bounds [xlo, xhi] x [ylo, yhi].
Definition geometry.hpp:20
Geometry refine(int r) const
Geometry refined by ratio r: SAME physical extent, refined index domain (dx -> dx/r).
Definition geometry.hpp:40
Outcome of a Krylov solve: iterations performed, final relative residual, convergence flag.
Definition krylov_result.hpp:16
A model's variable set: kind (cons/prim), names, size, canonical roles (optional, parallel to names; ...
Definition variables.hpp:58
Generated by