Cantera  2.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 //! Convenience class which inherits from both EdgePhase and EdgeKinetics
13 class Edge :
14  public EdgePhase, public EdgeKinetics
15 {
16 public:
17  Edge(const std::string& infile, std::string id, std::vector<ThermoPhase*> phases)
18  : m_ok(false), m_r(0) {
19 
20  m_r = get_XML_File(infile);
21  if (id == "-") {
22  id = "";
23  }
24 
25  XML_Node* x = get_XML_Node("#"+id, m_r);
26  if (!x) {
27  throw CanteraError("Edge::Edge","error in get_XML_Node");
28  }
29 
30  importPhase(*x, this);
31  phases.push_back(this);
32  importKinetics(*x, phases, this);
33  m_ok = true;
34  }
35 
36  bool operator!() {
37  return !m_ok;
38  }
39  bool ready() const {
40  return m_ok;
41  }
42 
43 protected:
44  bool m_ok;
45  XML_Node* m_r;
46 
47 private:
48 };
49 }
50 
51 
52 #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:214
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:105
Class XML_Node is a tree-based representation of the contents of an XML file.
Definition: xml.h:100
A thermodynamic phase representing a one dimensional edge between two surfaces.
Definition: EdgePhase.h:29
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.
Base class for exceptions thrown by Cantera classes.
Definition: ctexceptions.h:99
Convenience class which inherits from both EdgePhase and EdgeKinetics.
Definition: Edge.h:13
Definitions of global routines for the importing of data from XML files (see Input File Handling)...
Heterogeneous reactions at one-dimensional interfaces between multiple adjacent two-dimensional surfa...
Definition: EdgeKinetics.h:20
bool ready() const
Returns true if the kinetics manager has been properly initialized and finalized. ...
Definition: Edge.h:39