Skip to content

Conversation

@oparry-ukaea
Copy link
Contributor

@oparry-ukaea oparry-ukaea commented Sep 19, 2025

Some implementation details:

  • Reorganises RateHelper to cope with (Amjuel) fits that are a function of (T), (E,T) and (n,T).
  • RateHelper is templated on the param types, but Reaction decides which to use at runtime. This allows subclasses to (for instance) read the type from a json file.
  • Momentum and energy 'channels' are introduced to allow developers to override the default splitting of momentum and energy between reactant products. H isotope CX sets channels such that all of the incoming ion [energy/momentum] is transferred to the outgoing neutral and vice-versa.
  • ReactionParser is modified to cope with momentum and energy transfer in symmetric reactions (e.g. h + h+ -> h+ + h)
  • tests/integrated/1D-recycling/runtest has been modified to significantly tighten up the tolerances as far as possible and regression data is now stored separately depending on the compiler optimisation level (which is extracted from the run output).

ToDo:

  • Check that diagnostics values haven't changed for 1D-recyling.
  • Move calculation of collision frequencies into RateHelper and Reaction::transform.
  • Generalise more of HydrogenChargeExchange::transform_additional (hopefully remove completely).
  • Regression test for non-symmetric CX (not covered by 1D-recycling)

* @return std::vector<std::string> vector of keys
*/
template <typename T>
static inline std::vector<std::string> str_keys(const std::map<std::string, T>& map) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C++20 has std::views::keys -- not for this PR, but worth thinking if we can move to C++20 @bendudson ?

@codecov
Copy link

codecov bot commented Dec 15, 2025

Codecov Report

❌ Patch coverage is 84.97268% with 55 lines in your changes missing coverage. Please review.
✅ Project coverage is 27.44%. Comparing base (5ffec08) to head (79890af).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
include/reaction.hxx 0.00% 12 Missing ⚠️
src/reaction.cxx 86.95% 3 Missing and 9 partials ⚠️
include/hydrogen_charge_exchange.hxx 78.43% 10 Missing and 1 partial ⚠️
include/rate_helper.hxx 91.58% 2 Missing and 7 partials ⚠️
include/reaction_diagnostic.hxx 0.00% 4 Missing ⚠️
src/reaction_parser.cxx 86.66% 4 Missing ⚠️
include/amjuel_hydrogen.hxx 50.00% 1 Missing ⚠️
include/hermes_utils.hxx 94.73% 0 Missing and 1 partial ⚠️
include/reaction_parser.hxx 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #398      +/-   ##
==========================================
+ Coverage   26.41%   27.44%   +1.03%     
==========================================
  Files          90       89       -1     
  Lines        8105     8208     +103     
  Branches     1133     1159      +26     
==========================================
+ Hits         2141     2253     +112     
+ Misses       5745     5725      -20     
- Partials      219      230      +11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants