Muscat.MeshContainers.PartitionedMesh module

CheckIntegrity(GUI: bool = False) str[source]

Checks core integrity of PartitionedMesh operations.

Runs several assertions: - Adds mesh with proper ‘GlobalIDs’ fields - Adds mesh with explicit global IDs arrays - Checks responses for missing fields (should raise exception) - Checks that node and element counts are preserved

Parameters:

GUI (bool) – Not used; for compatibility.

Returns:

“OK” if all tests pass, otherwise returns an error message

Return type:

str

class PartitionedMesh[source]

Bases: object

Class to store a partitioned mesh.

Two fields are used to store the global numbering of elements and nodes. These fields are stored in every mesh’s nodeFields[‘GlobalIDs’] and elemFields[‘GlobalIDs’].

AddMesh(mesh: Mesh, nodesGlobalIDs: ndarray | None = None, elementsGlobalIDs: ndarray | None = None) None[source]

Add a mesh to the PartitionedMesh collection.

Parameters:
  • mesh (Mesh) – The mesh to be added.

  • nodesGlobalIDs (Optional[np.ndarray]) – An array of node global IDs. If None, must already exist in mesh.nodeFields.

  • elementsGlobalIDs (Optional[np.ndarray]) – An array of element global IDs. If None, must already exist in mesh.elemFields.

Raises:

RuntimeError – If required global IDs are not provided and not found in the mesh.:

ComputeNumberOfGlobalNodes() int[source]

Return the maximum global node id found in all meshes.

GenerateGlobalIdsBasedOnNodePositions()[source]

Assigns unique global IDs to elements and nodes based on node positions.

GetMonolithicMesh() Mesh[source]

Return a mesh composed of all partitioned meshes merged together.

GetNumberOfElements() int[source]

Return the total number of elements in the partitioned mesh.

GetNumberOfNodes() int[source]

Return the total number of nodes in the partitioned mesh.

PrepareForOutput(verifyIntegrity: bool | None = True) None[source]

Prepare all meshes for output, optionally verifying their integrity.