Cantera  2.1.2
Metal.h
Go to the documentation of this file.
1 //! @file Metal.h
2 #ifndef CXX_METAL
3 #define CXX_METAL
4 
5 #include "thermo/MetalPhase.h"
7 
8 namespace Cantera
9 {
10 
11 class Metal : public MetalPhase
12 {
13 public:
14  Metal(const std::string& infile, std::string id="") : m_ok(false), m_r(0) {
15 
16  m_r = get_XML_File(infile);
17  if (id == "-") {
18  id = "";
19  }
20  m_ok = buildSolutionFromXML(*m_r, id, "phase", this, 0);
21  if (!m_ok) throw CanteraError("Metal",
22  "buildSolutionFromXML returned false");
23  }
24 
25  bool operator!() {
26  return !m_ok;
27  }
28  bool ready() const {
29  return m_ok;
30  }
31 
32 protected:
33  bool m_ok;
34  XML_Node* m_r;
35 
36 private:
37 };
38 }
39 
40 
41 #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
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.
Definitions of global routines for the importing of data from XML files (see Input File Handling)...