Mondaic

salvus.project.configuration.mesh_configuration

salvus.project.configuration.mesh_configuration salvus project configuration mesh_configuration

The mesh configuration.

Classes

MeshConfiguration

class MeshConfiguration(
    salvus.flow.utils.serialization_helpers.SerializationMixin
):
    def __init__(
        self,
        max_frequency_in_hertz: salvus._core.types.float_,
        elements_per_wavelength: salvus._core.types.float_,
        tensor_order: salvus._core.types.int_ = 1,
        max_depth_in_meters: salvus._core.types.float_ | None = None,
        absorbing_boundaries: AbsorbingBoundaryParameters | None = None,
        mask_generator: SurfaceMaskGenerator | RayMaskGenerator | None = None,
    ) -> None: ...

Parameters to turn abstract simulation settings into a concrete mesh.

Parameters
  • max_frequency_in_hertz salvus._core.types.float_ — Max mesh frequency.
  • elements_per_wavelength salvus._core.types.float_ — Elements per wavelength.
  • tensor_order salvus._core.types.int_ — Tensor order for the mesh.
  • max_depth_in_meters salvus._core.types.float_ | None — Maximum depth in meters of the mesh.
  • absorbing_boundaries AbsorbingBoundaryParameters | None — Absorbing boundary configuration.
  • mask_generator SurfaceMaskGenerator | RayMaskGenerator | None — A mesh masking callback function.
Attributes
min_period_in_seconds float

Minimum mesh 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,
    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

ModelDependentMeshParameters

class ModelDependentMeshParameters(
    salvus.flow.utils.serialization_helpers.SerializationMixin
):
    def __init__(
        self,
        mesh_parameters: MeshConfiguration,
        model_configuration: ModelConfiguration,
        topography_configuration: TopographyConfiguration | None,
        bathymetry_configuration: BathymetryConfiguration | None = None,
    ): ...

Model dependent mesh parameters.

Parameters
  • mesh_parameters MeshConfiguration — The mesh parameters.
  • model_configuration ModelConfiguration — Model configuration.
  • topography_configuration TopographyConfiguration | None — Configuration for the topography.
  • bathymetry_configuration BathymetryConfiguration | None — Configuration for the bathymetry.
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

SphericalSmoothieSemLateralRefinement

class SphericalSmoothieSemLateralRefinement(builtins.object):
    def __init__(
        self,
        min_theta_in_degrees: salvus._core.types.float_,
        max_theta_in_degrees: salvus._core.types.float_,
        min_radius_in_meters: salvus._core.types.float_,
        max_radius_in_meters: salvus._core.types.float_ | None = None,
        min_phi_in_degrees: salvus._core.types.float_ | None = None,
        max_phi_in_degrees: salvus._core.types.float_ | None = None,
    ) -> None: ...

Parameters describing a SmoothieSEM lateral refinement.

Multiple refinements can be used in a SmoothieSEM context, with the strict requirement that each refinement must be wholly contained within the others. To add multiple refinements, one can pass a list of these objects to the relevant mesh generation routines.

Note here that theta and phi are to be taken from the source’s reference frame, and are in general not equivalent to geographical latitude and longitude.

Parameters
  • min_theta_in_degrees salvus._core.types.float_ — Min theta refinement boundary.
  • max_theta_in_degrees salvus._core.types.float_ — Max theta refinement boundary.
  • min_radius_in_meters salvus._core.types.float_ — Min radius of the refinement.
  • max_radius_in_meters salvus._core.types.float_ | None — Max radius of the refinement. Defaults to None (which represents the surface of the Earth).
  • min_phi_in_degrees salvus._core.types.float_ | None — Min phi refinement boundary. Defaults to None (which results in a refinement in a band around the globe).
  • max_phi_in_degrees salvus._core.types.float_ | None — Max phi refinement boundary. Defaults to None (which results in a refinement in a band around the globe).
Methods
get_dict()
def get_dict(self) -> dict: ...

Get the refinement parameters as a Python dictionary.

This is the form which is accepted by the Salvus_Mesh_ schema.

Returns dict — The parameters as a dictionary.

SphericalSmoothieSemMeshConfiguration

class SphericalSmoothieSemMeshConfiguration(
    salvus.project.configuration.mesh_configuration._SphericalSmoothieSemMixin,
    salvus.project.configuration.mesh_configuration.MeshConfiguration,
):
    def __init__(
        self,
        elements_per_wavelength: salvus._core.types.float_,
        source_latitude: salvus._core.types.float_,
        source_longitude: salvus._core.types.float_,
        num_lateral_elements: salvus._core.types.int_,
        tensor_order: salvus._core.types.int_ = 1,
        lateral_refinements: (
            SphericalSmoothieSemLateralRefinement
            | list[SphericalSmoothieSemLateralRefinement]
            | None
        ) = None,
        max_frequency_in_hertz: salvus._core.types.float_ | None = None,
        min_period_in_seconds: salvus._core.types.float_ | None = None,
        mask_generator: SurfaceMaskGenerator | RayMaskGenerator | None = None,
    ): ...

A mixin add SmoothieSEM parameters to spherical meshes.

Parameters
  • elements_per_wavelength salvus._core.types.float_ — Elements per wavelength.
  • source_latitude salvus._core.types.float_ — Latitude of the seismic source.
  • source_longitude salvus._core.types.float_ — Longitude of the seismic source.
  • num_lateral_elements salvus._core.types.int_ — Number of lateral elements per hemisphere.
  • tensor_order salvus._core.types.int_ — Tensor order for the mesh.
  • lateral_refinements SphericalSmoothieSemLateralRefinement | list[SphericalSmoothieSemLateralRefinement] | None — A list of lateral refinements to add.
  • max_frequency_in_hertz salvus._core.types.float_ | None — Max mesh frequency.
  • min_period_in_seconds salvus._core.types.float_ | None — Minimum period in seconds.
  • mask_generator SurfaceMaskGenerator | RayMaskGenerator | None — . An optional mesh masking callback.
Attributes
min_period_in_seconds float

Minimum mesh 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
get_lateral_refinements()
def get_lateral_refinements(self) -> list[dict] | None: ...

Get a any lateral refinements as a list of dictionaries.

The list can then be passed directly to the SmoothieSem mesh schema.

Returns list[dict] | None — The lateral refinements as a list of dictionaries.
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