|
GridFire v0.7.1_rc2
General Purpose Nuclear Network
|
3D table interpolator for tabulated weak reaction data by isotope. More...
#include <weak_interpolator.h>
Public Types | |
| using | RowDataTable = std::array< RateDataRow, 77400 > |
| Raw weak-rate table type expected by the constructor. | |
Public Member Functions | |
| WeakRateInterpolator (const RowDataTable &raw_data) | |
| Construct the interpolator from raw weak-rate rows. | |
| std::vector< fourdst::atomic::Species > | available_isotopes () const |
| List isotopes for which tables are available. | |
| std::expected< WeakRatePayload, InterpolationError > | get_rates (uint16_t A, uint8_t Z, double t9, double log_rhoYe) const |
| Trilinear interpolation of weak-rate payload at a state. | |
| std::expected< WeakRateDerivatives, InterpolationError > | get_rate_derivatives (uint16_t A, uint8_t Z, double t9, double log_rhoYe) const |
| Finite-difference partial derivatives of the log10() fields. | |
Private Attributes | |
| quill::Logger * | m_logger = fourdst::logging::LogManager::getInstance().getLogger("log") |
| std::unordered_map< uint32_t, IsotopeGrid > | m_rate_table |
| Per-isotope grids over (T9, log10(rho*Ye), mu_e) with payloads at lattice nodes. | |
3D table interpolator for tabulated weak reaction data by isotope.
Builds per-isotope 3D grids over (T9, log10(rho*Ye), mu_e) and provides:
Implementation summary (constructor): rows are grouped by (A,Z), then each group's unique axis values are collected and sorted to form the three axes; the 3D payload array is populated at each lattice point with the 6 log10() fields from the raw table.
| using gridfire::rates::weak::WeakRateInterpolator::RowDataTable = std::array<RateDataRow, 77400> |
Raw weak-rate table type expected by the constructor.
The size must match the number of rows compiled into the weak-rate library.
|
explicit |
Construct the interpolator from raw weak-rate rows.
Groups rows by isotope (A,Z), extracts unique sorted axes for T9, log10(rho*Ye), and mu_e, and fills an internal regular grid with the log10(rate) and neutrino-loss payloads at each node. No interpolation occurs at construction time.
| std::vector< fourdst::atomic::Species > gridfire::rates::weak::WeakRateInterpolator::available_isotopes | ( | ) | const |
List isotopes for which tables are available.
| std::runtime_error | If any packed (A,Z) cannot be converted to Species. |
| std::expected< WeakRateDerivatives, InterpolationError > gridfire::rates::weak::WeakRateInterpolator::get_rate_derivatives | ( | uint16_t | A, |
| uint8_t | Z, | ||
| double | t9, | ||
| double | log_rhoYe | ||
| ) | const |
Finite-difference partial derivatives of the log10() fields.
Uses central differences with small fixed (1e-6) perturbations in each variable (T9, log10(rho*Ye), mu_e) and returns arrays of d(log10(field))/d(var) for all fields. If any perturbed state falls outside the table, returns a BOUNDS_ERROR with per-axis bounds; if the isotope is unknown, returns UNKNOWN_SPECIES_ERROR.
| A | Mass number of the isotope. |
| Z | Proton number of the isotope. |
| t9 | Temperature in GK (10^9 K). |
| log_rhoYe | Log10 of rho*Ye (cgs density times electron fraction). |
| std::expected< WeakRatePayload, InterpolationError > gridfire::rates::weak::WeakRateInterpolator::get_rates | ( | uint16_t | A, |
| uint8_t | Z, | ||
| double | t9, | ||
| double | log_rhoYe | ||
| ) | const |
Trilinear interpolation of weak-rate payload at a state.
Interpolates the 6 log10() fields (rates and neutrino losses) at the given state for the requested isotope. If the isotope is unknown or the state lies outside the tabulated ranges, returns an error via std::expected with detailed bounds info.
| A | Mass number of the isotope. |
| Z | Proton number of the isotope. |
| t9 | Temperature in GK (10^9 K). |
| log_rhoYe | Log10 of rho*Ye (cgs density times electron fraction). |
|
private |
|
private |
Per-isotope grids over (T9, log10(rho*Ye), mu_e) with payloads at lattice nodes.