mymesh.converter.hex2tet#
- mymesh.converter.hex2tet(NodeCoords, NodeConn, method='1to6')[source]#
Decompose all elements of a 3D hexahedral mesh to tetrahedra. Generally solid2tets should be used rather than hex2tet directly
NOTE the generated tetrahedra of the ‘1to5’ method will not be continuously oriented, i.e. edges of child tetrahedra may not be aligned between one parent element and its neighbor, and thus the resulting mesh will typically be invalid. The primary use-case for this method is for methods like quality.Volume which utilize the geometric properties of tetrahedra to determine properties of the parent elements. ‘1to6’ or ‘1to24’ will generate continuously oriented tetrahedra.
- Parameters:
NodeCoords (list) – List of nodal coordinates.
NodeConn (list) – Nodal connectivity list. All elements should be 8-Node hexahedral elements.
method (str, optional) – Method of decomposition to use for tetrahedralization. ‘1to5’ - Not continuously oriented, no nodes added ‘1to6’ - Continuously oriented, no nodes added ‘1to24’ - Continuously oriented, nodes added at center of element and element faces
- Returns:
NewCoords (list) – New list of nodal coordinates. For ‘1to5’ or ‘1to6’, this will be unchanged from the input.
TetConn, np.ndarray – Nodal connectivity list of generated tetrahedra
Examples
>>> # A single hexahedral element >>> HexCoords, HexConn = primitives.Grid([0,1,0,1,0,1],1) >>> TetCoords1to5, TetConn1to5 = converter.hex2tet(HexCoords, HexConn, method='1to5') >>> TetCoords1to6, TetConn1to6 = converter.hex2tet(HexCoords, HexConn, method='1to6') >>> TetCoords1to24, TetConn1to24 = converter.hex2tet(HexCoords, HexConn, method='1to24')