Skip to content

Extend VTKHDF file format to read/write higher order grids #3686

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Apr 11, 2025

Conversation

jorgensd
Copy link
Member

@jorgensd jorgensd commented Apr 4, 2025

  • VTKHDF now supports reading and writing higher order grids (arbitrary order).
    • CoordinateElement for degree > 2 will be equispaced.
    • The support includes mixed topology.
      • Test using a mesh with second order quadrilateral and second order triangular cells have been added.
  • Added special handling of 1D and 2D geometries (gdim argument in read constructor).
    • This is because VTKHDF doesn't have a notion of 2D geometries, in the same way XDMF supported XY points and XYZ points.

Partially addresses #3582

@jorgensd jorgensd marked this pull request as ready for review April 7, 2025 08:17
Copy link
Member

@garth-wells garth-wells left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs some tests.

Would be good to make the title clearer - does it support write, read, or both?

@jorgensd
Copy link
Member Author

jorgensd commented Apr 8, 2025

Needs some tests.

Would be good to make the title clearer - does it support write, read, or both?

Do you have any good examples at hand for mixed meshes?
I can hand-code a 2D higher order mixed mesh (1 second order triangle + 1 second order quadrilateral).

The code supports read and write.

@chrisrichardson
Copy link
Contributor

There is a mixed mesh fixture (see last test in io/test_vtkdhf.py) although this is only first-order.

@garth-wells
Copy link
Member

Single cell type tests would be enough for now.

jorgensd and others added 2 commits April 8, 2025 14:49
- Coordinate element variants for higher order grids
- Geometric dimension < 3
@jorgensd
Copy link
Member Author

jorgensd commented Apr 8, 2025

Tests for 1st, 2nd and 3rd order single cell meshes (tetrahedra) have been added, as well as a hand-coded 2-element mesh (2nd order triangle, 2nd quadrilateral).
They exposed a few flaws in the original design, including:

  • VTKHDF doesn't have a notion of 2D grids (we therefore need to supply gdim (as we do when reading gmsh meshes) if we want a 1D or 2D grid
  • For higher order grids (degree >2) a Lagrange type is needed. It has now been hardcoded to equispaced both in Python and C++, for consistency and is similar to what we do for GMSH grids.

@jorgensd jorgensd changed the title Support higher order mixed meshes through VTKHDF Extend VTKHDF file format to read higher order grids Apr 8, 2025
@jorgensd jorgensd requested a review from garth-wells April 8, 2025 14:58
@jorgensd jorgensd linked an issue Apr 8, 2025 that may be closed by this pull request
4 tasks
@jorgensd jorgensd removed a link to an issue Apr 8, 2025
4 tasks
@jorgensd jorgensd added enhancement New feature or request io labels Apr 8, 2025
@jorgensd jorgensd changed the title Extend VTKHDF file format to read higher order grids Extend VTKHDF file format to read/write higher order grids Apr 8, 2025
@jorgensd jorgensd enabled auto-merge April 11, 2025 12:42
@jorgensd jorgensd dismissed garth-wells’s stale review April 11, 2025 12:43

Tests for higher order mixed dimensional mesh, and higher order single cell mesh added.

@jorgensd jorgensd added this pull request to the merge queue Apr 11, 2025
Merged via the queue into main with commit fd015ba Apr 11, 2025
28 checks passed
@jorgensd jorgensd deleted the dokken/vtkhdfhigherorder branch April 11, 2025 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request io
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants