Cantera  2.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Enhanced3BConc.h
Go to the documentation of this file.
1 /**
2  * @file Enhanced3BConc.h
3  */
4 // Copyright 2001 California Institute of Technology
5 
6 
7 #ifndef CT_ENH_CONC_H
8 #define CT_ENH_CONC_H
9 
10 #include "cantera/base/ct_defs.h"
11 #include "cantera/base/global.h"
12 
13 namespace Cantera
14 {
15 
16 /**
17  * Computes enhanced third-body concentrations.
18  * @deprecated Replaced by ThirdBodyCalc. To be removed after Cantera 2.2.
19  * @see GasKinetics
20  */
22 {
23 
24 public:
25 
26  Enhanced3BConc() : m_deflt(1.0) {
27  warn_deprecated("class Enhanced3BConc",
28  "To be removed after Cantera 2.2.");
29  }
30 
31  Enhanced3BConc(const std::map<size_t, doublereal>& enhanced,
32  doublereal deflt = 1.0) {
33  warn_deprecated("class Enhanced3BConc",
34  "To be removed after Cantera 2.2.");
35  std::map<size_t, doublereal>::const_iterator iter;
36  for (iter = enhanced.begin(); iter != enhanced.end(); ++iter) {
37  m_index.push_back(iter->first);
38  m_eff.push_back(iter->second - deflt);
39  }
40  m_deflt = deflt;
41  }
42 
43  doublereal update(const vector_fp& c, doublereal ctot) const {
44  doublereal sum = 0.0;
45  for (size_t i = 0; i < m_eff.size(); i++) {
46  sum += m_eff[i] * c[m_index[i]];
47  }
48  return m_deflt * ctot + sum;
49  }
50 
51  void getEfficiencies(vector_fp& eff) const {
52  for (size_t i = 0; i < m_eff.size(); i++) {
53  eff[m_index[i]] = m_eff[i] + m_deflt;
54  }
55  }
56 
57 private:
58  std::vector<size_t> m_index;
59  vector_fp m_eff;
60  doublereal m_deflt;
61 };
62 
63 }
64 
65 #endif
This file contains definitions of terms that are used in internal routines and are unlikely to need m...
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
Definition: global.cpp:78
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).
Computes enhanced third-body concentrations.
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