Cantera  2.4.0
IncompressibleSolid.h
Go to the documentation of this file.
1 //! @file IncompressibleSolid.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_INCOMPRESSIBLE
7 #define CXX_INCOMPRESSIBLE
8 
11 
12 namespace Cantera
13 {
14 
15 //! Wrapper for ConstDensityThermo with constructor from file
17 {
18 public:
19  IncompressibleSolid(const std::string& infile,
20  std::string id="") : m_ok(false), m_r(0)
21  {
22  m_r = get_XML_File(infile);
23  if (id == "-") {
24  id = "";
25  }
26  m_ok = buildSolutionFromXML(*m_r, id, "phase", this, 0);
27  if (!m_ok) throw CanteraError("IncompressibleSolid",
28  "buildSolutionFromXML returned false");
29  }
30 
31  bool operator!() {
32  return !m_ok;
33  }
34  bool ready() const {
35  return m_ok;
36  }
37 
38 protected:
39  bool m_ok;
40  XML_Node* m_r;
41 };
42 }
43 
44 #endif
bool ready() const
Returns a bool indicating whether the object is ready for use.
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:97
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:65
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)...
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:8