fix(AtomicWeakRate): added bool overrides for sparsity calculations

these allow the atomic weak rate to be used with the current sparsity code. Note also that this commit reintroduces the full weak reaction set which does introduce an enormouse degree of stiffness which will need to be filtered out. What this means is that this commit practically cannot evolve a network due to this stiffness
This commit is contained in:
2025-10-31 07:38:04 -04:00
parent 1af54132b8
commit 56f9342052
4 changed files with 113 additions and 57 deletions

View File

@@ -473,6 +473,20 @@ namespace gridfire::rates::weak {
CppAD::vector<std::set<size_t>>& st
) override;
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:
const WeakRateInterpolator& m_interpolator;
const size_t m_a;
@@ -536,7 +550,7 @@ namespace gridfire::rates::weak {
T rateConstant = static_cast<T>(0.0);
if constexpr (std::is_same_v<T, CppAD::AD<double>>) { // Case where T is an AD type
std::vector<T> ax = {T9, log_rhoYe, mue};
std::vector<T> ax = {T9, log_rhoYe};
std::vector<T> ay(2);
m_atomic(ax, ay);
rateConstant = static_cast<T>(ay[0]);