From 6da100c5d5aa940c131caec65263678e6b7fb86f Mon Sep 17 00:00:00 2001 From: Dave Goodwin Date: Wed, 4 Feb 2004 10:34:37 +0000 Subject: [PATCH] *** empty log message *** --- Cantera/cxx/include/Edge.h | 47 +++++++++++++++++++++++ Cantera/cxx/include/IncompressibleSolid.h | 43 +++++++++++++++++++++ Cantera/cxx/include/Metal.h | 43 +++++++++++++++++++++ 3 files changed, 133 insertions(+) create mode 100644 Cantera/cxx/include/Edge.h create mode 100644 Cantera/cxx/include/IncompressibleSolid.h create mode 100644 Cantera/cxx/include/Metal.h diff --git a/Cantera/cxx/include/Edge.h b/Cantera/cxx/include/Edge.h new file mode 100644 index 000000000..ccbc71371 --- /dev/null +++ b/Cantera/cxx/include/Edge.h @@ -0,0 +1,47 @@ +#ifndef CXX_EDGE +#define CXX_EDGE + +#include + +#include "kernel/EdgePhase.h" +#include "kernel/EdgeKinetics.h" +#include "kernel/importCTML.h" + +namespace Cantera { + + class Edge : + public EdgePhase, public EdgeKinetics + { + public: + Edge(string infile, string id, vector phases) + : m_ok(false), m_r(0) { + + m_r = get_XML_File(infile); + if (id == "-") id = ""; + + XML_Node* x = get_XML_Node("#"+id, m_r); + if (!x) + throw CanteraError("Edge","error in get_XML_Node"); + + importPhase(*x, this); + phases.push_back(this); + importKinetics(*x, phases, this); + m_ok = true; + } + + + virtual ~Edge() {} + + bool operator!() { return !m_ok;} + bool ready() { return m_ok; } + + protected: + bool m_ok; + XML_Node* m_r; + + private: + }; +} + + +#endif diff --git a/Cantera/cxx/include/IncompressibleSolid.h b/Cantera/cxx/include/IncompressibleSolid.h new file mode 100644 index 000000000..5dd14aa12 --- /dev/null +++ b/Cantera/cxx/include/IncompressibleSolid.h @@ -0,0 +1,43 @@ +#ifndef CXX_INCOMPRESSIBLE +#define CXX_INCOMPRESSIBLE + +#include + +#include "kernel/ConstDensityThermo.h" +#include "kernel/importCTML.h" + +namespace Cantera { + + class IncompressibleSolid : public ConstDensityThermo + { + public: + IncompressibleSolid(string infile, string id="") : m_ok(false), m_r(0) { + + m_r = get_XML_File(infile); + if (id == "-") id = ""; + m_ok = buildSolutionFromXML(*m_r, id, "phase", this, 0); + if (!m_ok) throw CanteraError("IncompressibleSolid", + "buildSolutionFromXML returned false"); + } + + + virtual ~IncompressibleSolid() {} + + bool operator!() { return !m_ok;} + bool ready() { return m_ok; } + + //friend ostream& operator<<(ostream& s, IdealGasMix& mix) { + // string r = report(mix, true); + // s << r; + // return s; + + protected: + bool m_ok; + XML_Node* m_r; + + private: + }; +} + + +#endif diff --git a/Cantera/cxx/include/Metal.h b/Cantera/cxx/include/Metal.h new file mode 100644 index 000000000..9e9040dd2 --- /dev/null +++ b/Cantera/cxx/include/Metal.h @@ -0,0 +1,43 @@ +#ifndef CXX_METAL +#define CXX_METAL + +#include + +#include "kernel/MetalPhase.h" +#include "kernel/importCTML.h" + +namespace Cantera { + + class Metal : public MetalPhase + { + public: + Metal(string infile, string id="") : m_ok(false), m_r(0) { + + m_r = get_XML_File(infile); + if (id == "-") id = ""; + m_ok = buildSolutionFromXML(*m_r, id, "phase", this, 0); + if (!m_ok) throw CanteraError("Metal", + "buildSolutionFromXML returned false"); + } + + + virtual ~Metal() {} + + bool operator!() { return !m_ok;} + bool ready() { return m_ok; } + + //friend ostream& operator<<(ostream& s, IdealGasMix& mix) { + // string r = report(mix, true); + // s << r; + // return s; + + protected: + bool m_ok; + XML_Node* m_r; + + private: + }; +} + + +#endif