From 976e52014e220e241741cbc1c284c38c7f57adf9 Mon Sep 17 00:00:00 2001 From: Sebastian Bachmann Date: Tue, 4 Feb 2025 10:14:55 +0100 Subject: [PATCH] fixes #1505; reorder by dimension --- src/meshio/_mesh.py | 71 ++++++++++++++++++++++++--------------------- 1 file changed, 38 insertions(+), 33 deletions(-) diff --git a/src/meshio/_mesh.py b/src/meshio/_mesh.py index 741831d93..c7dc200b7 100644 --- a/src/meshio/_mesh.py +++ b/src/meshio/_mesh.py @@ -8,58 +8,68 @@ from ._common import num_nodes_per_cell, warn topological_dimension = { + # 0D + "vertex": 0, + # 1D "line": 1, + "line3": 1, + "line4": 1, + "line5": 1, + "line6": 1, + "line7": 1, + "line8": 1, + "line9": 1, + "line10": 1, + "line11": 1, + # 2D "polygon": 2, "triangle": 2, - "quad": 2, - "tetra": 3, - "hexahedron": 3, - "wedge": 3, - "pyramid": 3, - "line3": 1, "triangle6": 2, - "quad9": 2, - "tetra10": 3, - "hexahedron27": 3, - "wedge18": 3, - "pyramid14": 3, - "vertex": 0, - "quad8": 2, - "hexahedron20": 3, "triangle10": 2, "triangle15": 2, "triangle21": 2, - "line4": 1, - "line5": 1, - "line6": 1, - "tetra20": 3, - "tetra35": 3, - "tetra56": 3, - "quad16": 2, - "quad25": 2, - "quad36": 2, "triangle28": 2, "triangle36": 2, "triangle45": 2, "triangle55": 2, "triangle66": 2, + "quad": 2, + "quad8": 2, + "quad9": 2, + "quad16": 2, + "quad25": 2, + "quad36": 2, "quad49": 2, "quad64": 2, "quad81": 2, "quad100": 2, "quad121": 2, - "line7": 1, - "line8": 1, - "line9": 1, - "line10": 1, - "line11": 1, + # 3D + "tetra": 3, + "tetra10": 3, + "tetra20": 3, + "tetra35": 3, + "tetra56": 3, "tetra84": 3, "tetra120": 3, "tetra165": 3, "tetra220": 3, "tetra286": 3, + "pyramid": 3, + "pyramid14": 3, + "wedge": 3, + "wedge15": 3, + "wedge18": 3, "wedge40": 3, "wedge75": 3, + "wedge126": 3, + "wedge196": 3, + "wedge288": 3, + "wedge405": 3, + "wedge550": 3, + "hexahedron": 3, + "hexahedron20": 3, + "hexahedron27": 3, "hexahedron64": 3, "hexahedron125": 3, "hexahedron216": 3, @@ -67,11 +77,6 @@ "hexahedron512": 3, "hexahedron729": 3, "hexahedron1000": 3, - "wedge126": 3, - "wedge196": 3, - "wedge288": 3, - "wedge405": 3, - "wedge550": 3, "VTK_LAGRANGE_CURVE": 1, "VTK_LAGRANGE_TRIANGLE": 2, "VTK_LAGRANGE_QUADRILATERAL": 2,