[newchem-cpp] Remove Hard-coded injection path names from grackle_field_data#480
Merged
brittonsmith merged 14 commits intoMar 31, 2026
Conversation
1b615a0 to
1bbb83e
Compare
643a69c to
a41f096
Compare
This a crude hack
This leaves some temporary machinery
a41f096 to
7e2d847
Compare
This is uglier, but the number of inject field paths are now entirely determined by the values read in from the table. To add/remove/rename pathways, you "just" need to modify `inject_model/raw_data.[ch]pp` and `inject_model/load_data.[ch]pp`. This is a massive step that will make it possible to move this data into HDF5 tables
grackle_field_datagrackle_field_data
brittonsmith
approved these changes
Mar 31, 2026
brittonsmith
left a comment
Contributor
There was a problem hiding this comment.
This is great. I'm excited to start using it. It also finally hit me what has been rubbing me the wrong way about the injection pathway metal densities. For all but the first one, the name refers to a progenitor supernova making the metal. However, "local_ISM", while also alluding to an abundance pattern, is doing so through a different conceptual path. This is a single field representing an abundance pattern. I'm not at all advocating for a change in the naming convention but I think this will be crucial in the documentation.
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 #479 is merged
This PR replaces all hard-coded injection pathway data-members from the
grackle_field_data(e.g.grackle_field_data::local_ISM_metal_density,grackle_field_data::y19_metal_density, ...) with an array of pointers known asgrackle_field_data::inject_pathway_metal_density. In other words, Grackle no longer hardcodes the names of each injection pathway members as part of thegrackle_field_datastruct. (To determine the names, users must use the query-machinery introduced in #479).This is significant for 2 reasons:
grackle_field_datawhenever someone wanted another model (while maintaining members for all existing models)inject_model/raw_data.[ch]ppandinject_model/load_data.[ch]pp.