[newchem-cpp] Adjust handling of k27#495
Open
mabruzzo wants to merge 40 commits intograckle-project:newchem-cppfrom
Open
[newchem-cpp] Adjust handling of k27#495mabruzzo wants to merge 40 commits intograckle-project:newchem-cppfrom
k27#495mabruzzo wants to merge 40 commits intograckle-project:newchem-cppfrom
Conversation
…transcribe_cool1d_cloudy_old_tables_g
for more information, see https://pre-commit.ci
…ub.com/ChristopherBignamini/grackle into newchem-cpp_transcribe_rate_timestep_g
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
…transcribe_rate_timestep_g
for more information, see https://pre-commit.ci
…ub.com/ChristopherBignamini/grackle into newchem-cpp_transcribe_rate_timestep_g
for more information, see https://pre-commit.ci
…d radiative rates
The change in the names reflect the variable now generically references any standard photo-rate (not just rates adjusted for shielding)
This was separated from the prior commit to make review easier
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 #494 has been merged
This PR stops treats
k27more consistently with all of the other reaction rates (radiative or otherwise).Description
For added context, grackle has historically treated
k27as a special case:k27as an unmodified scalar value rather than use a 1D array, like every single other reaction rate known to GrackleThis PR changes this behavior. We now copy
k27into a 1D array.Tradeoffs:
The benefits pertain to code structure:
FullRxnRateBufferand then they are used to update species densitiesPhotoRxnRateCollection#496 (the followup to this PR, which uses a compile-time LUT to access the photo-rates): all reaction rates will be accessed by index when updating the speciesThe Cost: Grackle is slightly slower. In practice, the performance difference is probably pretty small. When we use
k27(primordial_chemistry>=2), there are at least 30 other reaction rates under consideration. Special handling of 1/30 cases rates is going to have a minimal impact.Overall, I think this is worth doing. And, if we get to the point where we decide the performance tradeoff isn't worth it, we can always go back to the previous approach later.
Review Advice
This is actually a very simple PR. It's easiest to go through commit-by-commit