mymesh.converter.surf2dual#
- mymesh.converter.surf2dual(NodeCoords, SurfConn, Centroids=None, ElemConn=None, NodeNormals=None, sort='ccw')[source]#
Convert a surface mesh to it’s dual mesh. NOTE: this function has undergone limited testing and hasn’t been optimized. NOTE: The polygonal meshes that result from this function aren’t well supported by most of the other functions of this library.
- Parameters:
NodeCoords (array_like) – Node coordinates
SurfConn (array_like) – Surface mesh node connectivity
Centroids (array_like, optional) – Element centroids, by default None. If none are provided, they will be calculated for use within this function.
ElemConn (list, optional) – Node-Element connectivity, by default None. If none are provided, they will be calculated for use within this function. ElemConn can be obtained from utils.getElemConnectivity()
NodeNormals (array_like, optional) – Normal vectors for each node in the surface mesh, by default None. If none are provided, they will be calculated for use within this function. These are needed for proper ordering of the nodes in the dual mesh.
sort (str, optional) – Which direction to sort the dual mesh elements about their centroid. Options are clockwise (‘cw’) or counter-clockwise (‘ccw’), by default ‘ccw’.
- Returns:
DualCoords (list) – Node coordinates of the dual mesh
DualConn (list) – Node connectivity of the dual mesh