MeshFile.Write writes a 3 21 header for meshes with 6- or 8-node elements
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 58/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Python
- Star
- 5
- Fork
- 1
- Merge trung bình
- 1 giờ 19 phút
- Pull request đã merge (30 ngày)
- 6
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của DHI/mikecore-python
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
DHI/mikecore-python#70 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Four test assertions carried over from the C# suite are still commented outCó thể đã có người làm @ryan-kipawa đã nhận 9 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
DHI/mikecore-python#49 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
DHI/mikecore-python#59 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
New submesh feature (2027) makes all dfsu fail!Có thể đã có người làm @ryan-kipawa đã nhận 9 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
DHI/mikecore-python#54 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 45/100
DHI/mikecore-python#52 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của DHI/mikecore-python
Issue tương tự
-
bug ready for review
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
odysseus-dev/odysseus#6641 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
happypawspillaro/happypaws#78 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
pydanty:is-working
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
pydantic/pydantic-ai#10020 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
ansible-collections/ibm_zos_core#2650 ·
-
hw: pvc tests: vllm vllm
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
intel/intel-xpu-backend-for-triton#8362 ·
Maintainer thường phản hồi trong vòng 1 ngày