GridFire 0.0.1a General Purpose Nuclear Network

Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
gridfire::partition::CompositePartitionFunction Class Referencefinal

Combines multiple PartitionFunction instances into a single composite strategy. More...

`#include <partition_composite.h>`

Inheritance diagram for gridfire::partition::CompositePartitionFunction:

## Public Member Functions
| CompositePartitionFunction (const std::vector< BasePartitionType > &partitionFunctions)
| CompositePartitionFunction (const CompositePartitionFunction &other)
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
std::unique_ptr< PartitionFunction > | clone () const override
Public Member Functions inherited from gridfire::partition::PartitionFunction
virtual | ~PartitionFunction ()=default
| Virtual destructor.

## Private Member Functions
std::unique_ptr< PartitionFunction > | selectPartitionFunction (const BasePartitionType type) const

## Private Attributes
quill::Logger * | m_logger = fourdst::logging::LogManager::getInstance().getLogger("log")
std::vector< std::unique_ptr< PartitionFunction > > | m_partitionFunctions
| Set of partition functions to use in the composite partition function.

## Detailed Description

Combines multiple PartitionFunction instances into a single composite strategy.

Maintains an ordered list of sub-functions and delegates evaluation and derivative calls to the first function that supports the requested isotope.

See partition_composite.cpp for details on sub-function selection and error logging.

Exceptions

  std::runtime_error | If no sub-function supports a given (z,a,T9) in evaluate or evaluateDerivative.

Definition at line 27 of file partition_composite.h.

## Constructor & Destructor Documentation

## ◆ CompositePartitionFunction() [1/2]

gridfire::partition::CompositePartitionFunction::CompositePartitionFunction | ( | const std::vector< BasePartitionType > & | partitionFunctions | ) |
| explicit

           @brief Construct a composite function from specified types.

           Instantiates sub-functions according to the order of types provided.
           @param partitionFunctions List of BasePartitionType identifiers for sub-functions.
           @pre partitionFunctions must not be empty.
           @post m_partitionFunctions contains instances matching each type.

Definition at line 11 of file partition_composite.cpp.

## ◆ CompositePartitionFunction() [2/2]

gridfire::partition::CompositePartitionFunction::CompositePartitionFunction | ( | const CompositePartitionFunction & | other | ) |

           @brief Copy constructor.

           Creates deep clones of the sub-functions in another composite.
           @param other Existing composite to copy from.
           @post m_partitionFunctions contains clones of other's sub-functions.

Definition at line 20 of file partition_composite.cpp.

## Member Function Documentation

## ◆ clone()

std::unique_ptr< PartitionFunction > gridfire::partition::CompositePartitionFunction::clone | ( |  | ) | const
| inline nodiscard override virtual

           @brief Clone this composite partition function.

           @return Unique pointer to a deep copy of this object.

Implements gridfire::partition::PartitionFunction.

Definition at line 88 of file partition_composite.h.

## ◆ evaluate()

double gridfire::partition::CompositePartitionFunction::evaluate | ( | int | z,
|  | int | a,
|  | double | T9 ) const
| nodiscard override virtual

           @brief Evaluate the composite partition function.

           Calls evaluate on the first sub-function supporting the isotope.
           @param z Atomic number (>=1).
           @param a Mass number (>=z).
           @param T9 Temperature in 10^9 K.
           @return Partition function value from supporting sub-function.
           @throws std::runtime_error If no sub-function supports (z,a,T9).

Implements gridfire::partition::PartitionFunction.

Definition at line 27 of file partition_composite.cpp.

## ◆ evaluateDerivative()

double gridfire::partition::CompositePartitionFunction::evaluateDerivative | ( | int | z,
|  | int | a,
|  | double | T9 ) const
| nodiscard override virtual

           @brief Evaluate temperature derivative of the composite function.

           Delegates to the first supporting sub-function's derivative.
           @param z Atomic number.
           @param a Mass number.
           @param T9 Temperature in 10^9 K.
           @return d/dT9 of the partition function.
           @throws std::runtime_error If no sub-function supports (z,a,T9).

Implements gridfire::partition::PartitionFunction.

Definition at line 48 of file partition_composite.cpp.

## ◆ selectPartitionFunction()

std::unique_ptr< PartitionFunction > gridfire::partition::CompositePartitionFunction::selectPartitionFunction | ( | const BasePartitionType | type | ) | const
| private

           @brief Instantiate a sub-function by its type.

           @param type Enumeration value selecting the desired function implementation.
           @return Unique pointer to a new PartitionFunction instance of the given type.
           @throws std::runtime_error If the given type is not recognized.

Definition at line 92 of file partition_composite.cpp.

## ◆ supports()

bool gridfire::partition::CompositePartitionFunction::supports | ( | int | z,
|  | int | a ) const
| nodiscard override virtual

           @brief Check support across all sub-functions.

           @param z Atomic number.
           @param a Mass number.
           @return true if any sub-function supports (z,a); false otherwise.

Implements gridfire::partition::PartitionFunction.

Definition at line 66 of file partition_composite.cpp.

## ◆ type()

std::string gridfire::partition::CompositePartitionFunction::type | ( |  | ) | const
| nodiscard override virtual

           @brief Get composite type identifier.

           Concatenates the type() strings of all sub-functions.
           @return A string like "CompositePartitionFunction(func1, func2, ...)".

Implements gridfire::partition::PartitionFunction.

Definition at line 76 of file partition_composite.cpp.

## Member Data Documentation

## ◆ m_logger

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

Definition at line 92 of file partition_composite.h.

## ◆ m_partitionFunctions

std::vector<std::unique_ptr<PartitionFunction> > gridfire::partition::CompositePartitionFunction::m_partitionFunctions
| private

Set of partition functions to use in the composite partition function.

Definition at line 93 of file partition_composite.h.

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

- src/include/gridfire/partition/composite/partition_composite.h
- src/lib/partition/composite/partition_composite.cpp