Mondaic

salvus.mesh.simple_mesh

salvus.mesh.simple_mesh salvus mesh simple_mesh

User-friendly meshing interface.

Classes

Cartesian2D

class Cartesian2D(salvus.mesh.simple_mesh.config.BaseMesh):
    def __init__(self) -> None: ...

The base mesh class.

Cartesian2D mesh.

Methods
apply()
def apply(self, d: dict | _DeepSetter) -> None: ...

Set the contents with a dictionary.

Parameters
  • d dict | _DeepSetter — The dictionary to set.
Returns None
copy()
def copy(self) -> _DeepSetter: ...

Return a deep copy of the object.

Returns _DeepSetter
create_mesh()
def create_mesh(
    self,
    verbose: bool = False,
    get_dictionary: bool = False,
    processing_function: (
        collections.abc.Callable
        | SurfaceMaskGenerator
        | RayMaskGenerator
        | None
    ) = None,
) -> UnstructuredMesh: ...

Create the actual unstructured mesh object.

Parameters
  • verbose bool — Increase verbosity.
  • get_dictionary bool — Return the dictionary defining the mesh.
  • processing_function collections.abc.Callable | SurfaceMaskGenerator | RayMaskGenerator | None — optional call back function for mesh processing called directly after the mesh is finished to do efficient post processing, e.g. masking
Returns UnstructuredMesh
get_dictionary()
def get_dictionary(self) -> dict: ...

Get the contents of this object as a dictionary.

Returns dict
validate()
def validate(self) -> None: ...

Validates the current state of the configuration against its schema.

Returns None

Cartesian2DHomogeneous

class Cartesian2DHomogeneous(salvus.mesh.simple_mesh.config.BaseMesh):
    def __init__(self) -> None: ...

The base mesh class.

Cartesian2DHomogeneous mesh.

Methods
apply()
def apply(self, d: dict | _DeepSetter) -> None: ...

Set the contents with a dictionary.

Parameters
  • d dict | _DeepSetter — The dictionary to set.
Returns None
copy()
def copy(self) -> _DeepSetter: ...

Return a deep copy of the object.

Returns _DeepSetter
create_mesh()
def create_mesh(
    self,
    verbose: bool = False,
    get_dictionary: bool = False,
    processing_function: (
        collections.abc.Callable
        | SurfaceMaskGenerator
        | RayMaskGenerator
        | None
    ) = None,
) -> UnstructuredMesh: ...

Create the actual unstructured mesh object.

Parameters
  • verbose bool — Increase verbosity.
  • get_dictionary bool — Return the dictionary defining the mesh.
  • processing_function collections.abc.Callable | SurfaceMaskGenerator | RayMaskGenerator | None — optional call back function for mesh processing called directly after the mesh is finished to do efficient post processing, e.g. masking
Returns UnstructuredMesh
get_dictionary()
def get_dictionary(self) -> dict: ...

Get the contents of this object as a dictionary.

Returns dict
validate()
def validate(self) -> None: ...

Validates the current state of the configuration against its schema.

Returns None

Cartesian3D

class Cartesian3D(salvus.mesh.simple_mesh.config.BaseMesh):
    def __init__(self) -> None: ...

The base mesh class.

Cartesian3D mesh.

Methods
apply()
def apply(self, d: dict | _DeepSetter) -> None: ...

Set the contents with a dictionary.

Parameters
  • d dict | _DeepSetter — The dictionary to set.
Returns None
copy()
def copy(self) -> _DeepSetter: ...

Return a deep copy of the object.

Returns _DeepSetter
create_mesh()
def create_mesh(
    self,
    verbose: bool = False,
    get_dictionary: bool = False,
    processing_function: (
        collections.abc.Callable
        | SurfaceMaskGenerator
        | RayMaskGenerator
        | None
    ) = None,
) -> UnstructuredMesh: ...

Create the actual unstructured mesh object.

Parameters
  • verbose bool — Increase verbosity.
  • get_dictionary bool — Return the dictionary defining the mesh.
  • processing_function collections.abc.Callable | SurfaceMaskGenerator | RayMaskGenerator | None — optional call back function for mesh processing called directly after the mesh is finished to do efficient post processing, e.g. masking
Returns UnstructuredMesh
get_dictionary()
def get_dictionary(self) -> dict: ...

Get the contents of this object as a dictionary.

Returns dict
validate()
def validate(self) -> None: ...

Validates the current state of the configuration against its schema.

Returns None

Cartesian3DHomogeneous

class Cartesian3DHomogeneous(salvus.mesh.simple_mesh.config.BaseMesh):
    def __init__(self) -> None: ...

