GridFire v0.7.1_rc2
General Purpose Nuclear Network
Loading...
Searching...
No Matches
gridfire::reaction::WeakReaclibReaction Class Referencefinal

#include <reaction.h>

Inheritance diagram for gridfire::reaction::WeakReaclibReaction:
[legend]
Collaboration diagram for gridfire::reaction::WeakReaclibReaction:
[legend]

Public Member Functions

ReactionType type () const override
 Category of this reaction (e.g., REACLIB, WEAK, LOGICAL_REACLIB).
 
std::unique_ptr< Reactionclone () const override
 Polymorphic deep copy.
 
 ReaclibReaction (std::string_view id, std::string_view peName, int chapter, const std::vector< fourdst::atomic::Species > &reactants, const std::vector< fourdst::atomic::Species > &products, double qValue, std::string_view label, const RateCoefficientSet &sets, bool reverse=false)
 Constructs a Reaction object.
 
- Public Member Functions inherited from gridfire::reaction::ReaclibReaction
 ~ReaclibReaction () override=default
 
 ReaclibReaction (std::string_view id, std::string_view peName, int chapter, const std::vector< fourdst::atomic::Species > &reactants, const std::vector< fourdst::atomic::Species > &products, double qValue, std::string_view label, const RateCoefficientSet &sets, bool reverse=false)
 Constructs a Reaction object.
 
double calculate_rate (double T9, double rho, double Ye, double mue, const std::vector< double > &Y, const std::unordered_map< size_t, fourdst::atomic::Species > &index_to_species_map) const override
 Calculates the reaction rate for a given temperature.
 
CppAD::AD< double > calculate_rate (CppAD::AD< double > T9, CppAD::AD< double > rho, CppAD::AD< double > Ye, CppAD::AD< double > mue, const std::vector< CppAD::AD< double > > &Y, const std::unordered_map< size_t, fourdst::atomic::Species > &index_to_species_map) const override
 Calculates the reaction rate for a given temperature using CppAD types.
 
double calculate_log_rate_partial_deriv_wrt_T9 (double T9, double rho, double Ye, double mue, const fourdst::composition::Composition &comp) const override
 Logarithmic partial derivative of the rate with respect to temperature.
 
virtual std::string_view peName () const
 Gets the reaction name in (projectile, ejectile) notation.
 
int chapter () const
 Gets the REACLIB chapter number.
 
std::string_view sourceLabel () const
 Gets the source label for the rate data.
 
const RateCoefficientSetrateCoefficients () const
 Gets the set of rate coefficients.
 
std::optional< std::vector< RateCoefficientSet > > getRateCoefficients () const override
 
bool contains (const fourdst::atomic::Species &species) const override
 Checks if the reaction involves a given species as a reactant or product.
 
bool contains_reactant (const fourdst::atomic::Species &species) const override
 Checks if the reaction involves a given species as a reactant.
 
bool contains_product (const fourdst::atomic::Species &species) const override
 Checks if the reaction involves a given species as a product.
 
std::unordered_set< fourdst::atomic::Species > all_species () const override
 Gets a set of all unique species involved in the reaction.
 
std::unordered_set< fourdst::atomic::Species > reactant_species () const override
 Gets a set of all unique reactant species.
 
std::unordered_set< fourdst::atomic::Species > product_species () const override
 Gets a set of all unique product species.
 
size_t num_species () const override
 Gets the number of unique species involved in the reaction.
 
int stoichiometry (const fourdst::atomic::Species &species) const override
 Calculates the stoichiometric coefficient for a given species.
 
std::unordered_map< fourdst::atomic::Species, int > stoichiometry () const override
 Gets a map of all species to their stoichiometric coefficients.
 
std::string_view id () const override
 Gets the unique identifier of the reaction.
 
double qValue () const override
 Gets the Q-value of the reaction.
 
const std::vector< fourdst::atomic::Species > & reactants () const override
 Gets the vector of reactant species.
 
const std::vector< fourdst::atomic::Species > & products () const override
 Gets the vector of product species.
 
bool is_reverse () const override
 Checks if this is a reverse reaction rate.
 
double excess_energy () const
 Calculates the excess energy from the mass difference of reactants and products.
 
