7 #ifndef CT_RATECOEFF_MGR_H
8 #define CT_RATECOEFF_MGR_H
38 size_t install(
size_t rxnNumber,
const ReactionData& rdata) {
43 if (rdata.rateCoeffType != R::type())
45 "incorrect rate coefficient type: "+
int2str(rdata.rateCoeffType) +
". Was Expecting type: "+
int2str(R::type()));
48 m_rxn.push_back(rxnNumber);
49 m_rates.push_back(R(rdata));
50 return m_rates.size() - 1;
74 typename std::vector<R>::iterator b = m_rates.begin();
75 typename std::vector<R>::iterator e = m_rates.end();
77 for (; b != e; ++b, ++i) {
90 void update(doublereal T, doublereal logT, doublereal* values) {
91 typename std::vector<R>::const_iterator b = m_rates.begin();
92 typename std::vector<R>::const_iterator e = m_rates.end();
93 doublereal recipT = 1.0/T;
95 for (; b != e; ++b, ++i) {
97 values[m_rxn[i]] = b->updateRC(logT, recipT);
101 void writeUpdate(std::ostream& output1, std::string key) {
105 size_t nReactions()
const {
106 return m_rates.size();
110 std::vector<R> m_rates;
111 std::vector<size_t> m_rxn;
121 template<
class R1,
class R2>
129 int install(
size_t rxnNumber,
int rateType,
size_t m,
130 const doublereal* c) {
131 if (rateType == R1::type()) {
132 return m_r1.
install(rxnNumber, rateType, m, c);
133 }
else if (rateType == R2::type()) {
134 return m_r2.
install(rxnNumber, rateType, m, c);
137 "unknown rate coefficient type");
141 void update(doublereal T, doublereal logT,
142 doublereal* values) {
143 m_r1.
update(T, logT, values);
144 m_r2.
update(T, logT, values);