Cantera  2.1.2
Edge.h
Go to the documentation of this file.
1 //! @file Edge.h
2 #ifndef CXX_EDGE
3 #define CXX_EDGE
4 
5 #include "thermo.h"
8 
9 namespace Cantera
10 {
11 
12 class Edge :
13  public EdgePhase, public EdgeKinetics
14 {
15 public:
16  Edge(const std::string& infile, std::string id, std::vector<ThermoPhase*> phases)
17  : m_ok(false), m_r(0) {
18 
19  m_r = get_XML_File(infile);
20  if (id == "-") {
21  id = "";
22  }
23 
24  XML_Node* x = get_XML_Node("#"+id, m_r);
25  if (!x) {
26  throw CanteraError("Edge","error in get_XML_Node");
27  }
28 
29  importPhase(*x, this);
30  phases.push_back(this);
31  importKinetics(*x, phases, this);
32  m_ok = true;
33  }
34 
35  bool operator!() {
36  return !m_ok;
37  }
38  bool ready() const {
39  return m_ok;
40  }
41 
42 protected:
43  bool m_ok;
44  XML_Node* m_r;
45 
46 private:
47 };
48 }
49 
50 
51 #endif
XML_Node * get_XML_Node(const std::string &file_ID, XML_Node *root)
This routine will locate an XML node in either the input XML tree or in another input file specified ...
Definition: global.cpp:249
Support for thermo property calculation from C++ application programs.
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
bool importPhase(XML_Node &phase, ThermoPhase *th, SpeciesThermoFactory *spfactory)
Import a phase information into an empty thermophase object.
bool importKinetics(const XML_Node &phase, std::vector< ThermoPhase * > th, Kinetics *k)
Import a reaction mechanism for a phase or an interface.
Definitions of global routines for the importing of data from XML files (see Input File Handling)...