specfem::source_time_functions::external

class external : public specfem::source_time_functions::stf

External source time function loaded from file.

Allows users to define custom source time functions by reading from external files in various formats (ASCII, HDF5, etc.).

Public Functions

external(const YAML::Node &external, const int nsteps, const type_real dt)

Construct an external source time function from YAML configuration.

Parameters:
  • external – YAML node with file paths and format specification

  • nsteps – Number of time steps

  • dt – Time step size

virtual void compute_source_time_function(const type_real t0, const type_real dt, const int nsteps, Kokkos::View<type_real**, Kokkos::LayoutRight, Kokkos::HostSpace> source_time_function) override

Compute source time function values for all time steps.

Parameters:
  • t0 – Start time

  • dt – Time step size

  • nsteps – Number of time steps

  • source_time_function – Output view to store computed values

inline virtual type_real get_tshift() const override

Get the time shift value.

Returns:

Time shift value

virtual void update_tshift(type_real tshift) override

Throw error as time shift update is not supported.

virtual std::string print() const override

Get string representation of the source time function.

Returns:

String describing the STF parameters

inline specfem::enums::seismogram_format get_format() const

Get the seismogram file format type.

Returns:

specfem::enums::seismogram_format

inline virtual type_real get_t0() const override

Get the start time value.

Returns:

Start time t0

inline std::string get_x_component() const

Get the file path for the X-component.

Returns:

File path as a string

inline std::string get_y_component() const

Get the file path for the Y-component.

Returns:

File path as a string

inline std::string get_z_component() const

Get the file path for the Z-component.

Returns:

File path as a string

virtual bool operator==(const stf &other) const override

Equality operator.

Parameters:

other – Another source time function to compare with

Returns:

true if equal, false otherwise

virtual bool operator!=(const stf &other) const override

Inequality operator.

Parameters:

other – Another source time function to compare with

Returns:

true if not equal, false otherwise