Cantera  2.3.0
Edge.h
Go to the documentation of this file.
1 //! @file Edge.h
2 
3 // This file is part of Cantera. See License.txt in the top-level directory or
4 // at http://www.cantera.org/license.txt for license and copyright information.
5 
6 #ifndef CXX_EDGE
7 #define CXX_EDGE
8 
9 #include "thermo/ThermoFactory.h"
11 #include "kinetics/EdgeKinetics.h"
12 #include "thermo/EdgePhase.h"
13 
14 namespace Cantera
15 {
16 
17 //! Convenience class which inherits from both EdgePhase and EdgeKinetics
18 class Edge :
19  public EdgePhase, public EdgeKinetics
20 {
21 public:
22  Edge(const std::string& infile, std::string id, std::vector<ThermoPhase*> phases)
23  : m_ok(false), m_r(0)
24  {
25  m_r = get_XML_File(infile);
26  if (id == "-") {
27  id = "";
28  }
29 
30  XML_Node* x = get_XML_Node("#"+id, m_r);
31  if (!x) {
32  throw CanteraError("Edge::Edge","error in get_XML_Node");
33  }
34 
35  importPhase(*x, this);
36  phases.push_back(this);
37  importKinetics(*x, phases, this);
38  m_ok = true;
39  }
40 
41  bool operator!() {
42  return !m_ok;
43  }
44  bool ready() const {
45  return m_ok;
46  }
47 
48 protected:
49  bool m_ok;
50  XML_Node* m_r;
51 };
52 }
53 
54 #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
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:96
Headers for the factory class that can create known ThermoPhase objects (see Thermodynamic Properties...
Class XML_Node is a tree-based representation of the contents of an XML file.
Definition: xml.h:97
A thermodynamic phase representing a one dimensional edge between two surfaces.
Definition: EdgePhase.h:30
bool ready() const
Returns true if the kinetics manager has been properly initialized and finalized. ...
Definition: Edge.h:44
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:65
void importPhase(XML_Node &phase, ThermoPhase *th)
Import a phase information into an empty ThermoPhase object.
Convenience class which inherits from both EdgePhase and EdgeKinetics.
Definition: Edge.h:18
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:22
Namespace for the Cantera kernel.
Definition: application.cpp:29
Declarations for the EdgePhase ThermoPhase object, which models the interface between two surfaces (s...