perf(EigenFunctor): Jacobian Cachine
FOr QSE solving the Jacobian does not change meaninfully between steps. We have introduced caching so that it does not need to be reevaluated every step
This commit is contained in:
@@ -670,6 +670,8 @@ namespace gridfire {
|
||||
*/
|
||||
const std::unordered_map<fourdst::atomic::Species, size_t> m_qse_solve_species_index_map;
|
||||
|
||||
mutable std::optional<JacobianType> m_cached_jacobian = std::nullopt;
|
||||
|
||||
/**
|
||||
* @brief Constructs an EigenFunctor.
|
||||
*
|
||||
|
||||
@@ -1091,7 +1091,8 @@ namespace gridfire {
|
||||
const double rho
|
||||
) const {
|
||||
const fourdst::composition::Composition result = m_baseEngine.collectComposition(comp, T9, rho);
|
||||
fourdst::composition::Composition qseComposition = solveQSEAbundances(result, T9, rho);
|
||||
|
||||
fourdst::composition::Composition qseComposition = getNormalizedEquilibratedComposition(result, T9, rho);
|
||||
|
||||
return qseComposition;
|
||||
}
|
||||
@@ -1903,6 +1904,8 @@ namespace gridfire {
|
||||
}
|
||||
}
|
||||
|
||||
m_cached_jacobian = J_qse; // Cache the computed Jacobian for future use
|
||||
|
||||
return 0; // Success
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user