specfem::solver::time_marching¶
-
template<specfem::simulation::type Simulation, specfem::dimension::type DimensionTag, int NGLL>
class time_marching¶ Explicit time-stepping solver for spectral element wave propagation.
Implements predictor-corrector time integration schemes for various wave types (acoustic, elastic, poroelastic). Handles multi-physics coupling, source interactions, and seismogram generation.
- Template Parameters:
Simulation – Simulation type (forward or combined adjoint+backward)
DimensionTag – Spatial dimension (2D or 3D)
NGLL – Number of Gauss-Lobatto-Legendre quadrature points per element
Forward Time Marching Implementation¶
-
template<specfem::dimension::type DimensionTag, int NGLL>
class time_marching<specfem::simulation::type::forward, DimensionTag, NGLL> : public specfem::solver::solver¶ Time marching solver for forward simulation.
Constructors
Construct solver for forward wave propagation.
- Parameters:
kernels – Domain computational kernels for wavefield updates
time_scheme – Time integration scheme (e.g., Newmark)
tasks – Periodic tasks executed during simulation (e.g., output, plotting)
assembly – Spectral element assembly containing mesh and field data
Public Functions
-
virtual void run() override¶
Execute time-stepping loop for forward simulation.
Performs explicit time integration using predictor-corrector phases:
Predictor: updates velocity/displacement from \( t^n \) to \( t^{n+1/2} \)
Corrector: finalizes update to \( t^{n+1} \)
This ordering ensures proper coupling at fluid-solid and solid-solid interfaces. Computes seismograms and runs periodic tasks at specified intervals.
- Execution Order (critical for multi-physics coupling):
At each timestep, media are processed in this specific sequence:
Predictor phase for all media (acoustic, elastic, poroelastic)
Acoustic update: wavefield computation → corrector phase
Elastic update: wavefield computation (elastic, elastic_psv, elastic_sh) → corrector phase
Poroelastic update: wavefield computation → corrector phase
Public Static Attributes
-
static constexpr auto dimension_tag = DimensionTag¶
Dimension of the problem.
Combined Backward & Adjoint Time Marching Implementation¶
-
template<specfem::dimension::type DimensionTag, int NGLL>
class time_marching<specfem::simulation::type::combined, DimensionTag, NGLL> : public specfem::solver::solver¶ Time marching solver for combined adjoint and backward simulations.
Constructors
Construct solver for combined adjoint and backward simulations.
Used for computing Fréchet derivatives (sensitivity kernels) via the adjoint method.
- Parameters:
assembly – Spectral element assembly containing mesh and field data
adjoint_kernels – Domain kernels for adjoint wavefield propagation
backward_kernels – Domain kernels for backward wavefield propagation
time_scheme – Time integration scheme
tasks – Periodic tasks executed during simulation
Public Functions
-
virtual void run() override¶
Execute time-stepping loop for combined adjoint and backward simulations.
Performs backward time integration of both adjoint and backward wavefields:
Adjoint field: propagates adjoint sources backward in time
Backward field: reconstructs forward wavefield from stored buffer
Backward wavefield (reverse-time reconstruction):
Predictor phase for all media
Elastic update → corrector phase
Acoustic update → corrector phase
Poroelastic update → corrector phase
- Execution Order (per timestep, backward iteration):
Adjoint wavefield (forward-style update):
Predictor phase for all media
Acoustic update → corrector phase
Elastic update → corrector phase
Poroelastic update → corrector phase
Fréchet kernels: Computed after both wavefields are updated, correlating adjoint and backward fields for gradient-based inversion.
Public Static Attributes
-
static constexpr auto dimension_tag = DimensionTag¶
Dimension of the problem.