MeshFile.Write writes a 3 21 header for meshes with 6- or 8-node elements
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 58/100
Línea de trabajo
Start with mikecore/MeshFile.py:345-348 and the element-writing loop to see how the header is chosen; compare that with element creation in mikecore/MeshBuilder.py:150-153 and mikecore/MeshFile.py:390-393. Reproduce with a 6-node mesh and MeshFile.ReadMesh(path). Done means unsupported element widths are rejected rather than written with a mismatched header; the suggested read-side exception is also worth checking at mikecore/MeshFile.py:305-313.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
MeshFile.Write() picks the element header line from _hasQuads alone (mikecore/MeshFile.py:345-348):
if not self._hasQuads:
maxNodesPerElmt, elmtType = 3, 21
else:
maxNodesPerElmt, elmtType = 4, 25
Elements with 6 or 8 nodes (types 32/33) are never considered. MeshBuilder.CreateMesh() accepts them (mikecore/MeshBuilder.py:150-153), and MeshFile.Create() only sets _hasQuads for 4-node elements (mikecore/MeshFile.py:390-393). So a mesh of quadratic elements is written with the header <n> 3 21, while the row loop still writes every node, which makes the rows 6 or 8 values wide.
Reproduce
Build a mesh with 6-node triangles via MeshBuilder, call CreateMesh().Write(path), then MeshFile.ReadMesh(path).
- The written header claims max 3 nodes per element, code 21, and doesn't match the rows.
- On read,
Read()only recognises 3 and 4 nodes per element (mikecore/MeshFile.py:305-313), so those elements getElementType = 0.
mikeio can reach this too: it writes .mesh through MeshBuilder().CreateMesh().Write(), e.g. to_mesh on a quadratic mesh.
Background
The .mesh format documents only codes 21 (all triangles) and 25 (quads present) for the element header. There's no documented quadratic form (32/33 are dfsu element types).
Suggested fix
- In
Write(), derivemaxNodesPerElmtfrom the widest element instead of_hasQuads, and raise on any element with other than 3 or 4 nodes, since.meshcan't represent it. - Probably make
Read()raise on such elements too, instead of the silentElementType = 0(there's a# TODO: Throw an exception?there).
Found while reviewing #53.
🤖 Generated with Claude Code
- Lenguaje dominante
- Python
- Estrellas
- 5
- Forks
- 1
- Merge medio
- 1 h 19 min
- PR fusionados (30 d)
- 6
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de DHI/mikecore-python
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
DHI/mikecore-python#70 ·
Los mantenedores suelen responder en 1 día
-
Four test assertions carried over from the C# suite are still commented outPosiblemente ocupada @ryan-kipawa la tomó hace 9 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
DHI/mikecore-python#49 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
DHI/mikecore-python#59 ·
Los mantenedores suelen responder en 1 día
-
New submesh feature (2027) makes all dfsu fail!Posiblemente ocupada @ryan-kipawa la tomó hace 9 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 42/100
DHI/mikecore-python#54 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 45/100
DHI/mikecore-python#52 ·
Los mantenedores suelen responder en 1 día
Todos los issues de DHI/mikecore-python
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
UKGovernmentBEIS/inspect_ai#5781 ·
Los mantenedores suelen responder en 2 días
-
Bump .cicd to wamp-cicd 4c2f9ac: `just land` refuses open A18 decisions, `just where` lists themAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
crossbario/cfxdb#139 ·
-
Bump .cicd to wamp-cicd 4c2f9ac: `just land` refuses open A18 decisions, `just where` lists themAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 84/100
crossbario/txaio#241 ·
-
UX
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
mediajunkie/piper-morgan-product#1963 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100