|
| | 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, double mu_e) 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, double mu_e) const |
| | Finite-difference partial derivatives of the log10() fields.
|
| |
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.
| gridfire::rates::weak::WeakRateInterpolator::WeakRateInterpolator |
( |
const RowDataTable & | raw_data | ) |
|
|
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::expected< WeakRateDerivatives, InterpolationError > gridfire::rates::weak::WeakRateInterpolator::get_rate_derivatives |
( |
uint16_t | A, |
|
|
uint8_t | Z, |
|
|
double | t9, |
|
|
double | log_rhoYe, |
|
|
double | mu_e ) const |
|
nodiscard |
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.
- Parameters
-
| 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). |
| mu_e | Electron chemical potential (MeV). |
- Returns
- expected<WeakRateDerivatives, InterpolationError>: derivative payload on success; otherwise an InterpolationError as described above.
- Example
if (auto d = interp.get_rate_derivatives(52, 26, 3.0, 6.0, 2.0); d) {
}