move definition of constant Dict[str, Tuple[str, int]] up out of while-loop
@@ -60,6 +60,14 @@ def read_buffer(file):
dim = 0
cells = {}
+ meshio_from_medit = {
+ "Edges": ("line", 2),
+ "Triangles": ("triangle", 3),
+ "Quadrilaterals": ("quad", 4),
+ "Tetrahedra": ("tetra", 4),
+ "Hexahedra": ("hexahedra", 8),
+ }
+
reader = _ItemReader(file)
while True:
@@ -70,14 +78,6 @@ def read_buffer(file):
assert keyword.isalpha()
- meshio_from_medit = {
- "Edges": ("line", 2),
- "Triangles": ("triangle", 3),
- "Quadrilaterals": ("quad", 4),
- "Tetrahedra": ("tetra", 4),
- "Hexahedra": ("hexahedra", 8),
- }
-
if keyword == "MeshVersionFormatted":
version = reader.next_item()
dtype = {"1": c_float, "2": c_double}[version]
