Merged
Conversation
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.
Contributor
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Further fixes for #54