Cantera  2.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ThirdBodyMgr.h
Go to the documentation of this file.
1 /**
2  * @file ThirdBodyMgr.h
3  */
4 
5 // Copyright 2001 California Institute of Technology
6 
7 
8 #ifndef CT_THIRDBODY_MGR_H
9 #define CT_THIRDBODY_MGR_H
10 
11 #include "cantera/base/utilities.h"
12 #include "Enhanced3BConc.h"
13 
14 
15 namespace Cantera
16 {
17 
18 //! @deprecated Replaced by ThirdBodyCalc. To be removed after Cantera 2.2.
19 template<class _E>
21 {
22 
23 public:
24  ThirdBodyMgr() {
25  warn_deprecated("class ThirdBodyMgr", "To be removed after Cantera 2.2.");
26  }
27 
28  void install(size_t rxnNumber, const std::map<size_t, doublereal>& enhanced,
29  doublereal dflt=1.0) {
30  m_reaction_index.push_back(rxnNumber);
31  m_concm.push_back(_E(enhanced, dflt));
32  }
33 
34  void update(const vector_fp& conc, doublereal ctot, doublereal* work) {
35  typename std::vector<_E>::const_iterator b = m_concm.begin();
36  for (; b != m_concm.end(); ++b, ++work) {
37  *work = b->update(conc, ctot);
38  }
39  }
40 
41  void multiply(doublereal* output, const doublereal* work) {
42  scatter_mult(work, work + m_reaction_index.size(),
43  output, m_reaction_index.begin());
44  }
45 
46  size_t workSize() {
47  return m_concm.size();
48  }
49  bool contains(int rxnNumber) {
50  return (find(m_reaction_index.begin(),
51  m_reaction_index.end(), rxnNumber)
52  != m_reaction_index.end());
53  }
54 
55 protected:
56  std::vector<size_t> m_reaction_index;
57  std::vector<_E> m_concm;
58 };
59 
60 }
61 
62 #endif
Various templated functions that carry out common vector operations (see Templated Utility Functions)...
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
Definition: global.cpp:78
void scatter_mult(InputIter mult_begin, InputIter mult_end, RandAccessIter data, IndexIter index)
Multiply selected elements in an array by a contiguous sequence of multipliers.
Definition: utilities.h:475
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
Definition: ct_defs.h:157