salvus.mesh.layered_meshing.detail.mesh_from_domain
Mesh from domain.
Functions
create_layered_mesh()
create_layered_mesh()def create_layered_mesh(
d: salvus.project.domain.Domain,
mp: salvus.mesh.layered_meshing.meshing_protocol.meshing_protocol.MeshingProtocol,
mr: salvus.project.components.types.MeshResolution,
) -> Tuple[
salvus.project.domain.Domain,
salvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh,
salvus.mesh.layered_meshing.layered_model.layered_model.LayeredModel,
]: ...Create a mesh.
This function serves as the central entry point for constructing a mesh
from a LayeredModel, which is here wrapped inside a MeshingProtocol. In
addition to returning the constructed mesh, the supplied LayeredModel
will also be returned, after “realization”. This is useful, for instance,
to then interpolate material parameters onto the mesh.
Parameters
dsalvus.project.domain.Domain — The mesh’s domain.mpsalvus.mesh.layered_meshing.meshing_protocol.meshing_protocol.MeshingProtocol — The meshing protocol.mrsalvus.project.components.types.MeshResolution — The desired mesh resolution.
Returns Tuple[salvus.project.domain.Domain, salvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh, salvus.mesh.layered_meshing.layered_model.layered_model.LayeredModel] — A tuple of an mesh and a realized layered model.
mesh_from_domain()
mesh_from_domain()def mesh_from_domain(
domain: salvus.project.domain.Domain,
model: Union[
salvus.material.base_materials.Material,
salvus.mesh.layered_meshing.layered_model.layered_model.LayeredModel,
salvus.mesh.layered_meshing.meshing_protocol.meshing_protocol.MeshingProtocol,
],
mesh_resolution: salvus.project.components.types.MeshResolution,
model_override: Optional[salvus.material.base_materials.Material] = None,
) -> (
salvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh
): ...Create a mesh.
Construct a mesh from a domain and meshing protocol that aims to respect a desired mesh resolution. In addition to mesh creation, this function will also interpolate model parameters and find side sets, returning a mesh that is ready for a Salvus simulation
Parameters
domainsalvus.project.domain.Domain — The mesh’s domain.modelUnion[salvus.material.base_materials.Material, salvus.mesh.layered_meshing.layered_model.layered_model.LayeredModel, salvus.mesh.layered_meshing.meshing_protocol.meshing_protocol.MeshingProtocol] — Either a singleMaterial, aLayeredModel, or aMeshingProtocol. If either aMaterialor aLayeredModelis passed, it will internally be wrapped in a defaultMeshingProtocol. For complete control over the meshing algorithms and associated policies, pass aMeshingProtocolobject that contains theLayeredModelyou would like to mesh.mesh_resolutionsalvus.project.components.types.MeshResolution — The desired mesh resolution.model_overrideOptional[salvus.material.base_materials.Material] — A single material instance that will override the size functions that the mesh has been built with.
Returns salvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh — A mesh ready for simulation.