GridFire 0.0.1a General Purpose Nuclear Network

Loading...
Searching...
No Matches
partition_rauscher_thielemann.h
Go to the documentation of this file.
1#pragma once
2
3#include "gridfire/partition/partition_abstract.h"
4
5#include "fourdst/logging/logging.h"
6
7#include <string>
8#include <vector>
9#include <unordered_map>
10#include <array>
11#include <utility>
12#include <memory>
13
14 namespace gridfire::partition {
15
26 class RauscherThielemannPartitionFunction final : public PartitionFunction {
27 public:
35 RauscherThielemannPartitionFunction();
48 double evaluate(int z, int a, double T9) const override;
61 double evaluateDerivative(int z, int a, double T9) const override;
69 bool supports(int z, int a) const override;
75 std::string type() const override { return "RauscherThielemann"; }
81 std::unique_ptr<PartitionFunction> clone() const override {
82 return std::make_unique<RauscherThielemannPartitionFunction>(*this);
83 }
84 private:
89 enum Bounds {
90 FRONT,
91 BACK,
92 MIDDLE
93 };
94 private:
95 struct IsotopeData {
96 double ground_state_spin;
97 std::array<double, 24> normalized_g_values;
98 };
99 struct InterpolationPoints {
100 double T9_high;
101 double G_norm_high;
102 double T9_low;
103 double G_norm_low;
104 };
105 struct IdentifiedIsotope {
106 Bounds bound;
107 const IsotopeData& data;
108 size_t upperIndex;
109 size_t lowerIndex;
110 };
111 private:
112 quill::Logger* m_logger = fourdst::logging::LogManager::getInstance().getLogger("log");
113 std::unordered_map<int, IsotopeData> m_partitionData;
114 private:
122 static InterpolationPoints get_interpolation_points(
123 const size_t upper_index,
124 const size_t lower_index,
125 const std::array<double, 24>& normalized_g_values
126 );
135 IdentifiedIsotope find(int z, int a, double T9) const;
142 static constexpr int make_key(int z, int a);
143 };
144
145}
gridfire::partition::PartitionFunction
Abstract interface for evaluating nuclear partition functions.
Definition partition_abstract.h:17
gridfire::partition::RauscherThielemannPartitionFunction::find
IdentifiedIsotope find(int z, int a, double T9) const
Identify isotope entry and grid indices for given T9.
Definition partition_rauscher_thielemann.cpp:117
gridfire::partition::RauscherThielemannPartitionFunction::type
std::string type() const override
Get type identifier for this partition function.
Definition partition_rauscher_thielemann.h:75
gridfire::partition::RauscherThielemannPartitionFunction::get_interpolation_points
static InterpolationPoints get_interpolation_points(const size_t upper_index, const size_t lower_index, const std::array< double, 24 > &normalized_g_values)
Get interpolation points from normalized G array.
Definition partition_rauscher_thielemann.cpp:105
gridfire::partition::RauscherThielemannPartitionFunction::m_partitionData
std::unordered_map< int, IsotopeData > m_partitionData
Map of isotope key to data.
Definition partition_rauscher_thielemann.h:113
gridfire::partition::RauscherThielemannPartitionFunction::m_logger
quill::Logger * m_logger
Definition partition_rauscher_thielemann.h:112
gridfire::partition::RauscherThielemannPartitionFunction::supports
bool supports(int z, int a) const override
Check if partition data exists for given isotope.
Definition partition_rauscher_thielemann.cpp:98
gridfire::partition::RauscherThielemannPartitionFunction::Bounds
Bounds
Indicator for temperature grid bound position.
Definition partition_rauscher_thielemann.h:89
gridfire::partition::RauscherThielemannPartitionFunction::FRONT
@ FRONT
Below first grid point.
Definition partition_rauscher_thielemann.h:90
gridfire::partition::RauscherThielemannPartitionFunction::MIDDLE
@ MIDDLE
Between grid points.
Definition partition_rauscher_thielemann.h:92
gridfire::partition::RauscherThielemannPartitionFunction::BACK
@ BACK
Above last grid point.
Definition partition_rauscher_thielemann.h:91
gridfire::partition::RauscherThielemannPartitionFunction::evaluateDerivative
double evaluateDerivative(int z, int a, double T9) const override
Evaluate temperature derivative of partition function.
Definition partition_rauscher_thielemann.cpp:78
gridfire::partition::RauscherThielemannPartitionFunction::make_key
static constexpr int make_key(int z, int a)
Generate integer key for isotope (z,a).
Definition partition_rauscher_thielemann.cpp:145
gridfire::partition::RauscherThielemannPartitionFunction::clone
std::unique_ptr< PartitionFunction > clone() const override
Clone this partition function instance.
Definition partition_rauscher_thielemann.h:81
gridfire::partition::RauscherThielemannPartitionFunction::RauscherThielemannPartitionFunction
RauscherThielemannPartitionFunction()
Construct and populate partition data.
Definition partition_rauscher_thielemann.cpp:20
gridfire::partition::RauscherThielemannPartitionFunction::evaluate
double evaluate(int z, int a, double T9) const override
Evaluate partition function for isotope at temperature.
Definition partition_rauscher_thielemann.cpp:43
gridfire::partition
Definition partition_composite.h:15
partition_abstract.h
gridfire::partition::RauscherThielemannPartitionFunction::IdentifiedIsotope
Definition partition_rauscher_thielemann.h:105
gridfire::partition::RauscherThielemannPartitionFunction::IdentifiedIsotope::lowerIndex
size_t lowerIndex
Definition partition_rauscher_thielemann.h:109
gridfire::partition::RauscherThielemannPartitionFunction::IdentifiedIsotope::bound
Bounds bound
Definition partition_rauscher_thielemann.h:106
gridfire::partition::RauscherThielemannPartitionFunction::IdentifiedIsotope::data
const IsotopeData & data
Definition partition_rauscher_thielemann.h:107
gridfire::partition::RauscherThielemannPartitionFunction::IdentifiedIsotope::upperIndex
size_t upperIndex
Definition partition_rauscher_thielemann.h:108
gridfire::partition::RauscherThielemannPartitionFunction::InterpolationPoints
Definition partition_rauscher_thielemann.h:99
gridfire::partition::RauscherThielemannPartitionFunction::InterpolationPoints::G_norm_high
double G_norm_high
Normalized G at upper bound.
Definition partition_rauscher_thielemann.h:101
gridfire::partition::RauscherThielemannPartitionFunction::InterpolationPoints::T9_low
double T9_low
Lower temperature bound.
Definition partition_rauscher_thielemann.h:102
gridfire::partition::RauscherThielemannPartitionFunction::InterpolationPoints::T9_high
double T9_high
Upper temperature bound.
Definition partition_rauscher_thielemann.h:100
gridfire::partition::RauscherThielemannPartitionFunction::InterpolationPoints::G_norm_low
double G_norm_low
Normalized G at lower bound.
Definition partition_rauscher_thielemann.h:103
gridfire::partition::RauscherThielemannPartitionFunction::IsotopeData
Definition partition_rauscher_thielemann.h:95
gridfire::partition::RauscherThielemannPartitionFunction::IsotopeData::normalized_g_values
std::array< double, 24 > normalized_g_values
Normalized G values on RT grid.
Definition partition_rauscher_thielemann.h:97
gridfire::partition::RauscherThielemannPartitionFunction::IsotopeData::ground_state_spin
double ground_state_spin
Spin of the isotope ground state.
Definition partition_rauscher_thielemann.h:96