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, const std::string &default_file)¶
Construct a new setup object.
- Parameters:
parameter_file – Path to a configuration YAML file
default_file – Path to a YAML file to be used to instantiate default parameters
binding_python – Flag to indicate if the setup is being used in a pybind environment
-
setup(const YAML::Node ¶meter_dict, const YAML::Node &default_dict)¶
Construct a new setup object.
- Parameters:
parameter_dict – Configuration YAML Node
default_dict – YAML Node to be used to instantiate default parameters
-
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 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 YAML::Node get_sources() const¶
Get the sources YAML object.
- Returns:
YAML::Node YAML node describing the sources
-
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::wavefield::type> 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
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::dimension::type::dim2>> instantiate_wavefield_plotter(const specfem::assembly::assembly<specfem::dimension::type::dim2> &assembly, const type_real &dt) const¶
Create 2D wavefield plotter for visualization.
- Parameters:
assembly – 2D assembly containing mesh and field information
dt – Time step size
- Returns:
Shared pointer to 2D wavefield plotter or nullptr if not configured
-
inline std::shared_ptr<specfem::periodic_tasks::periodic_task<specfem::dimension::type::dim3>> instantiate_wavefield_plotter(const specfem::assembly::assembly<specfem::dimension::type::dim3> &assembly, const type_real &dt) const¶
Create 3D wavefield plotter for visualization.
- Parameters:
assembly – 3D assembly containing mesh and field information
dt – Time step size
- 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::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.
-
setup(const std::string ¶meter_file, const std::string &default_file)¶