mymesh.converter.pyramid2tet#
- mymesh.converter.pyramid2tet(NodeCoords, NodeConn, method='1to2c')[source]#
Decompose all elements of a 3D pyramidal mesh to tetrahedra. Generally solid2tets should be used rather than pyramid2tet directly NOTE the generated tetrahedra from 1 to 2 will not necessarily 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. 1 to 4 splitting is guaranteed to be consistent with other pyramids, hexs split with 1to24, and wedges split with 1to20.
- Parameters:
NodeCoords (list) – List of nodal coordinates.
NodeConn (list) – Nodal connectivity list. All elements should be 5-Node pyramidal elements.
method (str, optional) – Method of decomposition to use for tetrahedralization. ‘1to2’ - Not continuously oriented, no nodes added, all elements decomposed the same way ‘1to2c’ - Continuously oriented, no nodes added (default) ‘1to4’ - Continuously oriented, nodes added at center of the quad faces
- Returns:
NewCoords (array_like) – New list of nodal coordinates. For ‘1to2’ this will be unchanged from the input.
TetConn, np.ndarray – Nodal connectivity list of generated tetrahedra
Examples
>>> # A single pyramid element >>> PyramidCoords = np.array([[0., 0., 0.], [1., 0., 0.], [1., 1., 0.], [0., 1., 0.], [0.5, 0.5, 1.]]) >>> PyramidConn = [[0,1,2,3,4]] >>> TetCoords1to2, TetConn1to2 = converter.pyramid2tet(PyramidCoords, PyramidConn, method='1to2') >>> TetCoords1to4, TetConn1to4 = converter.pyramid2tet(PyramidCoords, PyramidConn, method='1to4')