vectors.py¶
Define standard vector and matrix functions.
-
petgem.vectors.
deleteDuplicateRows
(matrix)[source]¶ Delete duplicate rows in a matrix.
- Parameters
matrix (ndarray) – input matrix to be processed.
- Returns
matrix without duplicate rows
- Return type
ndarray
-
petgem.vectors.
findUniqueRows
(array, return_index=False, return_inverse=False)[source]¶ Find unique rows of a two-dimensional numpy array.
- Parameters
ndarray – array to be processed.
return_index (bool) – the indices of array that result in the unique array.
return_inverse (bool) – indices of the unique array that can be used to reconstruct array.
- Returns
unique rows.
- Return type
ndarray.
-
petgem.vectors.
invConnectivity
(M, nP)[source]¶ Compute the opposite connectivity matrix of M.
- Parameters
M (ndarray) – connectivity matrix with dimensions = (nElems,eleOrder)
nP (int) – number of nodes/edges/faces in matrix M.
- Returns
connectivity matrix with dimensions = (nNodes,S), (nEdges,S) or (nFaces,S)
- Return type
ndarray.
Note
eleOrder determines the number of entities per element in matrix M, therefore 4 is the nodal element order, 6 is the edge element order and 3 is the element order of faces. S in the output is the maximum number of elements sharing a given node/edge/face
If M represents a element/nodes connectivity, the function computes a node/elements connectivity.
If M represents a element/edges connectivity, the function computes a edge/elements connectivity.
If M represents a element/faces connectivity, the function computes a faces/elements connectivity.