Cantera  2.5.1
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 https://cantera.org/license.txt for license and copyright information.
5 
6 #ifndef CXX_EDGE
7 #define CXX_EDGE
8 
9 #pragma message("warning: Edge.h is deprecated and will be removed after Cantera 2.5.0.")
10 
11 #include "thermo/ThermoFactory.h"
13 #include "kinetics/EdgeKinetics.h"
14 #include "thermo/EdgePhase.h"
15 
16 namespace Cantera
17 {
18 
19 //! Convenience class which inherits from both EdgePhase and EdgeKinetics
20 /*!
21  * @deprecated To be removed after Cantera 2.5.0.
22  * Replaceable with Solution and/or EdgePhase/EdgeKinetics.
23  */
24 class Edge :
25  public EdgePhase, public EdgeKinetics
26 {
27 public:
28  Edge(const std::string& infile, std::string id, std::vector<ThermoPhase*> phases)
29  : m_ok(false), m_r(0)
30  {
31  warn_deprecated("class Metal",
32  "To be removed after Cantera 2.5.0. "
33  "Replaceable with Solution and/or EdgePhase/EdgeKinetics.");
34  m_r = get_XML_File(infile);
35  if (id == "-") {
36  id = "";
37  }
38 
39  XML_Node* x = get_XML_Node("#"+id, m_r);
40  if (!x) {
41  throw CanteraError("Edge::Edge","error in get_XML_Node");
42  }
43 
44  importPhase(*x, this);
45  phases.push_back(this);
46  importKinetics(*x, phases, this);
47  m_ok = true;
48  }
49 
50  bool operator!() {
51  return !m_ok;
52  }
53  bool ready() const {
54  return m_ok;
55  }
56 
57 protected:
58  bool m_ok;
59  XML_Node* m_r;
60 };
61 }
62 
63 #endif
Declarations for the EdgePhase ThermoPhase object, which models the interface between two surfaces (s...
Headers for the factory class that can create known ThermoPhase objects (see Thermodynamic Properties...
Base class for exceptions thrown by Cantera classes.
Definition: ctexceptions.h:61
Heterogeneous reactions at one-dimensional interfaces between multiple adjacent two-dimensional surfa...
Definition: EdgeKinetics.h:23
A thermodynamic phase representing a one dimensional edge between two surfaces.
Definition: EdgePhase.h:31
Convenience class which inherits from both EdgePhase and EdgeKinetics.
Definition: Edge.h:26
bool ready() const
Returns a bool indicating whether the object is ready for use.
Definition: Edge.h:53
Class XML_Node is a tree-based representation of the contents of an XML file.
Definition: xml.h:104
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:110
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:194
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
Definition: global.cpp:54
bool importKinetics(const XML_Node &phase, std::vector< ThermoPhase * > th, Kinetics *k)
Import a reaction mechanism for a phase or an interface.
void importPhase(XML_Node &phase, ThermoPhase *th)
Import a phase information into an empty ThermoPhase object.
Definitions of global routines for the importing of data from XML files (see Input File Handling).
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:264