salvus.mesh.algorithms.distributed_mesh.mesh_from_domain_mpi
salvus.mesh.algorithms.distributed_mesh.mesh_from_domain_mpi salvus mesh algorithms distributed_mesh mesh_from_domain_mpi An MPI version of mesh_from_domain().
Functions
distributed_mesh_from_mesh()
distributed_mesh_from_mesh()def distributed_mesh_from_mesh(
comm: int,
mesh: Mesh | UnstructuredMesh | None,
timer: Timer | None = None,
verbosity: int = 1,
) -> DistributedMesh: ...Convert a local mesh on rank 0 to a distribute mesh on multiple ranks.
Parameters
commint — int,meshMesh | UnstructuredMesh | None — The meshtimerTimer | None — Execution timer.verbosityint — The verbosity level.
Returns DistributedMesh
mesh_from_domain_mpi()
mesh_from_domain_mpi()def mesh_from_domain_mpi(
comm: int,
domain: domain_module.Domain | None,
model: Material | LayeredModel | MeshingProtocol | None,
mesh_resolution: MeshResolution,
model_override: Material | str | None = None,
execution_policy: bindings.ExecutionPolicy = salvus._core.lib.salvus_core_python_bindings.ExecutionPolicy,
mesh_postprocessing_callback_function: (
typing.Callable[[Mesh], Mesh] | None
) = None,
timer: Timer | None = None,
verbosity: int = 1,
diagnostic_output_directory: pathlib.Path | None = None,
interior_deformation_order: int | None = None,
) -> DistributedMesh: ...Create a distributed mesh on multiple ranks, avoiding duplicate work.
An MPI version of mesh_from_domain(). Note that some arguments only need to be provided on the root rank. If so, computational cost on the system as a whole can be reduced by avoiding creating of large objects on the remaining ranks at the call site.
Parameters
commint — The MPI communicator to use.domaindomain_module.Domain | None — The mesh’s domain. Can be None on non-root ranks.modelMaterial | LayeredModel | MeshingProtocol | None — 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. The model only needs to be passed on rank 0. Pass None on the other ranks, although it will be ignored if passed, even if different per rank.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. Currently not supported in distributed meshing.execution_policybindings.ExecutionPolicy — Execution policy governing the maximum allowable parallelism of child routines.mesh_postprocessing_callback_functiontyping.Callable[[Mesh], Mesh] | None — Optional callback function that takes a singleMeshas input and returns a possibly modifiedMesh. This function will be applied on each chunk after it has been built, and finally also on the embedding mesh.timerTimer | None — Execution timer.verbosityint — The verbosity level.diagnostic_output_directorypathlib.Path | None — If set, meshes with invalid Jacobians will be written to this directory for debugging purposes.interior_deformation_orderint | None — Initial polynomial order used to interpolate boundary deformations into the element interior during interface reinterpolation. The backend currently only accepts1ormesh.shape_order. IfNone(default), the backend default is used (the mesh’s own shape order). If any rank still has invalid Jacobians after reinterpolation at this order, the order is automatically swept to the other allowed value on the failing ranks. Setting this explicitly only changes the starting point of the sweep; the same automatic recovery still applies.
Returns DistributedMesh