Conversation
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.
Keep mesh geometry and field checkpoint datasets in the nondimensional solver frame, and create dimensional visualization copies using declared mesh and variable units. Record those units in HDF5 and XDMF metadata. Use nondimensional coordinates for DG1 interpolation before converting its disconnected visualization grid. This removes the need for benchmark-side coordinate wrappers, field-unit mappings, and HDF5 postprocessing. Cover continuous P2, DG0, and DG1 output in serial and MPI tests. Underworld development team with AI support from Claude Code
Declare signed and unsigned Surface distance variables with the mesh coordinate unit so physical XDMF export scales geometric distance fields without benchmark-side mappings. Extend the physical-output regression to cover Surface.abs_distance while preserving its nondimensional checkpoint values. Underworld development team with AI support from Claude Code
Make dimensional /fields datasets authoritative for analysis and direct XDMF rendering. Export continuous P2 triangles with Triangle_6 connectivity and DG1 simplices with exact disconnected-corner basis conversion, while reducing only unsupported continuous P3+ and DG2+ layouts to compact P1 and DG0 visualization arrays.\n\nStore optional native PETSc restart data under /uw_checkpoint, reuse its existing variable vector for same-layout reload, and retain migration-based reload for reconstructed meshes. Teach read_timestep to convert dimensional fields back to the active model frame and reject DG1 corner data that cannot be inverted by nearest-neighbour remapping.\n\nReplace compatibility-group tests with serial and MPI coverage for direct layouts, high-order reductions through P4/DG4, dimensional units, ParaView-facing topology, and checkpoint round trips. Update checkpoint documentation for the new storage contract.
Keep dimensional DG1 interpolation coordinates and values under /fields so read_timestep can recover solver data exactly. Store the disconnected-corner basis conversion separately under /visualization for XDMF, where it preserves element geometry and discontinuous traces.\n\nRemove the DG1 read_timestep rejection and add serial and two-rank MPI coverage for coordinate reload, PETSc checkpoint reload, dimensional conversion, and ParaView rendering. Update the checkpoint documentation to explain why DG1 requires separate reload and visualization representations.
Write continuous P2 tetrahedra as VTK-ordered Tetrahedron_10 grids so ParaView can render the native quadratic field without a P1 reduction. Keep field coordinates and values in their native order so coordinate-based reload remains independent of visualization connectivity. For create_xdmf=False with petsc_reload=True, write only the DMPlex checkpoint payload instead of first duplicating values under /fields. Store one owned global vector and reload it directly for the same layout or through PETSc's migration SF for reconstructed layouts and different MPI decompositions. Add serial and MPI coverage for quadratic tetrahedra, checkpoint-only file structure, same-layout reload, and migrated reload.
Write PETSc-native DMPlex restart data under /restart/petsc so the HDF5 hierarchy states both the payload purpose and storage backend. Keep read compatibility with grouped and direct-vector files that use the former /uw_checkpoint path, and cover the compatibility path in serial and MPI tests.
Inline the base-grid topology and geometry HDF5 DataItems in generated XDMF instead of relying on XML Reference nodes that ParaView 6's XDMF3 reader rejects. Keep the shared mesh DataItems for compatibility while making both the XDMF3 and legacy readers load exact P2 and DG1 output. Add a regression assertion that generated compact XDMF contains no XML-reference DataItems.
Store simplex DG1 corner geometry and connectivity once in the mesh HDF5 file, while retaining only each variable's exact dimensional corner values under /fields. Emit one XDMF DG1 grid with all compatible variables to remove per-variable visualization geometry duplication.\n\nTeach read_timestep to identify the compact corner-nodal representation and reconstruct native DG1 values cell by cell. Match complete cell geometry rather than coincident vertices so discontinuous traces remain distinct and reload remains exact across MPI repartitioning.\n\nUpdate DG1 and physical-unit tests to cover shared geometry, compact field files, the absence of optional restart data, XDMF references, and exact remapping.
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.
Problem
Unit-aware output currently duplicates mesh-variable values across native
/fieldsand ParaView compatibility groups. Higher-order continuous fields are always reduced to P1, including P2 simplex fields that XDMF and ParaView can represent directly. Benchmark scripts then need their own field-to-unit mappings or HDF5 postprocessing, which can produce inconsistent dimensional values.Resulting behavior
Mesh.write_timestep(create_xdmf=True)now treats dimensional/fieldsas the authoritative analysis and coordinate-reload data:/fields.Triangle_6andTetrahedron_10connectivity, with UW3 nodes mapped to VTK corner/edge order. No P1 value copy is written./fields. All DG1 variables share a single disconnected geometry under/viz/dg1in the mesh file and appear as attributes on one XDMFDG1grid. No per-variable visualization geometry or second value array is written.MeshVariable.read_timestep()recognizes the compact DG1 representation, matches complete source and destination cells by geometry, reconstructs each local affine polynomial, and evaluates it at the native DG1 nodes. This preserves separate traces at coincident vertices and works across MPI repartitioning./visualization./visualization./vertex_fields,/cell_fields, and/dg1groups are no longer generated for mesh variables.When nondimensional scaling is active,
/fields/coordinates,/fields/<name>, and shared visualization geometry are written in the mesh and variable units declared by the model.MeshVariable.read_timestep()recognizes this metadata and converts the data back to the active nondimensional solver frame. P2 cell connectivity only indexes the native coordinate/value arrays, so VTK node ordering does not affect KDTree reload.petsc_reload=Truewrites one native nondimensional PETSc global vector plus DMPlex section metadata under/restart/petsc.same_layout=Truereads the nested vector through a standalone PETSc vector, while the default reader usesglobalVectorLoadwith PETSc's migration SF for a reconstructed mesh or MPI layout. The reader also accepts the former/uw_checkpointgroup so existing restart files remain readable.With
create_xdmf=False, petsc_reload=True, each variable file contains only/restart/petsc;/fieldsis not written first. With both flags enabled, the file contains dimensional/fieldsfor analysis/remap and/restart/petscfor exact restart.The mesh file keeps PETSc's native
/geometryfor restart and, when dimensional scaling is active, a physical/viz/geometryarray for XDMF. XDMF 3 function-based geometry scaling was tested but is not accepted by ParaView 6, so this small coordinate-only copy remains. Simplex DG1 adds one shared disconnected/viz/dg1geometry because XDMF needs independent vertices to display element-local jumps correctly.Surface signed and unsigned distance fields inherit the mesh coordinate units, so geometric diagnostics are exported in physical length units automatically.
Storage summary
/fields/fieldsnodes/fields/fieldswithTriangle_6/Tetrahedron_10/fields/fieldscells/fields/viz/dg1geometry/fields/visualizationreduction/fields/visualizationreductionFor restart-only output, the variable file contains one native global vector under
/restart/petscand no/fieldsor/visualizationgroup.Dependency
This PR is stacked on #736 and retains its element-local DG1 foundation. The compact layout replaces #736's separate
/dg1group with dimensional/fields, shared mesh geometry, and optional/restart/petscdata.Validation
1.7763568394002505e-15.vtkQuadraticTriangle(cell type 22) and P2 tetrahedra asvtkQuadraticTetra(cell type 24).git diff --checkpass.Underworld development team with AI support from OpenAI Codex.