salvus.mesh.algorithms.distributed_mesh.construct_mesh
salvus.mesh.algorithms.distributed_mesh.construct_mesh salvus mesh algorithms distributed_mesh construct_mesh Distributed mesh construction algorithms.
Functions
distribute_material()
distribute_material()def distribute_material(
material: Optional[Material], comm: int
) -> tuple[bindings.DM, dict[str, npt.NDArray]]: ...Distribute a material across the ranks of a communicator.
Parameters
materialOptional[Material] — The material to distribute.commint — The MPI communicator to distribute across.
Returns tuple[bindings.DM, dict[str, npt.NDArray]]
get_embedding_coordinates()
get_embedding_coordinates()def get_embedding_coordinates(
dm: bindings.DMPlex, execution_policy: bindings.ExecutionPolicy
) -> npt.NDArray: ...Get the coordinates of the embedding from a DMPlex.
Parameters
dmbindings.DMPlex — The DMPlex to get the coordinates from.execution_policybindings.ExecutionPolicy — The execution policy governing parallelism.
Returns npt.NDArray
lift_embedding_coordinates()
lift_embedding_coordinates()def lift_embedding_coordinates(
coords_embed: npt.NDArray, to_order: int
) -> npt.NDArray: ...Lift the coordinates of the embedding to a higher order.
Parameters
coords_embednpt.NDArray — The coordinates of the embedding to lift.to_orderint — The order to lift the coordinates to.
Returns npt.NDArray
mesh_from_domain()
mesh_from_domain()def mesh_from_domain(
domain: domains.Domain | None,
model: Material | LayeredModel | MeshingProtocol | None,
mesh_resolution: MeshResolution | None,
exec: bindings.ExecutionPolicy = salvus._core.lib.salvus_core_python_bindings.ExecutionPolicy,
comm: int | None = None,
timer: Timer | None = None,
verbosity: int = 0,
) -> tuple[Mesh, bindings.DMPlex | None]: ...Create a distributed mesh from a domain, model, and mesh resolution.
Parameters
domaindomains.Domain | None — The domain to create the mesh for.modelMaterial | LayeredModel | MeshingProtocol | None — The material, layered model, or meshing protocol to use for creating the mesh.mesh_resolutionMeshResolution | None — The mesh resolution to use for creating the mesh.execbindings.ExecutionPolicy — The execution policy governing parallelism.commint | None — The MPI communicator to use for creating the mesh. If None, a serial mesh will be created.timerTimer | None — An optional timer to use for timing the mesh creation.verbosityint — The verbosity level for logging.
Returns tuple[Mesh, bindings.DMPlex | None]