Cantera  2.1.2
GRI30.h
Go to the documentation of this file.
1 //! @file GRI30.h
2 #ifndef CXX_GRI30H
3 #define CXX_GRI30H
4 
5 #include "thermo/IdealGasPhase.h"
8 #include "base/stringUtils.h"
9 
10 namespace Cantera
11 {
12 
13 /**
14  * This class is a convenience class for use in C++ programs that
15  * hard-wires the GRI 3.0 reaction mechanism. It derivees from
16  * both Cantera::IdealGasPhase, which handles all composition and
17  * state information, as well as thermodynamic properties, and
18  * class GRI_30_Kinetics, which is the kinetics manager with
19  * hard-wired replacements for some of the generic kinetics
20  * methods like "getNetReactionRates."
21  * @deprecated
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  bool operator!() {
37  return !m_ok;
38  }
39  bool ready() const {
40  return m_ok;
41  }
42  friend std::ostream& operator<<(std::ostream& s, GRI30& mix) {
43  std::string r = mix.report(true);
44  s << r;
45  return s;
46  }
47 
48 protected:
49  bool m_ok;
50  Cantera::XML_Node* m_r;
51 
52 private:
53 };
54 }
55 
56 
57 #endif
XML_Node * get_XML_File(const std::string &file, int debug)
Return a pointer to the XML tree for a Cantera input file.
Definition: global.cpp:144
Class IdealGasPhase represents low-density gases that obey the ideal gas equation of state...
Kinetics manager implementing reaction mechanism GRI-Mech 3.0.
Class XML_Node is a tree-based representation of the contents of an XML file.
Definition: xml.h:100
This class is a convenience class for use in C++ programs that hard-wires the GRI 3...
Definition: GRI30.h:23
bool buildSolutionFromXML(XML_Node &root, const std::string &id, const std::string &nm, ThermoPhase *th, Kinetics *k)
Build a single-phase ThermoPhase object with associated kinetics mechanism.
ThermoPhase object for the ideal gas equation of state - workhorse for Cantera (see Thermodynamic Pro...
bool ready() const
Returns true if the kinetics manager has been properly initialized and finalized. ...
Definition: GRI30.h:39
Base class for exceptions thrown by Cantera classes.
Definition: ctexceptions.h:68
virtual std::string report(bool show_thermo=true) const
returns a summary of the state of the phase as a string
Definitions of global routines for the importing of data from XML files (see Input File Handling)...
Contains declarations for string manipulation functions within Cantera.