Update EXP IC routines for HDF5 output - #229
Open
The9Cat wants to merge 21 commits into
Open
Conversation
added 9 commits
August 14, 2026 12:14
…nd applied this to all of the native particle generators.
… enclosing cube test optional
Contributor
There was a problem hiding this comment.
Pull request overview
Adds HDF5 output support to EXP initial-condition generators using the runtime particle schema.
Changes:
- Introduces a shared HDF5 particle writer with MPI gathering, compression, and precision options.
- Integrates HDF5 output across six IC generators.
- Centralizes 1D mass models and adds HDF5 smoke tests.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
utils/ICs/ZangICs.cc |
Adds HDF5 output options. |
utils/ICs/ParticleHDF5.H |
Implements the shared writer. |
utils/ICs/massmodel1d.H |
Removes the local model header. |
utils/ICs/initial2d.cc |
Adds gendisk2d HDF5 output. |
utils/ICs/initial.cc |
Adds gendisk HDF5 output. |
utils/ICs/gensph.cc |
Adds distributed HDF5 output. |
utils/ICs/genslab.cc |
Reworks slab generation and output. |
utils/ICs/cubeICs.cc |
Adds cube HDF5 output. |
utils/ICs/CMakeLists.txt |
Uses centralized mass models. |
tests/CMakeLists.txt |
Registers HDF5 smoke tests. |
tests/check_hdf5_particles.py |
Validates particle schemas. |
include/massmodel1d.H |
Centralizes and expands 1D models. |
exputil/massmodel1d.cc |
Implements centralized models. |
exputil/CMakeLists.txt |
Adds models to exputil. |
Suppressed comments (3)
exputil/massmodel1d.cc:375
setDF(..., nint)stores a requested quadrature size, butcompute_modelignores it and always uses 400 points. Use the member so the public tuning parameter has an effect.
exputil/massmodel1d.cc:4- This source still constructs
std::ifstreamat line 26 but no longer includes<fstream>. Compilation now depends on an unrelated transitive include fromSLGridMP2.H; include the defining standard header directly.
include/massmodel1d.H:706 - The default constructor leaves both
epsilonanddist_definedindeterminate, althoughdistfimmediately usesepsilonand callers inspectdist_defined. Initialize a deliberate regularization value and mark the completed model as defined, as the other constructors do.
H = 1.0;
Omega = std::sqrt(2.0*M_PI/H);
norm = std::sqrt(2/Omega)/(M_PI*2.0*H);
Jmax = 0.5*Omega*H*H;
ModelID = "Uniform";
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: The9Cat <25960766+The9Cat@users.noreply.github.com>
Co-authored-by: The9Cat <25960766+The9Cat@users.noreply.github.com>
Co-authored-by: The9Cat <25960766+The9Cat@users.noreply.github.com>
Co-authored-by: The9Cat <25960766+The9Cat@users.noreply.github.com>
added 2 commits
August 15, 2026 10:58
…ts, added corrected total mass checks
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.
Summary
gensph,gendisk,gendisk2d,zangics,cubeics,slabicswith an-5,--hdf5option for producing HDF5Why
cephby more than an order of magnitude in write time.Tests
CTesttests to check that the HDF5 files have the expected metadata and have particles masses that sum to some userspecificed expected value. Default is 1. Tests passed forgensph,slabicsandcubeics.slabicsIC generationslabicsgenerated ICsgendiskIC generationgendiskgenerated ICsTBD
Consider setting HDF5 output to the default after all tests are successfully completed.