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

salvus.mesh.layered_meshing.detail.mesh_from_domain

Mesh from domain.

Functions

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
  • d salvus.project.domain.Domain — The mesh’s domain.
  • mp salvus.mesh.layered_meshing.meshing_protocol.meshing_protocol.MeshingProtocol — The meshing protocol.
  • mr salvus.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()

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
  • domain salvus.project.domain.Domain — The mesh’s 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] — Either a single Material, a LayeredModel, or a MeshingProtocol. If either a Material or a LayeredModel is passed, it will internally be wrapped in a default MeshingProtocol. For complete control over the meshing algorithms and associated policies, pass a MeshingProtocol object that contains the LayeredModel you would like to mesh.
  • mesh_resolution salvus.project.components.types.MeshResolution — The desired mesh resolution.
  • model_override Optional[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.