salvus.project.meshing
salvus.project.meshing salvus project meshing Meshing functionality for SalvusProject.
Functions
mesh_cartesian_ocean_lm()
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_modelmodel.background._BackgroundBase — The background model.min_vertical_coordinatefloat — The minimum vertical coordinate in the mesh.max_vertical_coordinatefloat — The maximum vertical coordinate in the mesh.mesh_configurationMeshConfiguration — The mesh configuration.topography_configurationtopography._TopographyConfigurationInternal | None — The topography configuration.bathymetry_configurationbathymetry._BathymetryConfigurationInternal | None — The bathymetry configuration.bm_shiftfloat — For UTM domains — shift away from the reference datum.interlayer_coarsening_policyInterlayerCoarseningPolicy | None — An optional interlayer coarsening policy that allows for overriding the defaultInterlayerDoublingpolicy. Can be useful for challenging meshes with thin layers.execution_policybindings.ExecutionPolicy — Execution policy governing the maximum allowable parallelism of child routines.
Returns UnstructuredMesh — A cartesian mesh with oceans.
mesh_from_circular_domain()
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.topographytopography._TopographyConfigurationInternal | None — Topography configuration.bathymetrybathymetry._BathymetryConfigurationInternal | None — Bathymetry configuration.mesh_parametersMeshConfiguration — The mesh parameters.modelmodel._ModelConfigurationInternal — The model configuration.verbosityint — Verbosity level.execution_policybindings.ExecutionPolicy — Execution policy governing the maximum allowable parallelism of child routines.
Returns UnstructuredMesh
mesh_from_domain()
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_configurationMeshConfiguration — All model independent mesh parameters.model_configurationmodel._ModelConfigurationInternal — A set of background and volume models.topography_configurationtopography._TopographyConfigurationInternal | None — A list of topography models.bathymetry_configurationbathymetry._BathymetryConfigurationInternal | None — A list of bathymetry models.verbosityint — Verbosity level of the operation.interlayer_coarsening_policyInterlayerCoarseningPolicy | None — An optional interlayer coarsening policy that allows for overriding the defaultInterlayerDoublingpolicy. Can be useful for challenging meshes with thin layers. Currently only considered for meshes with bathymetry in cartesian domains.execution_policybindings.ExecutionPolicy — Execution policy governing the maximum allowable parallelism of child routines.skip_validationbool — Skip the mesh validation step.
Returns UnstructuredMesh
mesh_from_spherical_polygon()
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.topographytopography._TopographyConfigurationInternal | None — Topography configuration.bathymetrybathymetry._BathymetryConfigurationInternal | None — Bathymetry configuration.mesh_parametersMeshConfiguration — The mesh parameters.spherical_polygonSphericalPolygon | None — The spherical polygon to use.modelmodel._ModelConfigurationInternal — The model configuration.verbosityint — Verbosity level.
Returns UnstructuredMesh
simple_mesh_selector()
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_modelmodel.background._BackgroundBase — Background model.min_vertical_coordinatefloat — The minimum vertical coordinate in the mesh.max_vertical_coordinatefloat — The maximum vertical coordinate in the mesh.mesh_configurationMeshConfiguration — The mesh configuration.bm_shiftfloat — For UTM domains — shift away from the reference datum.execution_policybindings.ExecutionPolicy — Execution policy governing the maximum allowable parallelism of child routines.
Returns UnstructuredMesh