-
Notifications
You must be signed in to change notification settings - Fork 55
[newchem-cpp] lookup_cool_rate1d
cleanup 3/3
#429
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
Open
mabruzzo
wants to merge
129
commits into
grackle-project:newchem-cpp
Choose a base branch
from
mabruzzo:ncc/lookup_rate_1d_cleanup-grain-alt
base: newchem-cpp
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[newchem-cpp] lookup_cool_rate1d
cleanup 3/3
#429
mabruzzo
wants to merge
129
commits into
grackle-project:newchem-cpp
from
mabruzzo:ncc/lookup_rate_1d_cleanup-grain-alt
+3,142
−2,164
Conversation
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
…re used (to silence unused-variable warnings)
I added a bunch of comments to explain what's actually happenning here and I slightly refactored the code. The impetus for doing this was some warnings that the compiler couldn't tell whether some variables were fully initialized. I'm going to address that in the next commit
…he context of sublimation)
It turns out that no matter what we do, we will cause the rates to drift slightly. I have validated that this is at the level of machine tolerance
Since we'll need to update the gold standard anyways, we're also going to update this logic (I had originally tried to put this off for as long as possible)
…_1d_cleanup-scratch
5 tasks
…_1d_cleanup-scratch
…_cleanup-grain-alt
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.
This PR shouldn't be reviewed until after #428 has been merged
Overview
This is the final PR for cleaning up
lookup_cool_rate1d
(there's obviously more to do, but I'm happy enough to move on)Description
This PR leverages the
GrainSpeciesInfo
type introduced in #428 to refactor all of the logic pertaining to the calculation of dust grain rates.lookup_cool_rate1d
into a helper function calledlookup_dust_rate1d
(this helper function is currently called bylookup_cool_rate1d
, but an argument could be made that it should maybe get called separately).lookup_cool_rate1d
Gold Standard Considerations
Importantly, this is going to fail some of the answer tests. (After merging, we'll need to bump the gold standard).
Since we're going to bump the gold standard anyways, I took the opportunity to precompute a constant for the calculation of grain growth rates (i.e. a
std::pow
call and a division is now called before we "loop over a row" rather than within the loop).1 This change should definitely affect results, (to within machine tolerance), but it's not clear that it significantly shifts rates (with machine looks like this change probably doesn't change things muchFootnotes
By slightly adapting the
GrainSpeciesInfo
machinery, it would be straightforward to precompute these constants at initialization, but we can leave that for the future. ↩