Mondaic

salvus.project.meshing

salvus.project.meshing salvus project meshing

Meshing functionality for SalvusProject.

Functions

mesh_cartesian_ocean_lm()

def mesh_cartesian_ocean_lm(
    domain: _domain.Domain,
    background_model: model.background._BackgroundBase,
    min_vertical_coordinate: float,
    max_vertical_coordinate: float,
    mesh_configuration: MeshConfiguration,
    topography_configuration: (
        topography._TopographyConfigurationInternal | None
    ),
    bathymetry_configuration: (
        bathymetry._BathymetryConfigurationInternal | None
    ),
    bm_shift: float = 0.0,
    interlayer_coarsening_policy: InterlayerCoarseningPolicy | None = None,
    execution_policy: bindings.ExecutionPolicy = salvus._core.lib.salvus_core_python_bindings.ExecutionPolicy,
) -> UnstructuredMesh: ...

Mesh 2- or 3-D cartesian domain with oceans using the layered mesher.

Parameters
  • domain _domain.Domain — The domain.
  • background_model model.background._BackgroundBase — The background model.
  • min_vertical_coordinate float — The minimum vertical coordinate in the mesh.
  • max_vertical_coordinate float — The maximum vertical coordinate in the mesh.
  • mesh_configuration MeshConfiguration — The mesh configuration.
  • topography_configuration topography._TopographyConfigurationInternal | None — The topography configuration.
  • bathymetry_configuration bathymetry._BathymetryConfigurationInternal | None — The bathymetry configuration.
  • bm_shift float — For UTM domains — shift away from the reference datum.
  • interlayer_coarsening_policy InterlayerCoarseningPolicy | None — An optional interlayer coarsening policy that allows for overriding the default InterlayerDoubling policy. Can be useful for challenging meshes with thin layers.
  • execution_policy bindings.ExecutionPolicy — Execution policy governing the maximum allowable parallelism of child routines.
Returns UnstructuredMesh — A cartesian mesh with oceans.

mesh_from_circular_domain()

def mesh_from_circular_domain(
    domain: _domain.dim2.CircularDomain,
    topography: topography._TopographyConfigurationInternal | None,
    bathymetry: bathymetry._BathymetryConfigurationInternal | None,
    mesh_parameters: MeshConfiguration,
    model: model._ModelConfigurationInternal,
    verbosity: int = 1,
    execution_policy: bindings.ExecutionPolicy = salvus._core.lib.salvus_core_python_bindings.ExecutionPolicy,
) -> UnstructuredMesh: ...

Build a mesh from a 2-D circular domain.

Parameters
  • domain _domain.dim2.CircularDomain — Domain.
  • topography topography._TopographyConfigurationInternal | None — Topography configuration.
  • bathymetry bathymetry._BathymetryConfigurationInternal | None — Bathymetry configuration.
  • mesh_parameters MeshConfiguration — The mesh parameters.
  • model model._ModelConfigurationInternal — The model configuration.
  • verbosity int — Verbosity level.
  • execution_policy bindings.ExecutionPolicy — Execution policy governing the maximum allowable parallelism of child routines.
Returns UnstructuredMesh

mesh_from_domain()

def mesh_from_domain(
    domain: _domain.Domain,
    mesh_configuration: MeshConfiguration,
    model_configuration: model._ModelConfigurationInternal,
    topography_configuration: (
        topography._TopographyConfigurationInternal | None
    ) = None,
    bathymetry_configuration: (
        bathymetry._BathymetryConfigurationInternal | None
    ) = None,
    verbosity: int = 1,
    interlayer_coarsening_policy: InterlayerCoarseningPolicy | None = None,
    execution_policy: bindings.ExecutionPolicy = salvus._core.lib.salvus_core_python_bindings.ExecutionPolicy,
    skip_validation: bool = True,
) -> UnstructuredMesh: ...

Create a concrete unstructured mesh from a few pieces of information.

This function is the central entry point to generate meshes from whatever information is defined in the project. An important design aspect of this function is that it must be unit testable.

Parameters
  • domain _domain.Domain — The domain of interest.
  • mesh_configuration MeshConfiguration — All model independent mesh parameters.
  • model_configuration model._ModelConfigurationInternal — A set of background and volume models.
  • topography_configuration topography._TopographyConfigurationInternal | None — A list of topography models.
  • bathymetry_configuration bathymetry._BathymetryConfigurationInternal | None — A list of bathymetry models.
  • verbosity int — Verbosity level of the operation.
  • interlayer_coarsening_policy InterlayerCoarseningPolicy | None — An optional interlayer coarsening policy that allows for overriding the default InterlayerDoubling policy. Can be useful for challenging meshes with thin layers. Currently only considered for meshes with bathymetry in cartesian domains.
  • execution_policy bindings.ExecutionPolicy — Execution policy governing the maximum allowable parallelism of child routines.
  • skip_validation bool — Skip the mesh validation step.
Returns UnstructuredMesh

mesh_from_spherical_polygon()

def mesh_from_spherical_polygon(
    domain: _domain.dim3.SphericalDomain,
    topography: topography._TopographyConfigurationInternal | None,
    bathymetry: bathymetry._BathymetryConfigurationInternal | None,
    mesh_parameters: MeshConfiguration,
    spherical_polygon: SphericalPolygon | None,
    model: model._ModelConfigurationInternal,
    verbosity: int = 1,
) -> UnstructuredMesh: ...

Build a mesh from a spherical polygon.

Parameters
  • domain _domain.dim3.SphericalDomain — Domain.
  • topography topography._TopographyConfigurationInternal | None — Topography configuration.
  • bathymetry bathymetry._BathymetryConfigurationInternal | None — Bathymetry configuration.
  • mesh_parameters MeshConfiguration — The mesh parameters.
  • spherical_polygon SphericalPolygon | None — The spherical polygon to use.
  • model model._ModelConfigurationInternal — The model configuration.
  • verbosity int — Verbosity level.
Returns UnstructuredMesh

simple_mesh_selector()

def simple_mesh_selector(
    domain: _domain.Domain,
    background_model: model.background._BackgroundBase,
    min_vertical_coordinate: float,
    max_vertical_coordinate: float,
    mesh_configuration: MeshConfiguration,
    bm_shift: float = 0.0,
    execution_policy: bindings.ExecutionPolicy = salvus._core.lib.salvus_core_python_bindings.ExecutionPolicy,
) -> UnstructuredMesh: ...

Helper function to construct meshes from domains and other parameters.

Parameters
  • domain _domain.Domain — Domain.
  • background_model model.background._BackgroundBase — Background model.
  • min_vertical_coordinate float — The minimum vertical coordinate in the mesh.
  • max_vertical_coordinate float — The maximum vertical coordinate in the mesh.
  • mesh_configuration MeshConfiguration — The mesh configuration.
  • bm_shift float — For UTM domains — shift away from the reference datum.
  • execution_policy bindings.ExecutionPolicy — Execution policy governing the maximum allowable parallelism of child routines.
Returns UnstructuredMesh