BasicTools.Containers.MeshTools module
- BasicTools.Containers.MeshTools.GetElementsCenters(mesh=None, nodes: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes] | None = None, elements=None, dim: int | None = None) ndarray[source]
Internal function to compute the element centers. Waring!!!! This function is used in the filters implementation no Filter can appear in this implementation
- Parameters:
mesh (_type_, optional) – if mesh is not none the element center for all the element is calculated, by default None
nodes (_type_, optional) – if mesh is non, nodes and elements must be supplied to compute the element center only for the ElementContainer, by default None
elements (ElementContainer, optional) – if mesh is non, nodes and elements must be supplied to compute the element center only for the ElementContainer, by default None
dim (int, optional) – the dimensionality (int) to filter element to be treated, by default None
- Returns:
the center for each element
- Return type:
np.ndarray
- BasicTools.Containers.MeshTools.IsClose(mesh1, mesh2) bool[source]
Verified if two meshes are close (in the sense of numpy.isclose) meshes must have the same : - nodes - nodes tags - elements - element tags
- Parameters:
mesh1 (_type_) – first mesh to be compare
mesh2 (_type_) – second mesh to be compare
- Returns:
True if mesh1 and mesh2 are close enough
- Return type:
bool