[newchem-cpp] lookup_cool_rate1d cleanup 3/3#429
Merged
brittonsmith merged 22 commits intoJan 13, 2026
Merged
Conversation
…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)
5 tasks
…_cleanup-grain-alt
…_cleanup-grain-alt
Collaborator
Author
|
@brittonsmith, conflicts have are addressed |
…_cleanup-grain-alt
2be4289 to
6edd499
Compare
Collaborator
Author
|
Ignore the force-push (I just undid an unnecessary merge with an unrelated branch) |
Contributor
|
I'm still reviewing this, but the test failures look like errors and not issues with answers. I'm seeing what looks like a segfault during one of the model tests. |
Honestly, I'm not sure why it was a problem since we were copying aggregates. In reality, my intuition is probably just wrong. Anyways, it makes a little more sense why this error wasn't present on all platforms. I also introduced a test to check this kind of thing for the future (actually, in the future this kind of test will get a lot cleaner).
brittonsmith
approved these changes
Jan 13, 2026
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.
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
GrainSpeciesInfotype introduced in #428 to refactor all of the logic pertaining to the calculation of dust grain rates.lookup_cool_rate1dinto 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_rate1dGold 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::powcall 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
GrainSpeciesInfomachinery, it would be straightforward to precompute these constants at initialization, but we can leave that for the future. ↩