Version:

salvus.mesh.layered_meshing.detail.mesh_from_domain

salvus.mesh.layered_meshing.detail.mesh_from_domain salvus mesh layered_meshing detail mesh_from_domain
Mesh from domain.

Functions

create_layered_mesh()

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.
SIGNATURE
def create_layered_mesh(
    d: domain_module.Domain,
    mp: MeshingProtocol,
    mr: MeshResolution,
    timer: Timer | None = None,
    verbosity: int = 1,
) -> tuple[domain_module.Domain, UnstructuredMesh, LayeredModel]: ...
ARGUMENTS
Required
d
Type:domain_module.Domain
Description:
The mesh's domain.
Required
mp
Type:MeshingProtocol
Description:
The meshing protocol.
Required
mr
Type:MeshResolution
Description:
The desired mesh resolution.
Optional
timer
Type:Timer | None
Default value:None
Description:
Execution timer.
Optional
verbosity
Type:int
Default value:1
Description:
The verbosity level. Set to > 1 for more verbose output.
RETURNS
Return type: tuple[domain_module.Domain, UnstructuredMesh, LayeredModel]
A tuple of an mesh and a realized layered model.

future_mesh_from_domain()

Create a Mesh from a domain.
This is an experimental alternative to mesh_from_domain that creates a block-wise mesh from a layered model.
The blocks will be constructed per entry in the layered model. This interface WILL NOT ATTACH the legacy fields fluid or block, as those are now fully defined block-wise, and not element-wise.
SIGNATURE
def future_mesh_from_domain(
    domain: Domain,
    model: Material | LayeredModel | MeshingProtocol,
    mesh_resolution: MeshResolution,
    model_override: Material | str | None = None,
    execution_policy: bindings.ExecutionPolicy = salvus._core.lib.salvus_core_python_bindings.ExecutionPolicy,
    timer: Timer | None = None,
    verbosity: int = 1,
) -> Mesh: ...
ARGUMENTS
Required
domain
Type:Domain
Description:
The mesh's domain.
Required
model
Type:Material | LayeredModel | MeshingProtocol
Description:
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.
Required
mesh_resolution
Type:MeshResolution
Description:
The desired mesh resolution.
Optional
model_override
Type:Material | str | None
Default value:None
Description:
A single material instance that will override the size functions that the mesh has been built with. Alternatively the string "skip_model_interpolation" can be passed here which will return a mesh with no model parameters attached.
Optional
execution_policy
Type:bindings.ExecutionPolicy
Default value:<salvus._core.lib.salvus_core_python_bindings.ExecutionPolicy object at 0x7c032e5b5970>
Description:
Execution policy governing the maximum allowable parallelism of child routines.
Optional
timer
Type:Timer | None
Default value:None
Description:
Execution timer.
Optional
verbosity
Type:int
Default value:1
Description:
The verbosity level. Set it to > 1 to get more detailed timing information.
RETURNS
Return type: Mesh

interpolate_model()

Interpolates material parameters onto a mesh and identifies fluid elements.
This function processes a given domain and a list of material models, interpolating their parameters onto the provided mesh. It also identifies fluid elements in the mesh based on the type of material model.
SIGNATURE
def interpolate_model(
    mesh_resolution: MeshResolution,
    mesh: UnstructuredMesh,
    models: list[Material],
    execution_policy: bindings.ExecutionPolicy = salvus._core.lib.salvus_core_python_bindings.ExecutionPolicy,
) -> UnstructuredMesh: ...
ARGUMENTS
Required
mesh_resolution
Type:MeshResolution
Description:
An object containing mesh resolution and precision details.
Required
mesh
Type:UnstructuredMesh
Description:
The mesh object to which the material parameters will be interpolated.
Required
models
Type:list[Material]
Description:
A list of material models, where each model corresponds to a block in the mesh.
Optional
execution_policy
Type:bindings.ExecutionPolicy
Default value:<salvus._core.lib.salvus_core_python_bindings.ExecutionPolicy object at 0x7c032c732030>
Description:
Execution policy governing the maximum allowable parallelism of child routines.
RETURNS
Return type: UnstructuredMesh
The updated mesh object with interpolated material parameters and a "fluid" field indicating fluid elements.

mesh_from_domain()

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
SIGNATURE
def mesh_from_domain(
    domain: Domain,
    model: Material | LayeredModel | MeshingProtocol,
    mesh_resolution: MeshResolution,
    model_override: Material | str | None = None,
    execution_policy: bindings.ExecutionPolicy = salvus._core.lib.salvus_core_python_bindings.ExecutionPolicy,
    timer: Timer | None = None,
    verbosity: int = 1,
) -> UnstructuredMesh: ...
ARGUMENTS
Required
domain
Type:Domain
Description:
The mesh's domain.
Required
model
Type:Material | LayeredModel | MeshingProtocol
Description:
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.
Required
mesh_resolution
Type:MeshResolution
Description:
The desired mesh resolution.
Optional
model_override
Type:Material | str | None
Default value:None
Description:
A single material instance that will override the size functions that the mesh has been built with. Alternatively the string "skip_model_interpolation" can be passed here which will return a mesh with no model parameters attached.
Optional
execution_policy
Type:bindings.ExecutionPolicy
Default value:<salvus._core.lib.salvus_core_python_bindings.ExecutionPolicy object at 0x7c032d80b5b0>
Description:
Execution policy governing the maximum allowable parallelism of child routines.
Optional
timer
Type:Timer | None
Default value:None
Description:
Execution timer.
Optional
verbosity
Type:int
Default value:1
Description:
The verbosity level. Set it to > 1 to get more detailed timing information.
RETURNS
Return type: UnstructuredMesh
A mesh ready for simulation.
PAGE CONTENTS