include/pops/runtime/system/system_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
|
system_stepper.hpp
Go to the documentation of this file.
3#include <pops/core/state/state.hpp> // kAuxBaseComps (B_z channel read by the condensed source stage)
5#include <pops/coupling/source/coupled_source_program.hpp> // CoupledFreqKernel (per-cell coupled frequency)
6#include <pops/mesh/execution/for_each.hpp> // reduce_max_cell (max mu over the cells, device-clean functor)
222 // GEOMETRY DISPATCH (Path A step 2c): a block carries AT MOST ONE condensed source stage (set_source_stage
224 // (PolarCondensedSchurSourceStepper, #212) has the SAME step(state, phi, bz, c_bz, theta, dt) signature as
361 // Compiled time Program (epic ADC-399): when a problem.so has installed a macro-step body, IT owns
362 // the whole step (solve_fields, RHS, combine, commit -- all via ProgramContext). The runtime only
363 // keeps the clock coherent (the SYSTEM-level substeps + stride cadence + clock tick are factored
364 // into run_program_cadence, shared with step_cfl so both route a program the same way -- ADC-413).
365 // No implicit solve_fields / couplings / projections here: the Program expresses them explicitly.
370 // COUPLING / POISSON: solve_fields assembles f = Sum_s elliptic_rhs_s(U_s) on the CURRENT state of
371 // each block. A HELD block (cadence M, outside the window end) contributes with its STALE state (its
431 // (5) phi RE-SOLVED on the post-source density: WITHOUT this solve the 2nd half-advance would read a
488 // PER-BLOCK CFL, STRIDE AND SUBSTEPS FACTOR INCLUDED. A block of cadence M advances by an effective
489 // step M*dt in substeps_b substeps, so each substep is worth stride_b * dt / substeps_b: the stable
492 // The GLOBAL dt is the min over the evolving blocks (the most constraining). Without this, the step
493 // computed on w_max alone then multiplied by M would violate the CFL by a factor M on the stride block.
495 // BACKWARD COMPATIBILITY (post-#121). The formula is SUBSTEPS-AWARE: with substeps_b > 1, the dt
500 // To reproduce a run calibrated with the old formula, use step(dt) with the explicit historical
554 // this step, global all_reduce_max, dt <= cfl / max(mu). Same reason "coupled_source:<label>" as the
557 // GLOBAL bounds (System::add_dt_bound): all_reduce_min over the registered bounds, tracking the
560 // OPTIONAL compiled-Program dt bound (epic ADC-399 / ADC-417, spec s18). When the installed Program
561 // exported one (System::install_program stored program_dt_bound_), it TIGHTENS dt to the min of the
562 // native CFL dt above and the program's own bound. No program / no bound -> the closure is empty and
563 // dt is the native CFL UNCHANGED. The native CFL logic above is left intact: this only reduces dt.
564 // MPI-SAFE: program_dt_bound_ runs the SAME collective reduction (block_max_speed / reductions) on
565 // every rank, so the bound is rank-uniform -- like apply_global_dt_bounds, the min keeps the step
580 // Compiled time Program (epic ADC-399, criterion 7): the CFL dt above is computed in adc_cpp ON
581 // THE NATIVE STATE (per-block bounds + global bounds, UNCHANGED -- the CFL logic stays here), then
582 // the installed Program drives the macro-step at that dt via the SHARED cadence helper. step_cfl
583 // thus conserves the existing CFL logic AND calls the Program. Semantics match step()'s program
584 // branch EXACTLY: run the cadence + tick the clock, with NO apply_couplings / apply_projections
585 // (the Program expresses solve_fields / couplings / projections itself). The native advance path
SystemStepper<Impl>: see the contract above.
Definition system_stepper.hpp:68
Real cfl_grid_h() const
MIN physical step of the grid, shared by step_cfl / step_adaptive: Cartesian = min(dx,...
Definition system_stepper.hpp:160
SystemStepper(Impl *owner)
Definition system_stepper.hpp:71
void run_program_cadence(double dt)
Runs ONE macro-step of length dt through an INSTALLED compiled time Program (epic ADC-399): the SYSTE...
Definition system_stepper.hpp:337
void apply_projections()
PROJECTION PONCTUELLE post-pas (ADC-177) : U <- project(U, aux) par bloc, appliquee UNE fois a la FIN...
Definition system_stepper.hpp:202
void advance_transport(typename Impl::Species &s, Real eff_dt)
TRANSPORT ADVANCE of block s over eff_dt in s.substeps substeps, dispatched by the mode (cf.
Definition system_stepper.hpp:283
void apply_couplings(Real dt)
Inter-species COUPLING sources: applied by SPLITTING (one explicit additive step of dt) AFTER the tra...
Definition system_stepper.hpp:92
static bool stride_due(int macro_step, int stride)
True if a block of cadence stride CATCHES UP at this macro-step (END of window).
Definition system_stepper.hpp:86
double step_cfl(double cfl)
One macro-step at CFL dt: dt = min over the evolving blocks of the block step BOUNDS,...
Definition system_stepper.hpp:482
double step_adaptive(double cfl)
One MULTIRATE macro-step: the macro-step = stable step of the SLOWEST block; each faster block is sub...
Definition system_stepper.hpp:609
void advance_transport_n(typename Impl::Species &s, Real dt, int n)
TRANSPORT ADVANCE of block s over dt in n substeps, DISPATCHED by the System geometry mode (worksite ...
Definition system_stepper.hpp:257
void advance_transport_half(typename Impl::Species &s, Real eff_dt)
HALF transport advance (Strang): dispatch of advance_transport over half_dt = eff_dt/2 – the disk mod...
Definition system_stepper.hpp:289
void apply_global_dt_bounds(double &dt, std::string *reason) const
GLOBAL step bounds (System::add_dt_bound): multi-block coupling, Schur/Poisson, AMR/scheduler.
Definition system_stepper.hpp:175
void apply_coupled_freq_expr_bounds(double cfl, double &dt, std::string *reason) const
Step bound from PER-CELL COUPLED FREQUENCIES (CoupledSource.frequency with an Expr,...
Definition system_stepper.hpp:112
void run_source_stage(typename Impl::Species &s, Real eff_dt)
Schur-CONDENSED SOURCE STAGE (OPT-IN, cf.
Definition system_stepper.hpp:221
void advance(double dt, int nsteps)
Advances by nsteps macro-steps of length dt (loop over step).
Definition system_stepper.hpp:453
void step(double dt)
One macro-step of length dt.
Definition system_stepper.hpp:355
void set_scheme(SplitScheme scheme)
Chooses the time splitting policy (default Lie = bit-identical). See SplitScheme.
Definition system_stepper.hpp:74
void step_strang(double dt)
One STRANG macro-step (symmetric, 2nd order): H(dt/2); S(dt); H(dt/2).
Definition system_stepper.hpp:406
void advance_due_blocks(double dt)
FULL-STEP advance of every DUE block over dt: effective step eff_dt = stride * dt (cadence catch-up),...
Definition system_stepper.hpp:303
const std::string & last_dt_reason() const
Name of the ACTIVE bound (the one that fixed dt) of the last step_cfl: "transport:<block>",...
Definition system_stepper.hpp:696
Parallel seam: minimal MPI abstraction (rank/size + collectives) with serial fallback.
Generic COUPLED SOURCE interpreter: postfix bytecode evaluated on device (P5 phase 1).
for_each_cell and reductions: the parallelism SEAM over the cells of a Box2D; sync_host / sync_device...
Block grid context plus closures, shared between System (which installs them) and block_builder....
SplitScheme
Time SPLITTING policy of the macro-step (hyperbolic transport H + source stage S).
Definition system_stepper.hpp:62
Definition amr_hierarchy.hpp:29
constexpr Real kCflSpeedFloor
Speed FLOOR for the CFL step policies (audit 2026-06, explicit constant instead of the scattered lite...
Definition types.hpp:38
Real reduce_max_cell(const Box2D &b, F f)
MAX reduction with a REDUCING FUNCTOR: f receives (i, j, Real& acc) and updates acc,...
Definition for_each.hpp:240
GeometryMode
TRANSPORT GEOMETRY MODE of the macro-step (T5-PR3 effort, disc wiring in System::step).
Definition grid_context.hpp:29
@ None
@ Staircase
Pointwise types of the physics layer: StateVec<N> (conserved state) and Aux (auxiliary fields from th...
Definition coupled_source_program.hpp:175
Base scalar types and the POPS_HD macro (host+device portability).
Generated by