bool operator== (const ReaclibReaction &other) const
 Compares this reaction with another for equality based on their IDs.
 
bool operator!= (const ReaclibReaction &other) const
 Compares this reaction with another for inequality.
 
uint64_t hash (uint64_t seed) const override
 Computes a hash for the reaction based on its ID.
 
size_t countReactantOccurrences (const fourdst::atomic::Species &species) const override
 
size_t countProductOccurrences (const fourdst::atomic::Species &species) const override
 
- Public Member Functions inherited from gridfire::reaction::Reaction
virtual ~Reaction ()=default
 Virtual destructor for correct polymorphic cleanup.
 
virtual double calculate_energy_generation_rate (const double T9, const double rho, const double Ye, double mue, const std::vector< double > &Y, const std::unordered_map< size_t, fourdst::atomic::Species > &index_to_species_map) const
 Convenience: energy generation rate from this reaction (double version).
 
virtual CppAD::AD< double > calculate_energy_generation_rate (const CppAD::AD< double > &T9, const CppAD::AD< double > &rho, const CppAD::AD< double > &Ye, const CppAD::AD< double > &mue, const std::vector< CppAD::AD< double > > &Y, const std::unordered_map< size_t, fourdst::atomic::Species > &index_to_species_map) const
 Convenience: AD-enabled energy generation rate (AD version).
 

Additional Inherited Members

- Protected Attributes inherited from gridfire::reaction::ReaclibReaction
quill::Logger * m_logger = fourdst::logging::LogManager::getInstance().getLogger("log")
 
std::string m_id
 Unique identifier for the reaction (e.g., "h1+h1=>h2+e+nu").
 
std::string m_peName
 Name of the reaction in (projectile, ejectile) notation (e.g. "p(p,g)d").
 
int m_chapter
 Chapter number from the REACLIB database, defining the reaction structure.
 
double m_qValue = 0.0
 Q-value of the reaction in MeV.
 
std::unordered_map< fourdst::atomic::Species, size_t > m_reactants
 Reactants of the reaction.
 
std::unordered_map< fourdst::atomic::Species, size_t > m_products
 Products of the reaction.
 
std::optional< std::vector< fourdst::atomic::Species > > m_reactantsVec
 
std::optional< std::vector< fourdst::atomic::Species > > m_productsVec
 
std::string m_sourceLabel
 Source label for the rate data (e.g., "wc12w", "st08").
 
RateCoefficientSet m_rateCoefficients
 The seven rate coefficients.
 
bool m_reverse = false
 Flag indicating if this is a reverse reaction rate.
 

Member Function Documentation

◆ clone()

std::unique_ptr< Reaction > gridfire::reaction::WeakReaclibReaction::clone ( ) const
inlineoverridevirtual

Polymorphic deep copy.

Returns
A std::unique_ptr owning a new Reaction equal to this one.

Reimplemented from gridfire::reaction::ReaclibReaction.

◆ ReaclibReaction()

gridfire::reaction::ReaclibReaction::ReaclibReaction ( std::string_view  id,
std::string_view  peName,
int  chapter,
const std::vector< fourdst::atomic::Species > &  reactants,
const std::vector< fourdst::atomic::Species > &  products,
double  qValue,
std::string_view  label,
const RateCoefficientSet sets,
bool  reverse = false 
)

Constructs a Reaction object.

Parameters
idA unique identifier for the reaction.
peNameThe name in (projectile, ejectile) notation (e.g., "p(p,g)d").
chapterThe REACLIB chapter number, defining reaction structure.
reactantsA vector of reactant species.
productsA vector of product species.
qValueThe Q-value of the reaction in MeV.
labelThe sources label for the rate data (e.g., "wc12", "st08").
setsThe set of rate coefficients.
reverseTrue if this is a reverse reaction rate.

◆ type()

ReactionType gridfire::reaction::WeakReaclibReaction::type ( ) const
inlineoverridevirtual

Category of this reaction (e.g., REACLIB, WEAK, LOGICAL_REACLIB).

Returns
Enumerated reaction type for runtime dispatch and filtering.

Reimplemented from gridfire::reaction::ReaclibReaction.


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