Repository navigation
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.
Save scalar model-to-physical factors with field and coordinate datasets. Use destination reference quantities when present, otherwise restore the writer solver frame, including shared DG1 corners. Add analytic DG0, P1 and DG1 cross-session regressions. Underworld development team with AI support from Claude Code
Issues in this branch's territoryTerritory is the checkpoint/XDMF output path:
The two items I would want the author's word on before this lands: whether the new output path goes through Underworld development team with AI support from Claude Code |
|
Two follow-ups to the adjudication above, both answered by grep rather than left for the author, and one new blocker. It does not go through It does not record And it now conflicts. Underworld development team with AI support from Claude Code |
Merge upstream/development at 4a4f18d and resolve the overlapping DG1 export changes while preserving this PR's compact dimensional /fields, shared mesh geometry, optional /restart/petsc, and DG1 affine reload. Retain upstream's vector and symmetric-tensor regression coverage. Move the existing _short_io_path context manager into utilities/_io.py and reuse it from snapshots, mesh and variable output, dimensional field and geometry output, and PETSc-native mesh/vector/checkpoint readers. Native PETSc receives only the basename while artifacts stay at the requested location; the original working directory is restored on exit. Add long-path regression coverage for absolute and relative paths, visualization-only, restart-only, and combined output, continuous P2/P3, DG0/DG1, physical geometry, coordinate remap, and both PETSc reload modes. The test instruments native viewer creation so it detects unguarded filenames even on platforms that accept them. Its basename assertion fails when the pre-fix unguarded filename behavior is restored. Correct the DG1 storage documentation and explicitly document that the output index is not physical time. Field and coordinate conversion metadata does not resolve the FreeSurface time-scale issue underworldcode#562. Validation: - Output/save-load suites: 35 tests pass in serial and per rank with 2 MPI ranks. - Long-path, DG1, physical-unit and topology checks: 17 pass per rank with 4 MPI ranks. - Dedicated 2-rank visualization topology check passes. - Broader snapshot suite: 26 pass; the auxiliary-field solve test fails before I/O because generated JIT setup has an empty include_dirs list. Reproduced with unmodified upstream Python source at 4a4f18d using the matching compiled extensions; unrelated JIT code is unchanged here. - Installed source verified; new helper/tests pass Black and diff checks. Underworld development team with AI support from OpenAI Codex
|
Addressed in 16d660c:
Validation: 35 output/save-load tests pass in serial and per rank on two MPI ranks; 17 long-path/DG1/physical-unit/topology checks pass per rank on four MPI ranks. The dedicated two-rank topology test also passes. On #562: this PR records field/coordinate units and conversion factors, but does not record simulation-time conversion or FreeSurface time metadata. The writer docstring now states that One broader validation limitation is recorded in the PR: the snapshot auxiliary-field solve test fails at its first Poisson solve, before any snapshot I/O, because generated JIT setup has an empty Underworld development team with AI support from OpenAI Codex |
|
Both follow-ups resolved — one by you, one by us misreading the PR. The long-path half is fixed. The One thing that does need attention before merge, not a review point: this went CONFLICTING when #709 and #736 merged, both of which touch Underworld development team with AI support from Claude Code |
…rldcode#640) underworldcode#756 moved the reload payload from the file root into /restart/petsc. The writer still emits the per-field section AND its global vector, one group deeper -- both are on disk -- but the reader's existence check looked only at the root, so it reported "no PETSc-native payload" for a file written WITH petsc_reload=True. The underworldcode#640 guard then refused the good path along with the bad, telling the caller to re-write the file with the flag they had already used, and split-mesh checkpoints could not be read back at all. Measured: tests/test_0864_split_checkpoint_roundtrip.py is 5 passed at 42f9347 (the merge before underworldcode#756) and 1 failed at f414da6 (after it). It is tier_a and reachable from scripts/test.sh, so CI covers it. Two reader-side changes, both in the guard's inputs: - _petsc_payload_name searches "topologies" and "restart/petsc/topologies". It is only an existence check, and a file written by either version has to stay readable. - _guard_coincident_dofs no longer assumes a v1.1 file has no payload. It looked the payload up only for legacy files while read_timestep calls _read_native_payload on a v1.1 file immediately afterwards, so the guard refused the very files the native path was about to read correctly. The saved-vs-live row comparison stays legacy-only: v1.1 shares one compact geometry across fields (underworldcode#756), so there is no per-field saved cloud and saved_rows is 0 by construction. New test, tier B because it is proven: with the single-location lookup restored, test_the_payload_is_found_wherever_the_writer_put_it fails and so does the round-trip test; with the fix both pass. It asserts the section and the vector are on disk and that the existence check finds them, so a future relocation fails with the reason rather than as a confusing refusal. test_0864 6 passed. With test_0005, test_0007, test_0008, test_0012 and test_0020 (the checkpoint and snapshot suite): 50 passed. check_test_coverage.py: all 352 files reachable. Underworld development team with AI support from Claude Code Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E87Q7KrpapxeQiLD1RiNXv
…joint underworldcode#744; xdmf underworldcode#756) Conflicts resolved with both sides kept where they meet: - fault_split: development's region-based redistribution (groups) carries the pairing through as labels when asked; add_fault takes cut / exclude / blind / across_seams and the 3-D placement options; the seam-normal override lives in the mesh-level pair helper, so coarse levels see it. - Mesh.add_fault: development's options plus split_levels; the level replay applies to cut faults only (a placed band's spines have no counterpart on the levels), runs finest-down, and stops with a warning at a level the faults cannot be carried onto (a one-cell junction ligament closes at the coarser spacing), leaving that level and those beneath welded. - custom_mg: the cell-located transfer and the orphan drop apply only when a COARSE level is split; a hierarchy whose only split level is the finest keeps development's builders, orphan repair and FAC patch. - rotated_bc: the same zeroRows-by-global-row fix on both sides, one copy. - Thin-sheet conflicts against development (solver Cython warm-up, the checkpoint read, field projection): development's code with the thin-sheet additions. Merged build: tests 1086, 1087, 1089 (np 2), 1083, 0845-0847, 1017, 1022, 0865 (np 2) and 0866 pass. Underworld development team with AI support from Claude Code
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. Scalarmodel_to_physical_scaleattributes preserve the writer conversion factors for coordinates and fields. When no destination reference quantities are set,read_timestep()restores the writer solver frame using these factors, including DG1 corner values. An active destination units model continues to define the reload scaling. Older physical files without these attributes require the writer reference quantities to be set before reading.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.Upstream alignment and scope
Merged
upstream/developmentat4a4f18d8after #709 and #736 landed and resolved the overlapping DG1 changes. The compact layout builds on #736's element-local DG1 foundation and uses dimensional/fields, shared mesh geometry, and optional/restart/petscdata.PETSc/HDF5 mesh, variable, dimensional-field, geometry and restart writes and native readers now use the existing
_short_io_pathworkaround through a sharedutilities/_io.pyhelper. PETSc receives the basename while the public output paths and XDMF references retain their requested locations. Snapshot I/O uses the same helper. This extends the workaround for #645; it does not fix PETSc itself or change filesystem filename limits.Field and coordinate units/conversion factors are recorded. Simulation-time conversion and FreeSurface time metadata are not recorded here:
indexremains an output identifier. #562 remains open. This PR does not claim to resolve refined-mesh checkpoint issues #690/#809 or snapshot migration #252.Validation
Current revision, macOS arm64 / PETSc 3.25.0 / Open MPI 5.0.10:
test_disk_restore_refreshes_packed_auxiliary_fields_before_solvefails at its initial Poisson solve, before snapshot I/O: generated JIT setup hasinclude_dirs=[]and compilation cannot findpetscsystypes.h. Reproduced using unmodified upstream Python source at4a4f18d8with the matching compiled extensions; the JIT code is unchanged in this PR.git diff --check.Earlier visualization/repartitioning checks (not rerun for this path-only update):
1.7763568394002505e-15.vtkQuadraticTriangle/vtkQuadraticTetra(cell types 22 / 24).Underworld development team with AI support from OpenAI Codex.