Skip to content

Fix DG1 XDMF export with element-local simplex topology - #736

Open
gthyagi wants to merge 1 commit into
underworldcode:developmentfrom
gthyagi:bugfix/dg1-xdmf-export
Open

gthyagi wants to merge 1 commit into
underworldcode:developmentfrom
gthyagi:bugfix/dg1-xdmf-export

Conversation

@gthyagi

@gthyagi gthyagi commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Problem

DG1 fields were treated as one-value-per-cell XDMF attributes even though triangles have three and tetrahedra four local coefficients. This creates invalid visualization metadata and cannot preserve the discontinuous linear field correctly.

Changes

  • Add a disconnected DG1 grid alongside the standard mesh grid in one XDMF file.
  • Evaluate each cell polynomial at its own physical vertices using native cell maps; no coordinate matching or averaging across cells.
  • Write only owned cells through PETSc collective output, including ranks with no owned cells.
  • Support scalar, vector, full tensor and symmetric tensor fields on full-dimensional triangles and tetrahedra.
  • Preserve native HDF5 checkpoint/reload data. Unsupported DG visualization fails explicitly; native-only output remains available.
  • Document the layout and ParaView usage.

Verification

  • Rebuilt UW3 in amr-dev.
  • 24 focused serial tests passed (DG1, existing XDMF compatibility and save/load).
  • All four DG1 regression tests passed on eight MPI ranks.
  • ParaView 6.0 read both 2D and 3D outputs and rendered the 2D field; maximum scalar errors were 1.78e-15 and 3.55e-15 respectively.
  • Regression tests cover preserved jumps, physical vertex values, positive cell orientation, ownership, tensor packing, native checkpoint reload and unsupported layouts.
  • Deprecated-pattern check and git diff --check passed.

This changes visualization output only; it does not change the Stokes solver or smooth stress/strain-rate fields.

Write independent physical vertices and cell-local linear field traces for DG1 triangles and tetrahedra. Use native cell maps and owned-cell PETSc output to preserve discontinuities without coordinate matching or inter-element averaging.

Expose continuous and DG1 fields as separate grids in one XDMF file, support scalar/vector/tensor layouts, and retain native checkpoint data unchanged. Reject unsupported DG visualization explicitly while preserving native-only output.

Add serial and MPI regression coverage for affine fields, jumps, orientation, ownership, tensor packing, and checkpoint reload. Document supported layouts and ParaView usage. Validated 24 focused serial tests, four DG tests on eight ranks, and actual ParaView 2D/3D reads.
@gthyagi
gthyagi requested a review from lmoresi as a code owner September 12, 2026 09:34
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.

1 participant