fix(SERiF): added cppad_dep to methods which need it (anything that brings in reaclib.h)

This commit is contained in:
2025-06-19 15:07:06 -04:00
parent c3ff2420e9
commit cd5a6b200b
2 changed files with 10 additions and 6 deletions

View File

@@ -7,6 +7,8 @@
#include <unordered_map> #include <unordered_map>
#include "atomicSpecies.h" #include "atomicSpecies.h"
#include "cppad/cppad.hpp"
namespace serif::network::reaclib { namespace serif::network::reaclib {
/** /**
* @struct RateFitSet * @struct RateFitSet
@@ -70,16 +72,17 @@ namespace serif::network::reaclib {
m_rateSets(sets), m_rateSets(sets),
m_reverse(reverse) {} m_reverse(reverse) {}
[[nodiscard]] double calculate_rate(const double T9) const { template <typename GeneralScalarType>
const double T913 = std::pow(T9, 1.0/3.0); [[nodiscard]] GeneralScalarType calculate_rate(const GeneralScalarType T9) const {
const double rateExponent = m_rateSets.a0 + const GeneralScalarType T913 = CppAD::pow(T9, 1.0/3.0);
const GeneralScalarType rateExponent = m_rateSets.a0 +
m_rateSets.a1 / T9 + m_rateSets.a1 / T9 +
m_rateSets.a2 / T913 + m_rateSets.a2 / T913 +
m_rateSets.a3 * T913 + m_rateSets.a3 * T913 +
m_rateSets.a4 * T9 + m_rateSets.a4 * T9 +
m_rateSets.a5 * std::pow(T9, 5.0/3.0) + m_rateSets.a5 * CppAD::pow(T9, 5.0/3.0) +
m_rateSets.a6 * std::log(T9); m_rateSets.a6 * CppAD::log(T9);
return std::exp(rateExponent); return CppAD::exp(rateExponent);
} }
[[nodiscard]] const std::string& id() const { return m_id; } [[nodiscard]] const std::string& id() const { return m_id; }

View File

@@ -21,6 +21,7 @@ dependencies = [
species_weight_dep, species_weight_dep,
composition_dep, composition_dep,
reaclib_reactions_dep, reaclib_reactions_dep,
cppad_dep,
] ]
# Define the libnetwork library so it can be linked against by other parts of the build system # Define the libnetwork library so it can be linked against by other parts of the build system