GridFire 0.0.1a
General Purpose Nuclear Network
Loading...
Searching...
No Matches
gridfire::partition::GroundStatePartitionFunction Class Referencefinal

Partition function implementation for nuclear ground states. More...

#include <partition_ground.h>

Inheritance diagram for gridfire::partition::GroundStatePartitionFunction:
gridfire::partition::PartitionFunction

Public Member Functions

 GroundStatePartitionFunction ()
 
double evaluate (const int z, const int a, const double T9) const override
 
double evaluateDerivative (const int z, const int a, const double T9) const override
 
bool supports (const int z, const int a) const override
 
std::string type () const override
 
std::unique_ptr< PartitionFunctionclone () const override
 
- Public Member Functions inherited from gridfire::partition::PartitionFunction
virtual ~PartitionFunction ()=default
 Virtual destructor.
 

Static Private Member Functions

static constexpr int make_key (const int z, const int a)
 

Private Attributes

quill::Logger * m_logger = fourdst::logging::LogManager::getInstance().getLogger("log")
 
std::unordered_map< int, double > m_ground_state_spin
 

Detailed Description

Partition function implementation for nuclear ground states.

Computes the partition function as (2J + 1) based on the ground state spin J of each isotope. The temperature derivative is always zero. Ground state spins are loaded from the fourdst::atomic::species registry at construction.

See also
partition_ground.cpp for implementation details.

Definition at line 22 of file partition_ground.h.

Constructor & Destructor Documentation

◆ GroundStatePartitionFunction()

gridfire::partition::GroundStatePartitionFunction::GroundStatePartitionFunction ( )
       @brief Construct and populate the ground state spin map.
  • * Loads spins for all isotopes from the atomic species registry into m_ground_state_spin.
    Precondition
    atomic::species registry is initialized and non-empty.
    Postcondition
    m_ground_state_spin contains entries for each isotope.

Definition at line 12 of file partition_ground.cpp.

Member Function Documentation

◆ clone()

std::unique_ptr< PartitionFunction > gridfire::partition::GroundStatePartitionFunction::clone ( ) const
inlineoverridevirtual
       @brief Create a deep copy of this partition function.
       @return Unique_ptr to a new GroundStatePartitionFunction cloned from this object.
       @post Caller owns the returned instance.

Implements gridfire::partition::PartitionFunction.

Definition at line 88 of file partition_ground.h.

◆ evaluate()

double gridfire::partition::GroundStatePartitionFunction::evaluate ( const int z,
const int a,
const double T9 ) const
overridevirtual
       @brief Evaluate the ground state partition function.
  • *
    Parameters
    zProton number (atomic number) of the isotope; must be >= 1.
    aMass number of the isotope; must be >= z.
    T9Temperature in units of 10^9 K; unused for ground state.
    Precondition
    supports(z,a) returns true.
    Postcondition
    No side effects.
    Returns
    Dimensionless partition function value = 2*spin + 1.
    Exceptions
    std::out_of_rangeIf the isotope key is not found in m_ground_state_spin.

Implements gridfire::partition::PartitionFunction.

Definition at line 18 of file partition_ground.cpp.

◆ evaluateDerivative()

double gridfire::partition::GroundStatePartitionFunction::evaluateDerivative ( const int z,
const int a,
const double T9 ) const
overridevirtual
       @brief Evaluate the temperature derivative of the ground state partition function.
  • * Always returns zero as ground state has no temperature dependence.
    Parameters
    zProton number of the isotope; must be supported.
    aMass number of the isotope; must be supported.
    T9Temperature in units of 10^9 K; unused.
    Precondition
    supports(z,a) returns true.
    Postcondition
    No side effects.
    Returns
    Zero.
    Exceptions
    std::out_of_rangeIf the isotope key is not found.

Implements gridfire::partition::PartitionFunction.

Definition at line 29 of file partition_ground.cpp.

◆ make_key()

int gridfire::partition::GroundStatePartitionFunction::make_key ( const int z,
const int a )
staticconstexprprivate
       @brief Generate a unique lookup key for an isotope.
  • * Combines atomic number z and mass number a into a single integer.
    Parameters
    zProton number of the isotope.
    aMass number of the isotope; should be < 1000 to avoid collisions.
    Precondition
    a < 1000.
    Returns
    Integer key = z * 1000 + a.

Definition at line 44 of file partition_ground.cpp.

◆ supports()

bool gridfire::partition::GroundStatePartitionFunction::supports ( const int z,
const int a ) const
overridevirtual
       @brief Check if ground state data exists for the given isotope.
  • *
    Parameters
    zProton number of the isotope.
    aMass number of the isotope.
    Returns
    True if m_ground_state_spin contains the key; false otherwise.
    Postcondition
    No side effects.

Implements gridfire::partition::PartitionFunction.

Definition at line 38 of file partition_ground.cpp.

◆ type()

std::string gridfire::partition::GroundStatePartitionFunction::type ( ) const
inlineoverridevirtual
       @brief Get the type identifier of this partition function.
       @return The string literal "GroundState".
       @post No side effects.

Implements gridfire::partition::PartitionFunction.

Definition at line 82 of file partition_ground.h.

Member Data Documentation

◆ m_ground_state_spin

std::unordered_map<int, double> gridfire::partition::GroundStatePartitionFunction::m_ground_state_spin
private

Definition at line 93 of file partition_ground.h.

◆ m_logger

quill::Logger* gridfire::partition::GroundStatePartitionFunction::m_logger = fourdst::logging::LogManager::getInstance().getLogger("log")
private

Definition at line 92 of file partition_ground.h.


The documentation for this class was generated from the following files: