specfem::runtime_configuration::setup¶
-
class setup¶
Main configuration manager for SPECFEM simulations.
Parses YAML parameter files and instantiates simulation components including solvers, quadrature, time schemes, and I/O handlers. Central orchestrator for simulation setup and configuration.
Public Functions
-
setup(const std::string ¶meter_file)¶
Construct a new setup object.
- Parameters:
parameter_file – Path to a configuration YAML file parameters
-
setup(const YAML::Node ¶meter_dict)¶
Construct a new setup object.
- Parameters:
parameter_dict – Configuration YAML Node
-
inline specfem::quadrature::quadratures instantiate_quadrature() const¶
Instantiate quadrature objects in x and z dimensions.
- Returns:
std::tuple<specfem::quadrature::quadrature, specfem::quadrature::quadrature> Quadrature objects in x and z dimensions
Instantiate the Timescheme.
- Template Parameters:
AssemblyFields – Assembly fields type (dimension-agnostic)
- Parameters:
fields – Assembly fields to link with the timescheme
- Returns:
specfem::time_scheme::time_scheme* Pointer to the TimeScheme object used in the solver algorithm
-
inline void update_t0(type_real t0)¶
Update simulation start time.
- Parameters:
t0 – New simulation start time
-
inline type_real get_t0() const¶
Get simulation start time.
- Returns:
Current simulation start time
-
inline void set_starttime(std::optional<specfem::datetime::type> t)¶
Set the UTC start datetime of the simulation.
-
inline std::optional<specfem::datetime::type> get_starttime() const¶
Get the UTC start datetime of the simulation (nullopt if not set).
-
inline specfem::enums::elastic_wave get_elastic_wave_type() const¶
Get the type of the elastic wave.
- Returns:
specfem::enums::elastic_wave Type of the elastic wave
-
inline specfem::enums::electromagnetic_wave get_electromagnetic_wave_type() const¶
Get the type of the electromagnetic wave.
- Returns:
specfem::enums::electromagnetic_wave Type of the electromagnetic wave
-
inline type_real get_dt() const¶
Get delta time value.
- Returns:
type_real
-
inline std::string get_databases() const¶
Get the path to mesh database and source yaml file.
- Returns:
std::tuple<std::string, std::string> std::tuple specifying the path to mesh database and source yaml file
-
inline const std::vector<specfem::enums::source_file_entry> &get_source_entries() const¶
Get the parsed source file entries for multi-format dispatch.
- Returns:
const reference to vector of source_file_entry
-
inline YAML::Node get_stations() const¶
Get the path to stations file.
- Returns:
std::string path to stations file
-
inline type_real get_receiver_angle() const¶
Get the angle of receivers.
- Returns:
type_real angle of the receiver
-
inline std::vector<specfem::enums::wavefield> get_seismogram_types() const¶
Get the types of seismograms to be calculated.
- Returns:
std::vector<specfem::seismogram::type> Types of seismograms to be calculated
-
inline std::shared_ptr<specfem::io::writer> instantiate_seismogram_writer() const¶
Instantiate a seismogram writer object.
to instantiate the writer
- Returns:
specfem::io::writer* Pointer to an instantiated writer object
-
inline int get_nstep_between_samples() const¶
Get number of samples between seismogram recordings.
- Returns:
int number of samples between seismogram recordings
-
inline int get_max_seismogram_step() const¶
Get the maximum seismogram step.
- Returns:
int Maximum seismogram step
-
inline bool is_attenuation_enabled() const¶
Whether attenuation is enabled in the simulation.
-
inline bool has_attenuation_reference_frequency() const¶
Whether reference frequency was explicitly set in the attenuation configuration (vs. being read from the mesh database)
-
inline std::optional<specfem::units::Hertz> get_attenuation_reference_frequency() const¶
Get the reference frequency for attenuation, if set in the config.
- Returns:
std::optional<specfem::units::Hertz> reference frequency, or std::nullopt if attenuation is disabled or f0 was not set in the YAML
-
inline specfem::utilities::Band<specfem::units::Hertz> get_attenuation_band() const¶
Get the attenuation frequency band.
- Returns:
specfem::utilities::Band<specfem::units::Hertz> Attenuation frequency band (default-constructed if attenuation is disabled)
-
inline specfem::attenuation::Setup get_attenuation_setup() const¶
Get a self-contained attenuation setup struct for passing to read_mesh functions.
- Returns:
specfem::attenuation::Setup
Create wavefield writer for periodic output.
- Template Parameters:
DimensionTag – Spatial dimension (2D/3D)
- Returns:
Shared pointer to wavefield writer task or nullptr if not configured
Create wavefield reader for loading saved wavefields.
- Template Parameters:
DimensionTag – Spatial dimension (2D/3D)
- Returns:
Shared pointer to wavefield reader task or nullptr if not configured
-
inline std::shared_ptr<specfem::periodic_tasks::periodic_task<specfem::element::dimension_tag::dim2>> instantiate_wavefield_plotter(const specfem::assembly::assembly<specfem::element::dimension_tag::dim2> &assembly) const¶
Create 2D wavefield plotter for visualization.
- Parameters:
assembly – 2D assembly containing mesh and field information
- Returns:
Shared pointer to 2D wavefield plotter or nullptr if not configured
-
inline std::shared_ptr<specfem::periodic_tasks::periodic_task<specfem::element::dimension_tag::dim3>> instantiate_wavefield_plotter(const specfem::assembly::assembly<specfem::element::dimension_tag::dim3> &assembly) const¶
Create 3D wavefield plotter for visualization.
- Parameters:
assembly – 3D assembly containing mesh and field information
- Returns:
Shared pointer to 3D wavefield plotter or nullptr if not configured
-
inline std::shared_ptr<specfem::io::reader> instantiate_property_reader() const¶
Create property reader for loading material properties.
- Returns:
Shared pointer to property reader or nullptr if not configured
-
inline std::shared_ptr<specfem::io::writer> instantiate_property_writer() const¶
Create property writer for saving material properties.
- Returns:
Shared pointer to property writer or nullptr if not configured
-
inline std::shared_ptr<specfem::io::writer> instantiate_kernel_writer() const¶
Create kernel writer for sensitivity kernel output.
- Returns:
Shared pointer to kernel writer or nullptr if not configured
-
inline specfem::simulation::type get_simulation_type() const¶
Get simulation type configuration.
- Returns:
Current simulation type (forward/adjoint/combined)
Create solver instance with specified parameters.
- Template Parameters:
NGLL – Number of Gauss-Lobatto-Legendre points per element dimension
DimensionTag – Spatial dimension (2D/3D)
- Parameters:
dt – Time step size
assembly – Assembly containing mesh and field data
time_scheme – Time integration scheme
tasks – Periodic tasks to execute during simulation
- Returns:
Shared pointer to configured solver
-
inline int get_nsteps() const¶
Get total number of time steps.
- Returns:
Total simulation time steps
-
inline bool allocate_boundary_values() const¶
Check if boundary values need allocation.
Required for adjoint simulations and combined simulation types.
- Returns:
True if boundary values should be allocated
-
inline specfem::runtime_configuration::header get_header() const¶
Get the header object.
- Returns:
header Header object
Private Members
-
std::unique_ptr<specfem::runtime_configuration::header> header¶
Simulation header configuration.
-
std::unique_ptr<specfem::runtime_configuration::Attenuation> attenuation¶
Attenuation configuration.
-
std::unique_ptr<specfem::runtime_configuration::elastic_wave> elastic_wave¶
Elastic wave type configuration.
-
std::unique_ptr<specfem::runtime_configuration::electromagnetic_wave> electromagnetic_wave¶
Electromagnetic wave configuration.
-
std::unique_ptr<specfem::runtime_configuration::time_scheme> time_scheme¶
Time stepping scheme configuration.
-
std::unique_ptr<specfem::runtime_configuration::run_setup> run_setup¶
Simulation run configuration.
-
std::unique_ptr<specfem::runtime_configuration::quadrature> quadrature¶
Numerical quadrature configuration.
-
std::unique_ptr<specfem::runtime_configuration::receivers> receivers¶
Seismic receiver configuration.
-
std::unique_ptr<specfem::runtime_configuration::sources> sources¶
Seismic source configuration.
-
std::unique_ptr<specfem::runtime_configuration::seismogram> seismogram¶
Seismogram output configuration.
-
std::unique_ptr<specfem::runtime_configuration::wavefield> wavefield¶
Wavefield I/O configuration.
-
std::unique_ptr<specfem::runtime_configuration::plot_wavefield> plot_wavefield¶
Wavefield plotting configuration.
-
std::unique_ptr<specfem::runtime_configuration::kernel> kernel¶
Kernel output configuration.
-
std::unique_ptr<specfem::runtime_configuration::property> property¶
Property I/O configuration.
-
std::unique_ptr<specfem::runtime_configuration::database_configuration> databases¶
Database file path configuration.
-
std::unique_ptr<specfem::runtime_configuration::solver> solver¶
Solver algorithm configuration.
-
std::unique_ptr<specfem::runtime_configuration::flux_schemes> flux_schemes¶
flux-scheme configuration
-
setup(const std::string ¶meter_file)¶