specfem::solver::time_marching

template<specfem::simulation::type Simulation, specfem::element::dimension_tag 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::element::dimension_tag DimensionTag, int NGLL>
class time_marching<specfem::simulation::type::forward, DimensionTag, NGLL> : public specfem::solver::solver

Time marching solver for forward simulation.

Constructors

inline time_marching(const std::shared_ptr<specfem::time_scheme::time_scheme> time_scheme, const std::vector<std::shared_ptr<specfem::periodic_tasks::periodic_task<DimensionTag>>> &tasks, specfem::assembly::assembly<dimension_tag> assembly)

Construct solver for forward wave propagation.

Parameters:
  • 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:

  1. Predictor: updates velocity/displacement from \( t^n \) to \( t^{n+1/2} \)

  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:

  1. Predictor phase for all media (acoustic, elastic, poroelastic)

  2. Acoustic update: wavefield computation → corrector phase

  3. Elastic update: wavefield computation (elastic, elastic_psv, elastic_sh) → corrector phase

  4. 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::element::dimension_tag 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

inline time_marching(const specfem::assembly::assembly<dimension_tag> &assembly, const std::shared_ptr<specfem::time_scheme::time_scheme> time_scheme, const std::vector<std::shared_ptr<specfem::periodic_tasks::periodic_task<dimension_tag>>> &tasks)

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

  • 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):

  1. Predictor phase for all media

  2. Elastic update → corrector phase

  3. Acoustic update → corrector phase

  4. Poroelastic update → corrector phase

Execution Order (per timestep, backward iteration):

Adjoint wavefield (forward-style update):

  1. Predictor phase for all media

  2. Acoustic update → corrector phase

  3. Elastic update → corrector phase

  4. 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.