Skip to content

Fix Exodus HEX20 node ordering on read and write - #1573

Open
loaff123 wants to merge 1 commit into
nschloe:mainfrom
loaff123:fix/meshio-1538
Open

loaff123 wants to merge 1 commit into
nschloe:mainfrom
loaff123:fix/meshio-1538

Conversation

@loaff123

@loaff123 loaff123 commented Oct 2, 2026 •

Copy link
Copy Markdown

Fixes #1538.

Exodus HEX20 places vertical midside nodes before top-face midside nodes. meshio uses VTK ordering, where those groups are reversed. Reading and writing previously changed only the index base, leaving eight positions incorrect.

Apply the self-inverse HEX20 permutation in both directions, without mutating input connectivity. Tests construct reader input directly with netCDF4 and inspect raw writer output directly with netCDF4, so inverse mistakes cannot cancel out. Cases cover multiple rows, mixed/repeated blocks, case-insensitive element names, int32/int64 connectivity, NumPy-dependent read dtype behavior, and read-only input arrays.

Validation rerun on Windows 11 / Python 3.11.9 / NumPy 2.4.6 / netCDF4 1.7.4:

  • python -m pytest -q tests/test_exodus.py: 29 passed.
  • Changed files pass Black 24.1.1, isort 5.13.2, and flake8 7.0.0.
  • A representative added HEX20 read regression fails against the unchanged upstream base.
  • git diff --check: passed.

Historical package evidence, not rerun in this session: Linux/Python 3.12 full suite with NumPy 1.26.4 reported 752 passed/10 skipped; the NumPy 2.5.3 full suite reported 727 passed/10 skipped plus 25 pre-existing DOLFIN/Gmsh/UGRID failures also reported on the base. The fresh Windows checks cover Exodus only; they do not establish a clean full suite.

HEX27 ordering and additional Exodus aliases remain outside scope. Existing PR #1550 changes the same Exodus reader/writer for time-series/field/cell data but its current diff does not implement this HEX20 ordering correction; later integration may require conflict resolution.

AI assistance was used to prepare and verify this patch. Submitted for maintainer review and upstream CI.

@loaff123
loaff123 marked this pull request as ready for review October 2, 2026 09:02

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Exodus read and write of hexahedron20 elements incorrect

1 participant