Cantera  2.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
IncompressibleSolid.h
Go to the documentation of this file.
1 //! @file IncompressibleSolid.h
2 #ifndef CXX_INCOMPRESSIBLE
3 #define CXX_INCOMPRESSIBLE
4 
7 
8 namespace Cantera
9 {
10 
11 //! Wrapper for ConstDensityThermo with constructor from file
13 {
14 public:
15  IncompressibleSolid(const std::string& infile,
16  std::string id="") : m_ok(false), m_r(0) {
17 
18  m_r = get_XML_File(infile);
19  if (id == "-") {
20  id = "";
21  }
22  m_ok = buildSolutionFromXML(*m_r, id, "phase", this, 0);
23  if (!m_ok) throw CanteraError("IncompressibleSolid",
24  "buildSolutionFromXML returned false");
25  }
26 
27  bool operator!() {
28  return !m_ok;
29  }
30  bool ready() const {
31  return m_ok;
32  }
33 
34  //friend std::ostream& operator<<(std::ostream& s, IdealGasMix& mix) {
35  // std::string r = report(mix, true);
36  // s << r;
37  // return s;
38 
39 protected:
40  bool m_ok;
41  XML_Node* m_r;
42 
43 private:
44 };
45 }
46 
47 
48 #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:105
Class XML_Node is a tree-based representation of the contents of an XML file.
Definition: xml.h:100
Header for a Thermo manager for incompressible ThermoPhases (see Thermodynamic Properties and ConstDe...
Overloads the virtual methods of class ThermoPhase to implement the incompressible equation of state...
Base class for exceptions thrown by Cantera classes.
Definition: ctexceptions.h:99
bool buildSolutionFromXML(XML_Node &root, const std::string &id, const std::string &nm, ThermoPhase *th, Kinetics *kin)
Build a single-phase ThermoPhase object with associated kinetics mechanism.
Wrapper for ConstDensityThermo with constructor from file.
Definitions of global routines for the importing of data from XML files (see Input File Handling)...
bool ready() const
Returns a bool indicating whether the object is ready for use.