11#ifndef CT_FALLOFFMGR_H
12#define CT_FALLOFFMGR_H
45 void install(
size_t rxn,
int reactionType, shared_ptr<Falloff> f) {
47 "To be removed after Cantera 2.6. Specify reaction type using "
51 m_offset.push_back(m_worksize);
52 m_worksize += f->workSize();
53 m_falloff.push_back(f);
65 void install(
size_t rxn, std::string type, shared_ptr<Falloff> f) {
67 m_offset.push_back(m_worksize);
68 m_worksize += f->workSize();
69 m_falloff.push_back(f);
80 void replace(
size_t rxn, shared_ptr<Falloff> f) {
96 for (
size_t i = 0; i < m_rxn.size(); i++) {
97 m_falloff[i]->updateTemp(t, work + m_offset[i]);
106 for (
size_t i = 0; i < m_rxn.size(); i++) {
107 double pr = values[m_rxn[i]];
111 m_falloff[i]->F(pr, work + m_offset[i]) / (1.0 + pr);
115 m_falloff[i]->F(pr, work + m_offset[i]) / (1.0 + pr);
121 std::vector<size_t> m_rxn;
122 std::vector<shared_ptr<Falloff> > m_falloff;
124 std::vector<vector_fp::difference_type> m_offset;
A falloff manager that implements any set of falloff functions.
size_t workSize()
Size of the work array required to store intermediate results.
void install(size_t rxn, std::string type, shared_ptr< Falloff > f)
Install a new falloff function calculator.
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)
std::vector< bool > m_isfalloff
Distinguish between falloff and chemically activated reactions.
void updateTemp(doublereal t, doublereal *work)
Update the cached temperature-dependent intermediate results for all installed falloff functions.
This file contains definitions for utility functions and text for modules, inputfiles,...
Namespace for the Cantera kernel.
void warn_deprecated(const std::string &source, const AnyBase &node, const std::string &message)
A deprecation warning for syntax in an input file.
std::vector< int > vector_int
Vector of ints.
const int FALLOFF_RXN
The general form for a gas-phase association or dissociation reaction, with a pressure-dependent rate...