Muscat.Experimental.Containers.PartitionedMeshTools module

CheckIntegrity(GUI: bool = False)[source]
ElementFilterOnPartitionedMesh(elementFilter: ElementFilter) Callable[[PartitionedMesh], Generator[ElementsSelection, Any, None]][source]

convert an element filter to work on partitioned meshes

for selection in ElementFilterOnPartitionedMesh(ElementFilter(dimensionality=3))(myParMesh):

print(”————————————————–“) print(selection.part)

Parameters:

elementFilter (ElementFilter) –

Returns:

a object to iterate in the same way as a filter

Return type:

IterOverPartitionedMesh

PartitionMeshFromMask(mesh: Mesh, mask: ndarray, nbParts: int = 0) PartitionedMesh[source]

Function to construct a PartitionedMesh from a mesh and a element partition (coloring)

Parameters:
  • mesh (Mesh) – the mesh to apply the partition

  • mask (np.ndarray) – a numpy array of ints of size Number of elements with values starting from zero

  • nbParts (int, optional) – the number of part in the partition (this must be equal to len(np.unique(mask)) ), by default the value is internally computed by a np.unique

Returns:

partitioned mesh (the )

Return type:

PartitionedMesh