GridFire v0.7.1_rc2 General Purpose Nuclear Network

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

CppAD atomic that wraps weak-rate interpolation for AD evaluation. More...

Inheritance diagram for gridfire::rates::weak::WeakReaction::AtomicWeakRate:
[legend]
Collaboration diagram for gridfire::rates::weak::WeakReaction::AtomicWeakRate:
[legend]

## Public Member Functions
| AtomicWeakRate (const WeakRateInterpolator &interpolator, const size_t a, const size_t z, const WeakReactionType type)
| Construct the atomic operation for a specific (A,Z) and channel.
bool | forward (size_t p, size_t q, const CppAD::vector< bool > &vx, CppAD::vector< bool > &vy, const CppAD::vector< double > &tx, CppAD::vector< double > &ty) override
| Forward pass: compute rate and neutrino-loss values for AD. On failure to interpolate, throws a std::runtime_error with details; sets output sparsity such that both outputs depend on all inputs when any input is variable.
bool | reverse (size_t q, const CppAD::vector< double > &tx, const CppAD::vector< double > &ty, CppAD::vector< double > &px, const CppAD::vector< double > &py) override
| Reverse pass: propagate adjoints using tabulated derivatives. Uses d log10 columns, converting to linear-scale derivatives via ln(10) scaling and chain rule with the forward-pass outputs.
bool | for_sparse_jac (size_t q, const CppAD::vector< std::set< size_t > > &r, CppAD::vector< std::set< size_t > > &s) override
| Forward-mode sparsity for Jacobian.
bool | rev_sparse_jac (size_t q, const CppAD::vector< std::set< size_t > > &rt, CppAD::vector< std::set< size_t > > &st) override
| Reverse-mode sparsity for Jacobian.
bool | for_sparse_jac (size_t q, const CppAD::vector< bool > &r, CppAD::vector< bool > &s, const CppAD::vector< double > &x) override
bool | rev_sparse_jac (size_t q, const CppAD::vector< bool > &rt, CppAD::vector< bool > &st, const CppAD::vector< double > &x) override

## Private Attributes
const WeakRateInterpolator & | m_interpolator
const size_t | m_a
const size_t | m_z
const WeakReactionType | m_type

## Detailed Description

CppAD atomic that wraps weak-rate interpolation for AD evaluation.

Forward pass computes two outputs (λ, ν_loss) by interpolating the tables at the provided state; reverse pass uses derivative tables to backpropagate adjoints for all three inputs (T9, log10(rho*Ye), μe). Sparsity routines declare full dependence of both outputs on all inputs.

## Constructor & Destructor Documentation

## ◆ AtomicWeakRate()

gridfire::rates::weak::WeakReaction::AtomicWeakRate::AtomicWeakRate | ( | const WeakRateInterpolator & | interpolator,
|  | const size_t | a,
|  | const size_t | z,
|  | const WeakReactionType | type
| ) |  |
| inline

Construct the atomic operation for a specific (A,Z) and channel.

Parameters

  interpolator | Rate source.
  a | Mass number A of the parent.
  z | Proton number Z of the parent.
  type | Weak channel.

## Member Function Documentation

## ◆ for_sparse_jac() [1/2]

bool gridfire::rates::weak::WeakReaction::AtomicWeakRate::for_sparse_jac | ( | size_t | q,
|  | const CppAD::vector< bool > & | r,
|  | CppAD::vector< bool > & | s,
|  | const CppAD::vector< double > & | x
| ) |  |
| override

## ◆ for_sparse_jac() [2/2]

bool gridfire::rates::weak::WeakReaction::AtomicWeakRate::for_sparse_jac | ( | size_t | q,
|  | const CppAD::vector< std::set< size_t > > & | r,
|  | CppAD::vector< std::set< size_t > > & | s
| ) |  |
| override

Forward-mode sparsity for Jacobian.

## ◆ forward()

bool gridfire::rates::weak::WeakReaction::AtomicWeakRate::forward | ( | size_t | p,
|  | size_t | q,
|  | const CppAD::vector< bool > & | vx,
|  | CppAD::vector< bool > & | vy,
|  | const CppAD::vector< double > & | tx,
|  | CppAD::vector< double > & | ty
| ) |  |
| override

Forward pass: compute rate and neutrino-loss values for AD. On failure to interpolate, throws a std::runtime_error with details; sets output sparsity such that both outputs depend on all inputs when any input is variable.

## ◆ rev_sparse_jac() [1/2]

bool gridfire::rates::weak::WeakReaction::AtomicWeakRate::rev_sparse_jac | ( | size_t | q,
|  | const CppAD::vector< bool > & | rt,
|  | CppAD::vector< bool > & | st,
|  | const CppAD::vector< double > & | x
| ) |  |
| override

## ◆ rev_sparse_jac() [2/2]

bool gridfire::rates::weak::WeakReaction::AtomicWeakRate::rev_sparse_jac | ( | size_t | q,
|  | const CppAD::vector< std::set< size_t > > & | rt,
|  | CppAD::vector< std::set< size_t > > & | st
| ) |  |
| override

Reverse-mode sparsity for Jacobian.

## ◆ reverse()

bool gridfire::rates::weak::WeakReaction::AtomicWeakRate::reverse | ( | size_t | q,
|  | const CppAD::vector< double > & | tx,
|  | const CppAD::vector< double > & | ty,
|  | CppAD::vector< double > & | px,
|  | const CppAD::vector< double > & | py
| ) |  |
| override

Reverse pass: propagate adjoints using tabulated derivatives. Uses d log10 columns, converting to linear-scale derivatives via ln(10) scaling and chain rule with the forward-pass outputs.

## Member Data Documentation

## ◆ m_a

const size_t gridfire::rates::weak::WeakReaction::AtomicWeakRate::m_a
| private

## ◆ m_interpolator

const WeakRateInterpolator& gridfire::rates::weak::WeakReaction::AtomicWeakRate::m_interpolator
| private

## ◆ m_type

const WeakReactionType gridfire::rates::weak::WeakReaction::AtomicWeakRate::m_type
| private

## ◆ m_z

const size_t gridfire::rates::weak::WeakReaction::AtomicWeakRate::m_z
| 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