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_layered_mesh()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]: ...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.
ddomain_module.Domain — The mesh’s domain.mpMeshingProtocol — The meshing protocol.mrMeshResolution — The desired mesh resolution.timerTimer | None — Execution timer.verbosityint — The verbosity level. Set to > 1 for more verbose output.
future_mesh_from_domain()
future_mesh_from_domain()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: ...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.
domainDomain — The mesh’s domain.modelMaterial | LayeredModel | 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_resolutionMeshResolution — The desired mesh resolution.model_overrideMaterial | str | None — 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.execution_policybindings.ExecutionPolicy — Execution policy governing the maximum allowable parallelism of child routines.timerTimer | None — Execution timer.verbosityint — The verbosity level. Set it to > 1 to get more detailed timing information.
interpolate_model()
interpolate_model()def interpolate_model(
mesh_resolution: MeshResolution,
mesh: UnstructuredMesh,
models: list[Material],
execution_policy: bindings.ExecutionPolicy = salvus._core.lib.salvus_core_python_bindings.ExecutionPolicy,
) -> UnstructuredMesh: ...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.
mesh_resolutionMeshResolution — An object containing mesh resolution and precision details.meshUnstructuredMesh — The mesh object to which the material parameters will be interpolated.modelslist[Material] — A list of material models, where each model corresponds to a block in the mesh.execution_policybindings.ExecutionPolicy — Execution policy governing the maximum allowable parallelism of child routines.
mesh_from_domain()
mesh_from_domain()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: ...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
domainDomain — The mesh’s domain.modelMaterial | LayeredModel | 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_resolutionMeshResolution — The desired mesh resolution.model_overrideMaterial | str | None — 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.execution_policybindings.ExecutionPolicy — Execution policy governing the maximum allowable parallelism of child routines.timerTimer | None — Execution timer.verbosityint — The verbosity level. Set it to > 1 to get more detailed timing information.