Skip to content

[newchem-cpp] Only load needed injection pathway data#478

Merged
brittonsmith merged 41 commits into
grackle-project:newchem-cppfrom
mabruzzo:ncc/only_load_needed_pathways
Mar 19, 2026
Merged

[newchem-cpp] Only load needed injection pathway data#478
brittonsmith merged 41 commits into
grackle-project:newchem-cppfrom
mabruzzo:ncc/only_load_needed_pathways

Conversation

@mabruzzo

@mabruzzo mabruzzo commented Dec 28, 2025

Copy link
Copy Markdown
Collaborator

To be merged after #464 has been merged


This PR stops loading unused injection pathway data

Previously, if we used metal chemistry, we loaded all injection pathway data. Now we just load what we need. Relatedly, when we index into an array and each member corresponds to a distinct injection pathway, index 0 is now always valid. (For context, when my_chemistry->multi_metals is 0, we would historically need to access the relevant data at the index specified by my_chemistry->metal_abundances.)

Essentially, this type holds pointers to the various injection pathway
fields in the order that is implicitly assumed throughout the codebase.
This change helps simplify make_consistent and it will also simplify
`calc_grain_size_increment_1d` (once transcribed). Longer term, I have a
plan that will let use dispose of this ``InjectPathFieldPack`` type
(but, we need to make a few changes before we get to that).
Introduce the start_idx and stop_idx members to the struct
Use the start_idx and stop_idx members to simplify make_consistent
I was expecting this to cause gold-standard drift (but that doesn't seem
to be the case)
Previously, if we used metal chemistry, we loaded all injection pathway
data. Now we just load what we need. Relatedly, when we index into an
array and each member corresponds to a distinct injection pathway, index
0 is now always valid. For context, when my_chemistry->multi_metals is
0, we would historically need to access the relvant data at the index
specified by my_chemistry->metal_abundances.
@brittonsmith brittonsmith merged commit a713075 into grackle-project:newchem-cpp Mar 19, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants