GridFire 0.0.1a
General Purpose Nuclear Network
Loading...
Searching...
No Matches
partition_ground.cpp
Go to the documentation of this file.
2
3#include <ranges>
4
5#include "fourdst/logging/logging.h"
6#include "fourdst/composition/atomicSpecies.h"
7#include "fourdst/composition/species.h"
8
9#include "quill/LogMacros.h"
10
11namespace gridfire::partition {
13 for (const auto &isotope: fourdst::atomic::species | std::views::values) {
14 m_ground_state_spin[make_key(isotope.z(), isotope.a())] = isotope.spin();
15 }
16 }
17
19 const int z,
20 const int a,
21 const double T9
22 ) const {
23 LOG_TRACE_L2(m_logger, "Evaluating ground state partition function for Z={} A={} T9={}", z, a, T9);
24 const int key = make_key(z, a);
25 const double spin = m_ground_state_spin.at(key);
26 return (2.0 * spin) + 1.0;
27 }
28
30 const int z,
31 const int a,
32 const double T9
33 ) const {
34 LOG_TRACE_L2(m_logger, "Evaluating derivative of ground state partition function for Z={} A={} T9={}", z, a, T9);
35 return 0.0;
36 }
37
39 const int z,
40 const int a
41 ) const {
42 return m_ground_state_spin.contains(make_key(z, a));
43 }
45 const int z,
46 const int a
47 ) {
48 return z * 1000 + a; // Simple key generation for Z and A
49 }
50}
double evaluateDerivative(const int z, const int a, const double T9) const override
bool supports(const int z, const int a) const override
static constexpr int make_key(const int z, const int a)
double evaluate(const int z, const int a, const double T9) const override
std::unordered_map< int, double > m_ground_state_spin