Mondaic

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()

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
  • material Optional[Material] — The material to distribute.
  • comm int — The MPI communicator to distribute across.
Returns tuple[bindings.DM, dict[str, npt.NDArray]]

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
  • dm bindings.DMPlex — The DMPlex to get the coordinates from.
  • execution_policy bindings.ExecutionPolicy — The execution policy governing parallelism.
Returns npt.NDArray

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_embed npt.NDArray — The coordinates of the embedding to lift.
  • to_order int — The order to lift the coordinates to.
Returns npt.NDArray

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
  • domain domains.Domain | None — The domain to create the mesh for.
  • model Material | LayeredModel | MeshingProtocol | None — The material, layered model, or meshing protocol to use for creating the mesh.
  • mesh_resolution MeshResolution | None — The mesh resolution to use for creating the mesh.
  • exec bindings.ExecutionPolicy — The execution policy governing parallelism.
  • comm int | None — The MPI communicator to use for creating the mesh. If None, a serial mesh will be created.
  • timer Timer | None — An optional timer to use for timing the mesh creation.
  • verbosity int — The verbosity level for logging.
Returns tuple[Mesh, bindings.DMPlex | None]