Cantera  2.0
GRI30.h
1 #ifndef CXX_GRI30H
2 #define CXX_GRI30H
3 
4 #include <string>
5 
6 #include "thermo/IdealGasPhase.h"
9 #include "base/stringUtils.h"
10 
11 namespace Cantera
12 {
13 
14 /**
15  * This class is a convenience class for use in C++ programs that
16  * hard-wires the GRI 3.0 reaction mechanism. It derivees from
17  * both Cantera::IdealGasPhase, which handles all composition and
18  * state information, as well as thermodynamic properties, and
19  * class GRI_30_Kinetics, which is the kinetics manager with
20  * hard-wired replacements for some of the generic kinetics
21  * methods like "getNetReactionRates."
22  */
23 class GRI30 :
24  public IdealGasPhase,
25  public GRI_30_Kinetics
26 {
27 public:
28  GRI30() : m_ok(false), m_r(0) {
29  m_r = get_XML_File("gri30.xml");
30  m_ok = buildSolutionFromXML(*m_r, "gri30",
31  "phase", this, this);
32  if (!m_ok) throw CanteraError("GRI30",
33  "buildSolutionFromXML returned false");
34  }
35 
36  virtual ~GRI30() {}
37 
38  bool operator!() {
39  return !m_ok;
40  }
41  bool ready() const {
42  return m_ok;
43  }
44  friend std::ostream& operator<<(std::ostream& s, GRI30& mix) {
45  std::string r = mix.report(true);
46  s << r;
47  return s;
48  }
49 
50 protected:
51  bool m_ok;
52  Cantera::XML_Node* m_r;
53 
54 private:
55 };
56 }
57 
58 
59 #endif