From 49cf0b7fb58fdce72cd4ebbb40adacd19bbd4278 Mon Sep 17 00:00:00 2001 From: Jonas Breuling Date: Mon, 4 Dec 2023 11:06:11 +0100 Subject: [PATCH 1/3] =?UTF-8?q?Add=20support=20for=20rational=20B=C3=A9zie?= =?UTF-8?q?r=20cells.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- uvw/unstructured.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/uvw/unstructured.py b/uvw/unstructured.py index d5e47dc..f078749 100644 --- a/uvw/unstructured.py +++ b/uvw/unstructured.py @@ -50,6 +50,20 @@ class CellType(Enum): BIQUADRATIC_TRIANGLE = 34 CUBIC_LINE = 35 QUADRATIC_POLYGON = 36 + LAGRANGE_CURVE = 68 + LAGRANGE_TRIANGLE = 69 + LAGRANGE_QUADRILATERAL = 70 + LAGRANGE_TETRAHEDRON = 71 + LAGRANGE_HEXAHEDRON = 72 + LAGRANGE_WEDGE = 73 + LAGRANGE_PYRAMID = 74 + BEZIER_CURVE = 75 + BEZIER_TRIANGLE = 76 + BEZIER_QUADRILATERAL = 77 + BEZIER_TETRAHEDRON = 78 + BEZIER_HEXAHEDRON = 79 + BEZIER_WEDGE = 80 + BEZIER_PYRAMID = 81 NODES_PER_CELL = { @@ -85,6 +99,20 @@ class CellType(Enum): CellType.BIQUADRATIC_TRIANGLE: 7, CellType.CUBIC_LINE: 4, CellType.QUADRATIC_POLYGON: -1, + CellType.LAGRANGE_CURVE: -1, + CellType.LAGRANGE_TRIANGLE: -1, + CellType.LAGRANGE_QUADRILATERAL: -1, + CellType.LAGRANGE_TETRAHEDRON: -1, + CellType.LAGRANGE_HEXAHEDRON: -1, + CellType.LAGRANGE_WEDGE: -1, + CellType.LAGRANGE_PYRAMID: -1, + CellType.BEZIER_CURVE: -1, + CellType.BEZIER_TRIANGLE: -1, + CellType.BEZIER_QUADRILATERAL: -1, + CellType.BEZIER_TETRAHEDRON: -1, + CellType.BEZIER_HEXAHEDRON: -1, + CellType.BEZIER_WEDGE: -1, + CellType.BEZIER_PYRAMID: -1, } From b149300b4de3672de7276f83fe5de3a4415bab4b Mon Sep 17 00:00:00 2001 From: Jonas Breuling Date: Mon, 4 Dec 2023 11:09:43 +0100 Subject: [PATCH 2/3] Write pretty xml's. --- uvw/writer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uvw/writer.py b/uvw/writer.py index b1d6982..f7b47f7 100644 --- a/uvw/writer.py +++ b/uvw/writer.py @@ -243,7 +243,7 @@ def write(self, fd: FileDescriptor): elif isinstance(fd, io.TextIOBase): self.document.writexml(fd, indent="\n ", addindent=" ") elif isinstance(fd, io.BufferedIOBase): - fd.write(self.document.toxml(encoding='UTF-8')) + fd.write(self.document.toprettyxml(encoding='UTF-8')) else: raise TypeError(f"Expected a path or file descriptor, got {fd}") From dcf050c9f1ab8aa0a6b72be15b9492ad4c60d3d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Fr=C3=A9rot?= Date: Fri, 23 Feb 2024 17:01:40 +0100 Subject: [PATCH 3/3] not writing pretty xml --- uvw/writer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uvw/writer.py b/uvw/writer.py index f7b47f7..b1d6982 100644 --- a/uvw/writer.py +++ b/uvw/writer.py @@ -243,7 +243,7 @@ def write(self, fd: FileDescriptor): elif isinstance(fd, io.TextIOBase): self.document.writexml(fd, indent="\n ", addindent=" ") elif isinstance(fd, io.BufferedIOBase): - fd.write(self.document.toprettyxml(encoding='UTF-8')) + fd.write(self.document.toxml(encoding='UTF-8')) else: raise TypeError(f"Expected a path or file descriptor, got {fd}")