include/pops/numerics/time/integrators/time_steppers.hpp File ReferenceΒΆ

adc_cpp: include/pops/numerics/time/integrators/time_steppers.hpp File 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
time_steppers.hpp File Reference

Time integrators as first-class OBJECTS with a take_step method: TimeStepper concept, and the ForwardEuler, SSPRK2Step, SSPRK3Step (Shu-Osher) schemes. More...

+ Include dependency graph for time_steppers.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  pops::ForwardEuler
 
struct  pops::ForwardEuler::Scratch
 
struct  pops::SSPRK2Step
 
struct  pops::SSPRK2Step::Scratch
 
struct  pops::SSPRK3Step
 
struct  pops::SSPRK3Step::Scratch
 

Namespaces

namespace  pops
 

Concepts

concept  pops::TimeStepper
 

Functions

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

Detailed Description

Time integrators as first-class OBJECTS with a take_step method: TimeStepper concept, and the ForwardEuler, SSPRK2Step, SSPRK3Step (Shu-Osher) schemes.

Layer: include/pops/numerics/time. Role: keep the mathematical scheme alive in the core, with the coupler CALLING it instead of inlining SSPRK everywhere. The "give a TimeIntegrator to the coupler like you give a PhysicalModel" contract: the user can provide their own (same signature take_step(rhs_eval, U, dt)). Contract: an integrator is agnostic of the model and the discretization – it only sees rhs_eval(U_stage, R) (the method-of-lines arrow R = -div F + S) and the MultiFab operations (saxpy / lincomb).

Invariants:

  • no carried state: the scratch (R, stages U1/U2/U3) is sized from the layout of U. The one-arg take_step allocates it per call; the scratch-taking overload reuses a caller-owned buffer (see run_explicit_substeps) to hoist the allocation out of a substep loop – both paths are bit-identical;
  • SSPRK2Step / SSPRK3Step exactly reproduce the old copies in SystemCoupler and ssprk.hpp (bit-identical).