Skip to content

Conversation

@SpeedyTurtle599
Copy link

@SpeedyTurtle599 SpeedyTurtle599 commented Dec 29, 2025

Description

This PR adds native HDF5+XDMF output support to MFC's post-processor as a portable alternative to Silo-HDF5 format. The new format (format=3) produces standard HDF5 data files with XDMF metadata that works reliably with ParaView 5.12+ and other XDMF-compatible visualization tools without requiring Silo library installation.

Key Features

  • Native HDF5+XDMF output module (m_hdf5_xdmf_output.fpp): Complete implementation supporting 1D/2D/3D structured grids, particle/bubble data, and all flow variables
  • Single/double precision support: Variable data respects the precision parameter (1=32-bit, 2=64-bit); grid coordinates always use double precision for accuracy
  • Time series XDMF: Master time_series.xdmf file references all timesteps for animated visualization in ParaView
  • HDF5 metadata attributes: Stores spatial_extent (bounding box) and data_range (min/max) for future visualization optimization
  • Test framework updates: Proper validation of HDF5+XDMF output files with directory traversal fix
  • 6 regression tests: Based on existing 1D/2D/3D examples covering shock tubes, vortex, and bubble collapse

Type of change

  • New feature (non-breaking change which adds functionality)

Scope

  • This PR comprises a set of related changes with a common goal

How Has This Been Tested?

  • Built and ran all 6 new HDF5+XDMF test cases (BAC4B871, 682BAB49, 9A210C81, 303ECD53, 2087DEB9, B30CF683)
  • Verified XDMF files load correctly in ParaView 5.12+
  • Validated HDF5 file structure with h5dump
  • Ran existing test suite to ensure no regressions

Test Configuration:

  • macOS with GNU Fortran 15.2.0, HDF5 with Fortran bindings
  • CPU-only build (this feature is post-process only, no GPU code)

Checklist

  • I have added comments for the new code
  • I added Doxygen docstrings to the new code
  • I have made corresponding changes to the documentation (docs)
  • I have added regression tests to the test suite so that people can verify in the future that the feature is behaving as expected
  • I have added example cases in examples that demonstrate my new feature performing as expected. (Tests use existing examples with format=3)
  • I ran .mfc.sh format before committing my code
  • New and existing tests pass locally with my changes, including with GPU capability enabled (both NVIDIA hardware with NVHPC compilers and AMD hardware with CRAY compilers) and disabled
  • This PR does not introduce any repeated code (it follows the DRY principle)
  • I cannot think of a way to condense this code and reduce any introduced additional line count

If your code changes any code source files (anything in simulation)

N/A - This PR only modifies post_process which runs on CPU only.

- Added a new module `m_hdf5_xdmf_output` to provide native HDF5 and XDMF output support for MFC, enhancing compatibility with ParaView visualization software
- Implemented functions for initializing HDF5, writing grid and variable data, and generating XDMF metadata
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 29, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sbryngelson
Copy link
Member

Please add documentation. Aside from the usual documentation we do, it would be useful to have a "guide" on how and when to use different I/O options.

@codecov
Copy link

codecov bot commented Dec 30, 2025

Codecov Report

❌ Patch coverage is 1.56250% with 189 lines in your changes missing coverage. Please review.
✅ Project coverage is 43.58%. Comparing base (df782b5) to head (5d7ebef).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/post_process/m_hdf5_xdmf_output.fpp 0.00% 171 Missing ⚠️
src/post_process/m_data_output.fpp 10.00% 16 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1101      +/-   ##
==========================================
- Coverage   43.98%   43.58%   -0.40%     
==========================================
  Files          71       72       +1     
  Lines       20284    20476     +192     
  Branches     1982     2000      +18     
==========================================
+ Hits         8922     8925       +3     
- Misses      10225    10412     +187     
- Partials     1137     1139       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Enhance the native HDF5+XDMF output format (format=3) with several
improvements for feature parity with Silo-HDF5:

- Single precision support: Variable data now respects the precision
  parameter (precision=1 for 32-bit, precision=2 for 64-bit). Grid
  coordinates remain double precision for accuracy.

- Time series XDMF: Write a master time_series.xdmf file that
  references all timestep files using xi:include, enabling ParaView
  to load the entire simulation as an animated dataset.

- HDF5 metadata attributes: Store spatial_extent (bounding box) as a
  file-level attribute and data_range (min/max) on each variable
  dataset for future visualization optimization.

- Fix test.py directory traversal: Correctly search hdf5_xdmf/p*/
  for HDF5 files and hdf5_xdmf/root/ for XDMF files.

- Add 6 HDF5+XDMF test cases based on existing examples (1D/2D/3D).

- Update documentation for visualization, testing, and case files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants