Loading...
Searching...
No Matches
partition_rauscher_thielemann.h
Go to the documentation of this file.
#pragma once
#include "gridfire/partition/partition_abstract.h"
#include "fourdst/logging/logging.h"
#include <string>
#include <vector>
#include <unordered_map>
#include <array>
#include <utility>
#include <memory>
namespace gridfire::partition {
class RauscherThielemannPartitionFunction final : public PartitionFunction {
public:
RauscherThielemannPartitionFunction();
double evaluate(int z, int a, double T9) const override;
double evaluateDerivative(int z, int a, double T9) const override;
bool supports(int z, int a) const override;
std::string type() const override { return "RauscherThielemann"; }
std::unique_ptr<PartitionFunction> clone() const override {
return std::make_unique<RauscherThielemannPartitionFunction>(*this);
}
private:
enum Bounds {
FRONT,
BACK,
MIDDLE
};
private:
struct IsotopeData {
double ground_state_spin;
std::array<double, 24> normalized_g_values;
};
struct InterpolationPoints {
double T9_high;
double G_norm_high;
double T9_low;
double G_norm_low;
};
struct IdentifiedIsotope {
Bounds bound;
const IsotopeData& data;
size_t upperIndex;
size_t lowerIndex;
};
private:
quill::Logger* m_logger = fourdst::logging::LogManager::getInstance().getLogger("log");
std::unordered_map<int, IsotopeData> m_partitionData;
private:
static InterpolationPoints get_interpolation_points(
const size_t upper_index,
const size_t lower_index,
const std::array<double, 24>& normalized_g_values
);
IdentifiedIsotope find(int z, int a, double T9) const;
static constexpr int make_key(int z, int a);
};
}
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