Skip to content

Add utility to convert IPCRESS files to Spiner via Gandolf - #76

Merged
RyanWollaeger merged 5 commits into
lanl:mainfrom
alexrlongne:ipcress_2_spiner
Aug 6, 2026
Merged

Add utility to convert IPCRESS files to Spiner via Gandolf#76
RyanWollaeger merged 5 commits into
lanl:mainfrom
alexrlongne:ipcress_2_spiner

Conversation

@alexrlongne

Copy link
Copy Markdown
Contributor

Background

  • Several codes have expressed interest in a utility for using IPCRESS data directly through Spiner's DataBox objects. This PR adds a standalonge executable to singularity-opac that takes an IPCRESS file on the command line and converts it to an HDF5 file written with the Spiner DataBox saveHDF function. This utility is based on the sesame2spiner utility in singularity-eos.

  • I've tried to use as sesame2spiner as a pattern for this utility. Please let me know if you'd rather this followed a different pattern.

  • Note that the opacity table frequency points in the DataBox are the new group centers. The new group boundaries are saved to HDF5 file as well.

Changes

  • Add ipcress2spiner directory at top level
  • Add configure flag to top level CMakeLists.txt to build ipcress2spiner
  • Add CMakeLists.txt for ipcress2spiner
  • Use functionality form singularity-eos parse_cli files to make simpler parse_cli in ipcress2spiner
  • Add header file that has interpolation routines (interpolate_opacity.hpp)
  • Add header file that creates new grids, calls interpolation and creates Spiner DataBox (make_spiner_databox.hpp)
  • Add header file that has HDF5 databox saving routines (generate_files.hpp)
  • Add TODO list for other requested features

+ Mkae Spiner databoxes for each opacity type
+ Call HDF5 to make converted file from IPCRESS data
+ Update to-do list
@alexrlongne

Copy link
Copy Markdown
Contributor Author

@RyanWollaeger @adamdempsey90 Here's my first cut at this opacity conversion utility. This converts the multigroup opacity tables. I'll add gray next but I thought I'd get some feedback first. Thanks for all your help with it.

Comment thread ipcress2spiner/CMakeLists.txt Outdated
Comment thread ipcress2spiner/parse_cli.hpp Outdated
Comment thread ipcress2spiner/parse_cli.cpp Outdated
Comment thread ipcress2spiner/parse_cli.cpp Outdated
Comment thread ipcress2spiner/CMakeLists.txt
@Yurlungur

Copy link
Copy Markdown
Collaborator

At some point we can unify this with sesame2spiner since we'll be merging singularity-eos and singularity-opac some time next FY. But I still think this is nice to have.

@adamdempsey90

Copy link
Copy Markdown
Collaborator

At some point we can unify this with sesame2spiner since we'll be merging singularity-eos and singularity-opac some time next FY. But I still think this is nice to have.

We can also probably leave off pulling the ionization state from the opacity file until we've merged the two

+ Remove commented out code and unused variables from sesame version
Comment thread cmake/Findgandolf.cmake Outdated
Comment thread cmake/Findgandolf.cmake Outdated
Comment thread cmake/Findgandolf.cmake Outdated
Comment thread cmake/Findgandolf.cmake Outdated
Comment thread ipcress2spiner/interpolate_opacity.hpp
Comment thread ipcress2spiner/main.cpp
double*, int*, int*,
double*, int*, int*,double*, int*, int*, int*);
extern void c_ggetdata( char*, int*, char*,double*, int*, int*, int*);
extern void c_ggetchar( char*, int*, char*,double*, int*, int*, int*);

@RyanWollaeger RyanWollaeger Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hit this issue in another project - thought there may've been a header in their gandolfpp distribution that had these "C" prepends... this stuff confuses me though so feel free to ignore.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I add the "C" to the extern specification? I think I forgot to because I wasn't using these functions but I probably should add the "C" for completeness.

Comment thread ipcress2spiner/make_spiner_databox.hpp

@RyanWollaeger RyanWollaeger left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - just a few minor comments.

#include <utils/spiner/spiner/singularity_opac_sp5.hpp>

herr_t saveMaterial(hid_t loc, hid_t matGroup, const int matid,
const std::string &sMatid,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my own gandolf ignorance here. Do materials have a matid the same way the sesame database does?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They have material IDs that don't match the sesame IDs. I'll try to provide a map in the next update and write the common name out as part of the metadata.

Comment thread ipcress2spiner/interpolate_opacity.hpp
Comment thread ipcress2spiner/main.cpp
@RyanWollaeger

Copy link
Copy Markdown
Collaborator

+ Use hints to find Gandolf in Findgandolf.cmake
+ Guard against Gandolf not found cmake errors
+ Update copyright dates
@alexrlongne

Copy link
Copy Markdown
Contributor Author

Pushed a commit to address comments from @RyanWollaeger, looking at the rest of the comments soon.

@alexrlongne

Copy link
Copy Markdown
Contributor Author

@RyanWollaeger @Yurlungur let me know if there's anything else you'd like as part of this initial PR. Thanks for reviewing!

@RyanWollaeger
RyanWollaeger merged commit b0ea66a into lanl:main Aug 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants