Mondaic

salvus.project.configuration.simulation_configuration

salvus.project.configuration.simulation_configuration salvus project configuration simulation_configuration

The simulation configuration.

Classes

SimulationConfiguration

class SimulationConfiguration(
    salvus.project.configuration.simulation_configuration._SimulationConfigurationBase
):
    def __init__(
        self,
        name: str,
        elements_per_wavelength: salvus._core.types.float_,
        tensor_order: salvus._core.types.int_ = 1,
        min_period_in_seconds: salvus._core.types.float_ | None = None,
        max_frequency_in_hertz: salvus._core.types.float_ | None = None,
        max_depth_in_meters: salvus._core.types.float_ | None = None,
        model_configuration: ModelConfiguration | salvus.material.Material,
        topography_configuration: TopographyConfiguration | None = None,
        bathymetry_configuration: BathymetryConfiguration | None = None,
        absorbing_boundaries: AbsorbingBoundaryParameters | None = None,
        event_configuration: (
            EventConfiguration | dict[str, EventConfiguration]
        ),
        event_dependent_mesh_masking: str | typing.Callable | None = None,
    ) -> None: ...

Base simulation configurations.

Simulation configuration assembling everything required to turn an abstract domain into a concrete waveform simulation.

Parameters
  • name str — Name of the simulation configuration.
  • elements_per_wavelength salvus._core.types.float_ — Desired elements per wavelength.
  • tensor_order salvus._core.types.int_ — The tensor order of the mesh.
  • min_period_in_seconds salvus._core.types.float_ | None — Minimum mesh period in seconds.
  • max_frequency_in_hertz salvus._core.types.float_ | None — Maximum mesh frequency in Hertz.
  • max_depth_in_meters salvus._core.types.float_ | None — Max depth in meters.
  • model_configuration ModelConfiguration | salvus.material.Material — The model configuration or homogeneous material.
  • topography_configuration TopographyConfiguration | None — The topography configuration.
  • bathymetry_configuration BathymetryConfiguration | None — The bathymetry configuration.
  • absorbing_boundaries AbsorbingBoundaryParameters | None — The absorbing boundary configuration.
  • event_configuration EventConfiguration | dict[str, EventConfiguration] — Event configuration.
  • event_dependent_mesh_masking str | typing.Callable | None — Optional callback function for event-dependent aperture masking of the mesh.
Attributes
event_dependent_mesh_masking typing.Callable | None

Get the mesh masking function if available.

event_dependent_mesh_masking_str str | None

Get the mesh masking function as string if available.

min_period_in_seconds float

Minimum period in seconds.

Methods
from_json()
def from_json(d: builtins.dict) -> Any: ...

Recreate the object from a dictionary serialization of its initialization parameters.

Parameters
  • d builtins.dict — Dictionary containing its init parameters and a few other things.
Returns Any
to_json()
def to_json(self) -> dict: ...

Serialize the object to dictionary that can be written to JSON.

Returns dict

UnstructuredMeshSimulationConfiguration

class UnstructuredMeshSimulationConfiguration(
    salvus.project.configuration.simulation_configuration._SimulationConfigurationBase
):
    def __init__(
        self,
        name: str,
        unstructured_mesh: (
            UnstructuredMesh | ChunkedMesh | Mesh | DistributedMesh
        ),
        event_configuration: (
            EventConfiguration | dict[str, EventConfiguration] | None
        ),
        event_dependent_mesh_masking: str | typing.Callable | None = None,
    ): ...

Base simulation configurations.

Directly use an unstructured mesh as a simulation configuration object.

Parameters
  • name str — Name of the simulation configuration.
  • unstructured_mesh UnstructuredMesh | ChunkedMesh | Mesh | DistributedMesh — Unstructured mesh object.
  • event_configuration EventConfiguration | dict[str, EventConfiguration] | None — Event configuration.
  • event_dependent_mesh_masking str | typing.Callable | None — Optional callback function for event-dependent aperture masking of the mesh.
Attributes
event_dependent_mesh_masking typing.Callable | None

Get the mesh masking function if available.

event_dependent_mesh_masking_str str | None

Get the mesh masking function as string if available.

Methods
from_json()
def from_json(d: builtins.dict) -> Any: ...

Recreate the object from a dictionary serialization of its initialization parameters.

Parameters
  • d builtins.dict — Dictionary containing its init parameters and a few other things.
Returns Any
to_json()
def to_json(
    self,
    external_file_hash: types = None,
    timer: types = None,
    log_to_logger: bool = False,
    comm: types = None,
) -> builtins.dict: ...

Serialize the object to a dictionary that can be written to JSON.

Parameters
  • external_file_hash types — Hash of any external files associated with this object. Can be passed here in which case it will be stored in a centralized location in the JSON file.
  • timer types — Execution timer.
  • log_to_logger bool — Log timings to the logger.
  • comm types — MPI communicator, if any.
Returns builtins.dict

Used in tutorials