specfem::periodic_tasks::periodic_task

template<specfem::element::dimension_tag DimensionTag>
class periodic_task

Base class for tasks executed periodically during simulation.

Subclassed by specfem::periodic_tasks::plotter< specfem::element::dimension_tag::dim3 >, specfem::periodic_tasks::plotter< specfem::element::dimension_tag::dim2 >, specfem::periodic_tasks::check_signal< DimensionTag >, specfem::periodic_tasks::plotter< DimensionTag >, specfem::periodic_tasks::stability_check< DimensionTag >, specfem::periodic_tasks::wavefield_reader< DimensionTag, IOLibrary >, specfem::periodic_tasks::wavefield_writer< DimensionTag, IOLibrary >

Public Functions

inline periodic_task(const int time_interval, const bool include_last_step = true)

Construct a new periodic task object.

Parameters:
  • time_interval – Time interval between subsequent task executions

  • include_last_step – Whether or not to include the last step regardless of the time interval

inline virtual void run(specfem::assembly::assembly<DimensionTag> &assembly, const int istep)

Function to be called periodically.

inline virtual void initialize(specfem::assembly::assembly<DimensionTag> &assembly)

Functions to be called once at the beginning and once at the end of the simulation.

inline bool should_run(const int istep)

Returns true if the data should be plotted at the current timestep. Updates the internal timestep counter.

Parameters:

istep – Current timestep

Returns:

true if the data should be plotted at the current timestep