-
Notifications
You must be signed in to change notification settings - Fork 56
[newchem-cpp] lookup_cool_rate1d cleanup part 2
#416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[newchem-cpp] lookup_cool_rate1d cleanup part 2
#416
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
…_1d_cleanup-scratch
…_1d_cleanup-scratch
|
@brittonsmith, this should be ready to go |
brittonsmith
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great. In the interest of progress, let's merge this now. The dust variable name can be changed any time.
| //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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe now is the time to right this wrong convert S to Si to denote this being silicon.
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.