Skip to content

Fix for xdmf output#63

Merged
lmoresi merged 1 commit intodevelopmentfrom
BK-xdmfFixes
Mar 2, 2026
Merged

Fix for xdmf output#63
lmoresi merged 1 commit intodevelopmentfrom
BK-xdmfFixes

Conversation

@bknight1
Copy link
Member

@bknight1 bknight1 commented Mar 2, 2026

Further fixes for #54

  • Add EnhancedMeshVariable._sync_lvec_to_gvec
  • update generateXdmf and generate_uw_Xdmf to use the new collector for consistent field discovery.

Further fixes for #54
- Add EnhancedMeshVariable._sync_lvec_to_gvec
- update generateXdmf and generate_uw_Xdmf to use the new collector for consistent field discovery.
@bknight1 bknight1 requested a review from lmoresi as a code owner March 2, 2026 00:29
Copilot AI review requested due to automatic review settings March 2, 2026 00:29
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes missing/incorrect field discovery when generating XDMF from PETSc HDF5 checkpoint output (issue #54), and ensures enhanced mesh variables can synchronize PETSc vectors correctly before writing.

Changes:

  • Add EnhancedMeshVariable._sync_lvec_to_gvec() delegating to the underlying base variable.
  • Update XDMF generation to discover mesh fields via a shared collector that supports both legacy (/vertex_fields, /cell_fields) and newer (/fields/<name>) HDF5 layouts.
  • Adjust field dataset paths passed into XDMF writing so the heavy-data references match the discovered layout.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/underworld3/utilities/uw_petsc_gen_xdmf.py Adds _collect_mesh_fields() and updates both XDMF generators to support /fields-style PETSc output while retaining legacy support.
src/underworld3/discretisation/enhanced_variables.py Adds _sync_lvec_to_gvec() to the enhanced wrapper so PETSc checkpoint writers can sync local→global vectors consistently.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@lmoresi lmoresi left a comment

Choose a reason for hiding this comment

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

Thanks, Ben

@lmoresi lmoresi merged commit 39b7252 into development Mar 2, 2026
5 checks passed
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.

3 participants