GridFire v0.7.1_rc2
General Purpose Nuclear Network
Loading...
Searching...
No Matches
gridfire::rates::weak::WeakReactionMap Class Reference

Index of available weak reactions keyed by species. More...

#include <weak.h>

Collaboration diagram for gridfire::rates::weak::WeakReactionMap:
[legend]

Public Member Functions

 WeakReactionMap ()
 Construct the map by loading all weak reaction entries.
 
 ~WeakReactionMap ()=default
 
std::vector< WeakReactionEntryget_all_reactions () const
 Return a flat list of all weak reaction entries.
 
std::expected< std::vector< WeakReactionEntry >, WeakMapErrorget_species_reactions (const fourdst::atomic::Species &species) const
 Get all weak reaction entries for a given species.
 
std::expected< std::vector< WeakReactionEntry >, WeakMapErrorget_species_reactions (const std::string &species_name) const
 Get all weak reaction entries for a given species by name.
 

Private Attributes

std::unordered_map< fourdst::atomic::Species, std::vector< WeakReactionEntry > > m_weak_network
 

Detailed Description

Index of available weak reactions keyed by species.

Builds an in-memory map from the compiled weak-rate tables and provides simple query helpers to retrieve all weak reactions or those that involve a particular nuclide.

Implementation summary: the constructor iterates over UNIFIED_WEAK_DATA and inserts entries keyed by the parent Species. For each channel (β−, β+, e−-capture, e+-capture), if the tabulated log10(rate) is above the sentinel (-60), a WeakReactionEntry is pushed containing the grids t9, log10(rho*Ye), mu_e, the log10(rate), and the corresponding log10(neutrino loss) column.

Constructor & Destructor Documentation

◆ WeakReactionMap()

gridfire::rates::weak::WeakReactionMap::WeakReactionMap ( )

Construct the map by loading all weak reaction entries.

Postcondition
All valid reactions from the compiled data are available via get_all_reactions() and get_species_reactions(). Implementation: iterates UNIFIED_WEAK_DATA, filters any log(rate) <= -60, and groups entries by parent Species.

◆ ~WeakReactionMap()

gridfire::rates::weak::WeakReactionMap::~WeakReactionMap ( )
default

Member Function Documentation

◆ get_all_reactions()

std::vector< WeakReactionEntry > gridfire::rates::weak::WeakReactionMap::get_all_reactions ( ) const

Return a flat list of all weak reaction entries.

Returns
Vector of WeakReactionEntry records.
Example
auto all = map.get_all_reactions();
// iterate or group as needed
Index of available weak reactions keyed by species.
Definition weak.h:41
std::vector< WeakReactionEntry > get_all_reactions() const
Return a flat list of all weak reaction entries.
Definition weak.cpp:166

◆ get_species_reactions() [1/2]

std::expected< std::vector< WeakReactionEntry >, WeakMapError > gridfire::rates::weak::WeakReactionMap::get_species_reactions ( const fourdst::atomic::Species &  species) const

Get all weak reaction entries for a given species.

Parameters
speciesNuclide to query (A,Z).
Returns
expected<vector<WeakReactionEntry>, WeakMapError> containing reactions on success or SPECIES_NOT_FOUND on failure.
Example
using fourdst::atomic::Species;
Species fe52 = fourdst::atomic::az_to_species(52, 26);
if (auto res = map.get_species_reactions(fe52); res) {
for (const auto& e : *res) { } // use e
} else {
// handle WeakMapError::SPECIES_NOT_FOUND
}
std::expected< std::vector< WeakReactionEntry >, WeakMapError > get_species_reactions(const fourdst::atomic::Species &species) const
Get all weak reaction entries for a given species.
Definition weak.cpp:174

◆ get_species_reactions() [2/2]

std::expected< std::vector< WeakReactionEntry >, WeakMapError > gridfire::rates::weak::WeakReactionMap::get_species_reactions ( const std::string &  species_name) const

Get all weak reaction entries for a given species by name.

Parameters
species_nameSymbolic name (e.g., "Fe52").
Returns
expected<vector<WeakReactionEntry>, WeakMapError> containing reactions on success or SPECIES_NOT_FOUND on failure.
Example
if (auto res = map.get_species_reactions("Fe52"); res) {
// use *res
}

Member Data Documentation

◆ m_weak_network

std::unordered_map<fourdst::atomic::Species, std::vector<WeakReactionEntry> > gridfire::rates::weak::WeakReactionMap::m_weak_network
private

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