7 #ifndef CT_FALLOFFMGR_H
8 #define CT_FALLOFFMGR_H
43 void install(
size_t rxn,
int falloffType,
int reactionType,
45 warn_deprecated(
"FalloffMgr::install(size_t, int, int, const vector_fp&)",
46 "Use install(size_t, int, shared_ptr<Falloff>). To be removed after Cantera 2.2.");
47 shared_ptr<Falloff> f(m_factory->
newFalloff(falloffType,c));
58 void install(
size_t rxn,
int reactionType, shared_ptr<Falloff> f) {
60 m_offset.push_back(m_worksize);
61 m_worksize += f->workSize();
62 m_falloff.push_back(f);
73 void replace(
size_t rxn, shared_ptr<Falloff> f) {
89 for (
size_t i = 0; i < m_rxn.size(); i++) {
90 m_falloff[i]->updateTemp(t, work + m_offset[i]);
99 for (
size_t i = 0; i < m_rxn.size(); i++) {
100 double pr = values[m_rxn[i]];
104 m_falloff[i]->F(pr, work + m_offset[i]) /(1.0 + pr);
108 m_falloff[i]->F(pr, work + m_offset[i]) /(1.0 + pr);
114 std::vector<size_t> m_rxn;
115 std::vector<shared_ptr<Falloff> > m_falloff;
118 std::vector<vector_fp::difference_type> m_offset;
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...
A falloff manager that implements any set of falloff functions.
virtual Falloff * newFalloff(int type, const vector_fp &c)
Return a pointer to a new falloff function calculator.
void install(size_t rxn, int falloffType, int reactionType, const vector_fp &c)
Install a new falloff function calculator.
void replace(size_t rxn, shared_ptr< Falloff > f)
void install(size_t rxn, int reactionType, shared_ptr< Falloff > f)
Install a new falloff function calculator.
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
Parameterizations for reaction falloff functions.
This file contains definitions for utility functions and text for modules, inputfiles, logs, textlogs, (see Input File Handling, Diagnostic Output, and Writing messages to the screen).
void updateTemp(doublereal t, doublereal *work)
Update the cached temperature-dependent intermediate results for all installed falloff functions...
size_t workSize()
Size of the work array required to store intermediate results.
const int FALLOFF_RXN
The general form for a gas-phase association or dissociation reaction, with a pressure-dependent rate...
std::vector< int > vector_int
Vector of ints.
static FalloffFactory * factory()
Return a pointer to the factory.
This file defines some constants used to specify reaction types.
vector_int m_reactionType
Distinguish between falloff and chemically activated reactions.
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
Factory class to construct falloff function calculators.
std::map< size_t, size_t > m_indices
map of external reaction index to local index