The base mesh class.

Cartesian3DHomogeneous mesh.

Methods
apply()
def apply(self, d: dict | _DeepSetter) -> None: ...

Set the contents with a dictionary.

Parameters
  • d dict | _DeepSetter — The dictionary to set.
Returns None
copy()
def copy(self) -> _DeepSetter: ...

Return a deep copy of the object.

Returns _DeepSetter
create_mesh()
def create_mesh(
    self,
    verbose: bool = False,
    get_dictionary: bool = False,
    processing_function: (
        collections.abc.Callable
        | SurfaceMaskGenerator
        | RayMaskGenerator
        | None
    ) = None,
) -> UnstructuredMesh: ...

Create the actual unstructured mesh object.

Parameters
  • verbose bool — Increase verbosity.
  • get_dictionary bool — Return the dictionary defining the mesh.
  • processing_function collections.abc.Callable | SurfaceMaskGenerator | RayMaskGenerator | None — optional call back function for mesh processing called directly after the mesh is finished to do efficient post processing, e.g. masking
Returns UnstructuredMesh
get_dictionary()
def get_dictionary(self) -> dict: ...

Get the contents of this object as a dictionary.

Returns dict
validate()
def validate(self) -> None: ...

Validates the current state of the configuration against its schema.

Returns None

Globe3DAxialSymmetry

class Globe3DAxialSymmetry(salvus.mesh.simple_mesh.config.BaseMesh):
    def __init__(self) -> None: ...

The base mesh class.

Globe3DAxialSymmetry mesh.

Methods
apply()
def apply(self, d: dict | _DeepSetter) -> None: ...

Set the contents with a dictionary.

Parameters
  • d dict | _DeepSetter — The dictionary to set.
Returns None
copy()
def copy(self) -> _DeepSetter: ...

Return a deep copy of the object.

Returns _DeepSetter
create_mesh()
def create_mesh(
    self,
    verbose: bool = False,
    get_dictionary: bool = False,
    processing_function: (
        collections.abc.Callable
        | SurfaceMaskGenerator
        | RayMaskGenerator
        | None
    ) = None,
) -> UnstructuredMesh: ...

Create the actual unstructured mesh object.

Parameters
  • verbose bool — Increase verbosity.
  • get_dictionary bool — Return the dictionary defining the mesh.
  • processing_function collections.abc.Callable | SurfaceMaskGenerator | RayMaskGenerator | None — optional call back function for mesh processing called directly after the mesh is finished to do efficient post processing, e.g. masking
Returns UnstructuredMesh
get_dictionary()
def get_dictionary(self) -> dict: ...

Get the contents of this object as a dictionary.

Returns dict
validate()
def validate(self) -> None: ...

Validates the current state of the configuration against its schema.

Returns None

SmoothieSEM

class SmoothieSEM(salvus.mesh.simple_mesh.config.BaseMesh):
    def __init__(self) -> None: ...

The base mesh class.

SmoothieSEM mesh.

Methods
apply()
def apply(self, d: dict | _DeepSetter) -> None: ...

Set the contents with a dictionary.

Parameters
  • d dict | _DeepSetter — The dictionary to set.
Returns None
copy()
def copy(self) -> _DeepSetter: ...

Return a deep copy of the object.

Returns _DeepSetter
create_mesh()
def create_mesh(
    self,
    verbose: bool = False,
    get_dictionary: bool = False,
    processing_function: (
        collections.abc.Callable
        | SurfaceMaskGenerator
        | RayMaskGenerator
        | None
    ) = None,
) -> UnstructuredMesh: ...

Create the actual unstructured mesh object.

Parameters
  • verbose bool — Increase verbosity.
  • get_dictionary bool — Return the dictionary defining the mesh.
  • processing_function collections.abc.Callable | SurfaceMaskGenerator | RayMaskGenerator | None — optional call back function for mesh processing called directly after the mesh is finished to do efficient post processing, e.g. masking
Returns UnstructuredMesh
get_dictionary()
def get_dictionary(self) -> dict: ...

Get the contents of this object as a dictionary.

Returns dict
validate()
def validate(self) -> None: ...

Validates the current state of the configuration against its schema.

Returns None

SphericalChunk3D

