[newchem-cpp] lookup_cool_rate1d cleanup part 2#416
Merged
brittonsmith merged 22 commits intoNov 18, 2025
Merged
Conversation
lookup_cool_rate1d cleanup part 2
1. remove some unused variables (that I accidently copied) 2. prevent some implicit casts
0047675 to
592dc98
Compare
…_1d_cleanup-scratch
This patch stops the allocating `internal_dust_prop_buf` within `lookup_cool_rates1d`, and passes in the pre-allocated buffers instead. As part of the commit, I also renamed `internal_dust_prop_buf` so that it is now called `internal_dust_prop_scratch_buf`
…_1d_cleanup-scratch
lookup_cool_rate1d cleanup part 2lookup_cool_rate1d cleanup part 2
…_1d_cleanup-scratch
9be154d to
369f7ba
Compare
…_1d_cleanup-scratch
5 tasks
…_1d_cleanup-scratch
…_1d_cleanup-scratch
Collaborator
Author
|
@brittonsmith, this should be ready to go |
brittonsmith
approved these changes
Nov 18, 2025
brittonsmith
left a comment
Contributor
There was a problem hiding this comment.
This looks great. In the interest of progress, let's merge this now. The dust variable name can be changed any time.
Comment on lines
+258
to
+262
| //H2 formation on dust grains with C and S compositions | ||
| if ( | ||
| (add_h2dust_C_reaction_rate(&my_rates->h2dustC, kUnit, my_chemistry) | ||
| != GR_SUCCESS) || | ||
| (add_h2dust_S_reaction_rate(&my_rates->h2dustS, kUnit, my_chemistry) |
Contributor
There was a problem hiding this comment.
Maybe now is the time to right this wrong convert S to Si to denote this being silicon.
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 #415 is merged
The primary objective of this PR is to factor out heap allocations from the core loop. To accomplish this, this PR
h2dustSandh2dustC.ShieldFactorCalculator, so that we can avoid allocating thef_shieldHandf_shieldHearrays)internal_dust_prop_bufinstanceWhile I was doing this, I also factored out the H2-shielding logic into a helper function to try to improve readability (and make the code easier to reason about). I was also able to remove a bunch of logic where we were constructing Vlews from the body of
lookup_cool_rate1d.