8 #ifndef CT_FALLOFFMGR_H
9 #define CT_FALLOFFMGR_H
39 void install(
size_t rxn,
int reactionType, shared_ptr<Falloff> f) {
41 m_offset.push_back(m_worksize);
42 m_worksize += f->workSize();
43 m_falloff.push_back(f);
54 void replace(
size_t rxn, shared_ptr<Falloff> f) {
70 for (
size_t i = 0; i < m_rxn.size(); i++) {
71 m_falloff[i]->updateTemp(t, work + m_offset[i]);
80 for (
size_t i = 0; i < m_rxn.size(); i++) {
81 double pr = values[m_rxn[i]];
85 m_falloff[i]->F(pr, work + m_offset[i]) /(1.0 + pr);
89 m_falloff[i]->F(pr, work + m_offset[i]) /(1.0 + pr);
95 std::vector<size_t> m_rxn;
96 std::vector<shared_ptr<Falloff> > m_falloff;
99 std::vector<vector_fp::difference_type> m_offset;
Parameterizations for reaction falloff functions.
Factory class to construct falloff function calculators.
static FalloffFactory * factory()
Return a pointer to the factory.
A falloff manager that implements any set of falloff functions.
size_t workSize()
Size of the work array required to store intermediate results.
std::map< size_t, size_t > m_indices
map of external reaction index to local index
void pr_to_falloff(doublereal *values, const doublereal *work)
Given a vector of reduced pressures for each falloff reaction, replace each entry by the value of the...
void install(size_t rxn, int reactionType, shared_ptr< Falloff > f)
Install a new falloff function calculator.
void replace(size_t rxn, shared_ptr< Falloff > f)
void updateTemp(doublereal t, doublereal *work)
Update the cached temperature-dependent intermediate results for all installed falloff functions.
vector_int m_reactionType
Distinguish between falloff and chemically activated reactions.
This file contains definitions for utility functions and text for modules, inputfiles,...
std::vector< int > vector_int
Vector of ints.
Namespace for the Cantera kernel.
const int FALLOFF_RXN
The general form for a gas-phase association or dissociation reaction, with a pressure-dependent rate...
This file defines some constants used to specify reaction types.