diff --git a/geosx_mesh_doctor/tests/test_supported_elements.py b/geosx_mesh_doctor/tests/test_supported_elements.py index 615594a..81a4d69 100644 --- a/geosx_mesh_doctor/tests/test_supported_elements.py +++ b/geosx_mesh_doctor/tests/test_supported_elements.py @@ -38,89 +38,44 @@ def make_dodecahedron() -> Tuple[vtkPoints, vtkIdList]: This code was adapted from an official vtk example. :return: The tuple of points and faces (as vtk instances). """ - points = ((1.21412, 0, 1.58931), (0.375185, 1.1547, 1.58931), (-0.982247, 0.713644, 1.58931), - (-0.982247, -0.713644, 1.58931), (0.375185, -1.1547, 1.58931), (1.96449, 0, 0.375185), - (0.607062, 1.86835, 0.375185), (-1.58931, 1.1547, 0.375185), (-1.58931, -1.1547, 0.375185), - (0.607062, -1.86835, 0.375185), (1.58931, 1.1547, -0.375185), (-0.607062, 1.86835, -0.375185), - (-1.96449, 0, -0.375185), (-0.607062, -1.86835, -0.375185), (1.58931, -1.1547, - -0.375185), (0.982247, 0.713644, -1.58931), - (-0.375185, 1.1547, -1.58931), (-1.21412, 0, -1.58931), (-0.375185, -1.1547, - -1.58931), (0.982247, -0.713644, -1.58931)) - - faces = ( - 12, # number of faces - 5, - 0, - 1, - 2, - 3, - 4, # number of ids on face, ids - 5, - 0, - 5, - 10, - 6, - 1, - 5, - 1, - 6, - 11, - 7, - 2, - 5, - 2, - 7, - 12, - 8, - 3, - 5, - 3, - 8, - 13, - 9, - 4, - 5, - 4, - 9, - 14, - 5, - 0, - 5, - 15, - 10, - 5, - 14, - 19, - 5, - 16, - 11, - 6, - 10, - 15, - 5, - 17, - 12, - 7, - 11, - 16, - 5, - 18, - 13, - 8, - 12, - 17, - 5, - 19, - 14, - 9, - 13, - 18, - 5, - 19, - 18, - 17, - 16, - 15) + # yapf: disable + points = ( + (1.21412, 0, 1.58931), + (0.375185, 1.1547, 1.58931), + (-0.982247, 0.713644, 1.58931), + (-0.982247, -0.713644, 1.58931), + (0.375185, -1.1547, 1.58931), + (1.96449, 0, 0.375185), + (0.607062, 1.86835, 0.375185), + (-1.58931, 1.1547, 0.375185), + (-1.58931, -1.1547, 0.375185), + (0.607062, -1.86835, 0.375185), + (1.58931, 1.1547, -0.375185), + (-0.607062, 1.86835, -0.375185), + (-1.96449, 0, -0.375185), + (-0.607062, -1.86835, -0.375185), + (1.58931, -1.1547, -0.375185), + (0.982247, 0.713644, -1.58931), + (-0.375185, 1.1547, -1.58931), + (-1.21412, 0, -1.58931), + (-0.375185, -1.1547, -1.58931), + (0.982247, -0.713644, -1.58931) + ) + + faces = (12, # number of faces + 5, 0, 1, 2, 3, 4, # number of ids on face, ids + 5, 0, 5, 10, 6, 1, + 5, 1, 6, 11, 7, 2, + 5, 2, 7, 12, 8, 3, + 5, 3, 8, 13, 9, 4, + 5, 4, 9, 14, 5, 0, + 5, 15, 10, 5, 14, 19, + 5, 16, 11, 6, 10, 15, + 5, 17, 12, 7, 11, 16, + 5, 18, 13, 8, 12, 17, + 5, 19, 14, 9, 13, 18, + 5, 19, 18, 17, 16, 15) + # yapf: enable p = vtkPoints() p.Allocate(len(points)) @@ -150,9 +105,22 @@ def test_dodecahedron() -> None: def test_parse_face_stream() -> None: _, faces = make_dodecahedron() result = parse_face_stream(faces) - expected = ((0, 1, 2, 3, 4), (0, 5, 10, 6, 1), (1, 6, 11, 7, 2), (2, 7, 12, 8, 3), (3, 8, 13, 9, 4), - (4, 9, 14, 5, 0), (15, 10, 5, 14, 19), (16, 11, 6, 10, 15), (17, 12, 7, 11, 16), (18, 13, 8, 12, 17), - (19, 14, 9, 13, 18), (19, 18, 17, 16, 15)) + # yapf: disable + expected = ( + (0, 1, 2, 3, 4), + (0, 5, 10, 6, 1), + (1, 6, 11, 7, 2), + (2, 7, 12, 8, 3), + (3, 8, 13, 9, 4), + (4, 9, 14, 5, 0), + (15, 10, 5, 14, 19), + (16, 11, 6, 10, 15), + (17, 12, 7, 11, 16), + (18, 13, 8, 12, 17), + (19, 14, 9, 13, 18), + (19, 18, 17, 16, 15) + ) + # yapf: enable assert result == expected face_stream = FaceStream.build_from_vtk_id_list(faces) assert face_stream.num_faces == 12