class SphericalChunk3D(
    salvus.mesh.simple_mesh.basic_mesh.SphericalChunkBuiltIn3D
):
    def __init__(
        self,
        model: str | typing.Callable = "prem_iso_no_crust",
        period: float = 150.0,
        latitude_extent: float = 45.0,
        longitude_extent: float = 45.0,
        tensor_order: int = 1,
        latitude_center: float = 0.0,
        longitude_center: float = 0.0,
        elements_per_wavelength: float = 2.0,
        minimum_radius_in_km: float = 3755.0,
        ab_params: AbsorbingBoundaryParameters | None = None,
        constant_q_frequency_band: tuple[float, float] | None = None,
        use_lm: bool = True,
    ): ...

Base class to handle simple spherical chunk meshes using one of the built in models.

Compatible class with a few defaults. Please use SphericalChunkBuiltIn3D from the basic_mesh module instead.

Parameters
  • model str | typing.Callable — The name of the 1-D background model.
  • period float — The minimum seismic period for which to generate the mesh. This value is used in conjunction with elements_per_wavelength to control the accuracy of the simulation.
  • latitude_extent float — The latitudinal extent of the mesh from its center in degrees.
  • longitude_extent float — The longitudinal extent of the mesh from its center in degrees.
  • tensor_order int — The order of the model representation (1, 2, or 4). See the “Model Order” tutorial on the website for more details.
  • latitude_center float — The latitudinal center of the mesh in degrees.
  • longitude_center float — The longitudinal center of the mesh in degrees. elements_per_wavelength: Given the 1-D background model and period as specified, ensure that there are at least this many elements per minimum wavelength throughout the mesh volume.
  • elements_per_wavelength float — The desired elements per wavelength for the to be created mesh.
  • minimum_radius_in_km float — Minimum radius of the mesh in kilometers.
  • ab_params AbsorbingBoundaryParameters | None — Parameters controlling the extrusion of the domain for the purposes of adding absorbing boundaries.
  • constant_q_frequency_band tuple[float, float] | None — A tuple of frequencies (low, high) over which Q should be approximately constant. If not passed, the band will be estimated min_period_in_seconds.
  • use_lm bool — Use the layered meshing backend.
Methods
apply()
def apply(self, d: dict | _DeepSetter) -> None: ...

Set the contents with a dictionary.

Parameters
  • d dict | _DeepSetter — The dictionary to set.
Returns None
copy()
def copy(self) -> _DeepSetter: ...

Return a deep copy of the object.

Returns _DeepSetter
create_mesh()
def create_mesh(
    self,
    execution_policy: bindings.ExecutionPolicy = salvus._core.lib.salvus_core_python_bindings.ExecutionPolicy,
    get_dictionary: bool = False,
) -> UnstructuredMesh | tuple[UnstructuredMesh, dict]: ...

Build the mesh described by this configuration.

Parameters
  • execution_policy bindings.ExecutionPolicy — Execution policy used while building the mesh.
  • get_dictionary bool — Also return the dictionary representation of the mesh configuration.
Returns UnstructuredMesh | tuple[UnstructuredMesh, dict] — The generated mesh, or a tuple of the mesh and the configuration dictionary if get_dictionary is True.
get_dictionary()
def get_dictionary(self) -> dict: ...

Get the contents of this object as a dictionary.

Returns dict
validate()
def validate(self) -> None: ...

Validates the current state of the configuration against its schema.

Returns None

SmoothieSEM

class SmoothieSEM(salvus.mesh.simple_mesh.config.BaseMesh):
    def __init__(self) -> None: ...

The base mesh class.

SmoothieSEM mesh.

Methods
apply()
def apply(self, d: dict | _DeepSetter) -> None: ...

Set the contents with a dictionary.

Parameters
  • d dict | _DeepSetter — The dictionary to set.
Returns None
copy()
def copy(self) -> _DeepSetter: ...

Return a deep copy of the object.

Returns _DeepSetter
create_mesh()
def create_mesh(
    self,
    verbose: bool = False,
    get_dictionary: bool = False,
    processing_function: (
        collections.abc.Callable
        | SurfaceMaskGenerator
        | RayMaskGenerator
        | None
    ) = None,
) -> UnstructuredMesh: ...

Create the actual unstructured mesh object.

Parameters
  • verbose bool — Increase verbosity.
  • get_dictionary bool — Return the dictionary defining the mesh.
  • processing_function collections.abc.Callable | SurfaceMaskGenerator | RayMaskGenerator | None — optional call back function for mesh processing called directly after the mesh is finished to do efficient post processing, e.g. masking
Returns UnstructuredMesh
get_dictionary()
def get_dictionary(self) -> dict: ...

Get the contents of this object as a dictionary.

Returns dict
validate()
def validate(self) -> None: ...

Validates the current state of the configuration against its schema.

Returns None

Submodules

Used in tutorials