[newchem-cpp] introduce GrainMetalInjectPathways type#447
Merged
brittonsmith merged 64 commits intoFeb 6, 2026
Merged
Conversation
There's still a lot of work to be done (the type is incomplete and isn't filled by anything at all)
We don't yet use the new format, but we are just about ready to start doing so
The goal is two-fold: 1. reduce the length of grackle::impl::initialize_dust_yields 2. make some anticipated spot checks a LOT easier
…(essentially data was randomly swapped between dust species within a given injection pathway)
…tion model format A bunch of this mess was in place to check for equivalence. Indeed, it succesfully uncovered a major error that is now fixed (in a prior commit)
a24e6c0 to
d8137d6
Compare
GrainMetalInjectPathways typeGrainMetalInjectPathways type
brittonsmith
approved these changes
Feb 6, 2026
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.
To be reviewed after PRs #461 and #462 are reviewed
Overview
The central premise of this PR is to adjust the way that we organize and load the data for the injection pathways.
Important
This PR is a LOT smaller than it looks:
In any case, this PR suffered significant scope creep. My apologies if that makes the PR difficult to remove
Summary of Changes
The main focus was introducing the
GrainMetalInjectPathwaystype. It's used to hold the tables of data for each injection pathway. A few items worth mentioning:I had to do a LOT of digging through the multi-grain species dust code so that I could appropriately document things. When I did this, I made a point of leaving a LOT of clarifying comments.
HDF5 Reading: Can't be implemented yet.
This PR doesn't include the machinery for loading the injection data from an external hdf5 file, yet. I REALLY think this is the direction we need to go in, but I wanted to cut my losses for the moment.
Essentially, we need to do two things before we do this (so that we can minimize the number of times we regenerate the HDF5 files).
We need to finalize the names of the dust species. I'll open a separate issue to discuss this more.
Currently we explicitly track 3 kinds of yields for a given injection pathway:
C,O, ...) injectedUnder Grackle's current implementation,1 the second kind of yield is subtracted from the first to determine the total amount of a given metal nuclide that is injected in dust grains. But, we should be able to compute quantity using the third kinds of yields. Basically I want to avoid tracking the first kind of data in the HDF5 files (to simplify some parsing and the structure of the files).
For now, I altered the formatting of the hardcoded data to make the code that loads the information more legible and so we could structure that code in a manner consistent with how it will look when we start reading HDF5 files. I need to make a point of posting my python scripts for generating the HDF5 files.
Other Thoughts
There's still stuff to follow up on here. I have a lot of thoughts. One thing we need to do is make it possible to query the relevant rate information through the dynamic rate-access API. I'll edit this section if I have time.
Footnotes
Issues [newchem-cpp] Metal Chemistry Shouldn't Require SNe Yields #446 and [newchem-cpp]
make_consistentseems totally wrong for grain growth or destruction #460 highlight that the consistency enforcement should change, but that doesn't really change my point. ↩