GridFire 0.6.0 General Purpose Nuclear Network

Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
gridfire::rates::weak::WeakReactionMap Class Reference

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

`#include <weak.h>`

## Public Member Functions
| WeakReactionMap ()
| Construct the map by loading all weak reaction entries.
| ~WeakReactionMap ()=default
std::vector< WeakReactionEntry > | get_all_reactions () const
| Return a flat list of all weak reaction entries.
std::expected< std::vector< WeakReactionEntry >, WeakMapError > | get_species_reactions (const fourdst::atomic::Species &species) const
| Get all weak reaction entries for a given species.
std::expected< std::vector< WeakReactionEntry >, WeakMapError > | get_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
| nodiscard

Return a flat list of all weak reaction entries.

Returns
  Vector of WeakReactionEntry records.

Example
  WeakReactionMap map;
  auto all = map.get_all_reactions();
  // iterate or group as needed
  gridfire::rates::weak::WeakReactionMap::get_all_reactions
  std::vector< WeakReactionEntry > get_all_reactions() const
  Return a flat list of all weak reaction entries.
  Definition weak.cpp:133
  gridfire::rates::weak::WeakReactionMap::WeakReactionMap
  WeakReactionMap()
  Construct the map by loading all weak reaction entries.
  Definition weak.cpp:74

## ◆ get_species_reactions() [1/2]

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

Get all weak reaction entries for a given species.

Parameters

  species | Nuclide to query (A,Z).

Returns
  expected<vector<WeakReactionEntry>, WeakMapError> containing reactions on success or SPECIES_NOT_FOUND on failure.

Example
  using fourdst::atomic::Species;
  WeakReactionMap map;
  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
  }
  gridfire::rates::weak::WeakReactionMap::get_species_reactions
  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:141

## ◆ get_species_reactions() [2/2]

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

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

Parameters

  species_name | Symbolic name (e.g., "Fe52").

Returns
  expected<vector<WeakReactionEntry>, WeakMapError> containing reactions on success or SPECIES_NOT_FOUND on failure.

Example
  WeakReactionMap map;
  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:

- src/include/gridfire/reaction/weak/weak.h
- src/lib/reaction/weak/weak.cpp