Cantera  2.5.1
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 https://cantera.org/license.txt for license and copyright information.
5 
6 #ifndef CXX_INCOMPRESSIBLE
7 #define CXX_INCOMPRESSIBLE
8 
9 #pragma message("warning: IncompressibleSolid.h is deprecated and will be removed after Cantera 2.5.0.")
10 
13 
14 namespace Cantera
15 {
16 
17 //! Wrapper for ConstDensityThermo with constructor from file
18 /*!
19  * @deprecated To be removed after Cantera 2.5.0.
20  * Replaceable with Solution and/or LatticePhase/IdealSolidSolnPhase.
21  */
23 {
24 public:
25  IncompressibleSolid(const std::string& infile,
26  std::string id="") : m_ok(false), m_r(0)
27  {
28  warn_deprecated("class IncompressibleSolid",
29  "To be removed after Cantera 2.5.0. "
30  "Replaceable with Solution and/or LatticePhase/IdealSolidSolnPhase.");
31  m_r = get_XML_File(infile);
32  if (id == "-") {
33  id = "";
34  }
35  m_ok = buildSolutionFromXML(*m_r, id, "phase", this, 0);
36  if (!m_ok) throw CanteraError("IncompressibleSolid",
37  "buildSolutionFromXML returned false");
38  }
39 
40  bool operator!() {
41  return !m_ok;
42  }
43  bool ready() const {
44  return m_ok;
45  }
46 
47 protected:
48  bool m_ok;
49  XML_Node* m_r;
50 };
51 }
52 
53 #endif
Header for a Thermo manager for incompressible ThermoPhases (see Thermodynamic Properties and ConstDe...
Base class for exceptions thrown by Cantera classes.
Definition: ctexceptions.h:61
Overloads the virtual methods of class ThermoPhase to implement the incompressible equation of state.
Wrapper for ConstDensityThermo with constructor from file.
bool ready() const
Returns a bool indicating whether the object is ready for use.
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
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.
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
Definition: global.cpp:54
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