Mondaic
This API reference is not for the latest stable Salvus version.

salvus.project.configuration.mesh_configuration

Classes

MeshConfiguration

class MeshConfiguration(
    salvus.flow.utils.serialization_helpers.SerializationMixin
):
    def __init__(
        self,
        max_frequency_in_hertz: Union[
            int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64
        ],
        elements_per_wavelength: Union[
            int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64
        ],
        tensor_order: Union[int, numpy.int32, numpy.int64] = 1,
        max_depth_in_meters: Optional[
            int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64
        ] = None,
        absorbing_boundaries: Optional[
            salvus.mesh.simple_mesh.basic_mesh.AbsorbingBoundaryParameters
        ] = None,
        mask_generator: Optional[
            salvus.mesh.mask_generators.SurfaceMaskGenerator,
            salvus.mesh.mask_generators.RayMaskGenerator,
        ] = None,
    ) -> None:
        ...

Parameters to turn abstract simulation settings into a concrete mesh.

Parameters
  • max_frequency_in_hertz Union[int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64] — Max mesh frequency.
  • elements_per_wavelength Union[int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64] — Elements per wavelength.
  • tensor_order Union[int, numpy.int32, numpy.int64] — Tensor order for the mesh.
  • max_depth_in_meters Optional[int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64] — Maximum depth in meters of the mesh.
  • absorbing_boundaries Optional[salvus.mesh.simple_mesh.basic_mesh.AbsorbingBoundaryParameters] — Absorbing boundary configuration.
  • mask_generator Optional[salvus.mesh.mask_generators.SurfaceMaskGenerator, salvus.mesh.mask_generators.RayMaskGenerator] — A mesh masking callback function.
Attributes
min_period_in_seconds float

Minimum mesh period in seconds.

Methods
from_json()
def from_json(d: Dict) -> Any:
    ...

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

Parameters
  • d Dict — Dictionary containing its init parameters and a few other things.
Returns Any
to_json()
def to_json(self, external_file_hash: Optional[str] = None) -> Dict:
    ...

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

Parameters
  • external_file_hash Optional[str] — 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.
Returns Dict

ModelDependentMeshParameters

class ModelDependentMeshParameters(
    salvus.flow.utils.serialization_helpers.SerializationMixin
):
    def __init__(
        self,
        mesh_parameters: salvus.project.configuration.mesh_configuration.MeshConfiguration,
        model_configuration: salvus.project.configuration.model.ModelConfiguration,
        topography_configuration: Optional[
            salvus.project.configuration.topography.TopographyConfiguration
        ],
        bathymetry_configuration: Optional[
            salvus.project.configuration.bathymetry.BathymetryConfiguration
        ] = None,
    ):
        ...

Model dependent mesh parameters.

Parameters
  • mesh_parameters salvus.project.configuration.mesh_configuration.MeshConfiguration — The mesh parameters.
  • model_configuration salvus.project.configuration.model.ModelConfiguration — Model configuration.
  • topography_configuration Optional[salvus.project.configuration.topography.TopographyConfiguration] — Configuration for the topography.
  • bathymetry_configuration Optional[salvus.project.configuration.bathymetry.BathymetryConfiguration] — Configuration for the bathymetry.
Methods
from_json()
def from_json(d: Dict) -> Any:
    ...

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

Parameters
  • d Dict — Dictionary containing its init parameters and a few other things.
Returns Any
to_json()
def to_json(self, external_file_hash: Optional[str] = None) -> Dict:
    ...

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

Parameters
  • external_file_hash Optional[str] — 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.
Returns Dict

SphericalSmoothieSemLateralRefinement

class SphericalSmoothieSemLateralRefinement(builtins.object):
    def __init__(
        self,
        min_theta_in_degrees: Union[
            int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64
        ],
        max_theta_in_degrees: Union[
            int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64
        ],
        min_radius_in_meters: Union[
            int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64
        ],
        max_radius_in_meters: Optional[
            int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64
        ] = None,
        min_phi_in_degrees: Optional[
            int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64
        ] = None,
        max_phi_in_degrees: Optional[
            int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64
        ] = 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 Union[int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64] — Min theta refinement boundary.
  • max_theta_in_degrees Union[int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64] — Max theta refinement boundary.
  • min_radius_in_meters Union[int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64] — Min radius of the refinement.
  • max_radius_in_meters Optional[int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64] — Max radius of the refinement. Defaults to None (which represents the surface of the Earth).
  • min_phi_in_degrees Optional[int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64] — Min phi refinement boundary. Defaults to None (which results in a refinement in a band around the globe).
  • max_phi_in_degrees Optional[int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64] — 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: Union[
            int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64
        ],
        source_latitude: Union[
            int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64
        ],
        source_longitude: Union[
            int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64
        ],
        num_lateral_elements: Union[int, numpy.int32, numpy.int64],
        tensor_order: Union[int, numpy.int32, numpy.int64] = 1,
        lateral_refinements: Optional[
            salvus.project.configuration.mesh_configuration.SphericalSmoothieSemLateralRefinement,
            List[
                salvus.project.configuration.mesh_configuration.SphericalSmoothieSemLateralRefinement
            ],
        ] = None,
        max_frequency_in_hertz: Optional[
            int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64
        ] = None,
        min_period_in_seconds: Optional[
            int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64
        ] = None,
        mask_generator: Optional[
            salvus.mesh.mask_generators.SurfaceMaskGenerator,
            salvus.mesh.mask_generators.RayMaskGenerator,
        ] = None,
    ):
        ...

A mixin add SmoothieSEM parameters to spherical meshes.

Parameters
  • elements_per_wavelength Union[int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64] — Elements per wavelength.
  • source_latitude Union[int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64] — Latitude of the seismic source.
  • source_longitude Union[int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64] — Longitude of the seismic source.
  • num_lateral_elements Union[int, numpy.int32, numpy.int64] — Number of lateral elements per hemisphere.
  • tensor_order Union[int, numpy.int32, numpy.int64] — Tensor order for the mesh.
  • lateral_refinements Optional[salvus.project.configuration.mesh_configuration.SphericalSmoothieSemLateralRefinement, List[salvus.project.configuration.mesh_configuration.SphericalSmoothieSemLateralRefinement]] — A list of lateral refinements to add.
  • max_frequency_in_hertz Optional[int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64] — Max mesh frequency.
  • min_period_in_seconds Optional[int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64] — Minimum period in seconds.
  • mask_generator Optional[salvus.mesh.mask_generators.SurfaceMaskGenerator, salvus.mesh.mask_generators.RayMaskGenerator] — . An optional mesh masking callback.
Attributes
min_period_in_seconds float

Minimum mesh period in seconds.

Methods
from_json()
def from_json(d: Dict) -> Any:
    ...

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

Parameters
  • d Dict — Dictionary containing its init parameters and a few other things.
Returns Any
get_lateral_refinements()
def get_lateral_refinements(self) -> Optional[List[Dict]]:
    ...

Get a any lateral refinements as a list of dictionaries.

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

Returns Optional[List[Dict]] — The lateral refinements as a list of dictionaries.
to_json()
def to_json(self, external_file_hash: Optional[str] = None) -> Dict:
    ...

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

Parameters
  • external_file_hash Optional[str] — 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.
Returns Dict