diff --git a/Cantera/cxx/README b/Cantera/cxx/README deleted file mode 100644 index 258a20e55..000000000 --- a/Cantera/cxx/README +++ /dev/null @@ -1,3 +0,0 @@ -This directory contains files that are part of the C++ user -interface. For the kernel C++ files, see directory ../src. - diff --git a/Cantera/cxx/SConscript b/Cantera/cxx/SConscript index 09946d590..7290f79af 100644 --- a/Cantera/cxx/SConscript +++ b/Cantera/cxx/SConscript @@ -4,16 +4,6 @@ Import('env', 'buildTargets', 'installTargets', 'demoTargets') localenv = env.Clone() -### C++ Interface Library ### - -lib = localenv.Library(pjoin('../../lib', 'ctcxx'), - source=mglob(localenv, 'src', 'cpp')) -inst = localenv.Install('$inst_libdir', lib) - -buildTargets.extend(lib) -installTargets.extend(inst) - - ### Demos ### # (subdir, program name, [source extensions]) diff --git a/Cantera/cxx/demos/flamespeed/flamespeed.cpp b/Cantera/cxx/demos/flamespeed/flamespeed.cpp index 90e07c0ee..182d2b2f2 100644 --- a/Cantera/cxx/demos/flamespeed/flamespeed.cpp +++ b/Cantera/cxx/demos/flamespeed/flamespeed.cpp @@ -5,7 +5,6 @@ #include using namespace Cantera; -using namespace Cantera_CXX; int flamespeed(int np, void* p) { try { diff --git a/Cantera/cxx/include/Cantera.h b/Cantera/cxx/include/Cantera.h index 30fe8901b..7c3ad199b 100755 --- a/Cantera/cxx/include/Cantera.h +++ b/Cantera/cxx/include/Cantera.h @@ -8,10 +8,6 @@ #ifndef CANTERA_H_INCL #define CANTERA_H_INCL -namespace Cantera_CXX{ } - -using namespace Cantera_CXX; - #include "kernel/ct_defs.h" // some useful functions diff --git a/Cantera/cxx/include/Edge.h b/Cantera/cxx/include/Edge.h index 0ae5f8ba6..296a34014 100644 --- a/Cantera/cxx/include/Edge.h +++ b/Cantera/cxx/include/Edge.h @@ -7,11 +7,10 @@ #include "kernel/EdgeKinetics.h" #include "kernel/importKinetics.h" -using namespace Cantera; -namespace Cantera_CXX { +namespace Cantera { class Edge : - public Cantera::EdgePhase, public Cantera::EdgeKinetics + public EdgePhase, public EdgeKinetics { public: Edge(std::string infile, std::string id, std::vector phases) diff --git a/Cantera/cxx/include/GRI30.h b/Cantera/cxx/include/GRI30.h index 82babf559..191e5704f 100644 --- a/Cantera/cxx/include/GRI30.h +++ b/Cantera/cxx/include/GRI30.h @@ -8,7 +8,7 @@ #include "kernel/importKinetics.h" #include "kernel/stringUtils.h" -namespace Cantera_CXX { +namespace Cantera { /** * This class is a convenience class for use in C++ programs that @@ -20,15 +20,15 @@ namespace Cantera_CXX { * methods like "getNetReactionRates." */ class GRI30 : - public Cantera::IdealGasPhase, - public Cantera::GRI_30_Kinetics + public IdealGasPhase, + public GRI_30_Kinetics { public: GRI30() : m_ok(false), m_r(0) { - m_r = Cantera::get_XML_File("gri30.xml"); - m_ok = Cantera::buildSolutionFromXML(*m_r, "gri30", + m_r = get_XML_File("gri30.xml"); + m_ok = buildSolutionFromXML(*m_r, "gri30", "phase", this, this); - if (!m_ok) throw Cantera::CanteraError("GRI30", + if (!m_ok) throw CanteraError("GRI30", "buildSolutionFromXML returned false"); } @@ -37,7 +37,7 @@ namespace Cantera_CXX { bool operator!() { return !m_ok;} bool ready() const { return m_ok; } friend std::ostream& operator<<(std::ostream& s, GRI30& mix) { - std::string r = Cantera::report(mix, true); + std::string r = mix.report(true); s << r; return s; } diff --git a/Cantera/cxx/include/IdealGasMix.h b/Cantera/cxx/include/IdealGasMix.h index 590c18568..42319bc80 100644 --- a/Cantera/cxx/include/IdealGasMix.h +++ b/Cantera/cxx/include/IdealGasMix.h @@ -8,11 +8,11 @@ #include "kernel/importKinetics.h" #include "kernel/stringUtils.h" -namespace Cantera_CXX { +namespace Cantera { class IdealGasMix : - public Cantera::IdealGasPhase, - public Cantera::GasKinetics + public IdealGasPhase, + public GasKinetics { public: @@ -21,36 +21,33 @@ namespace Cantera_CXX { IdealGasMix(std::string infile, std::string id="") : m_ok(false), m_r(0) { - m_r = Cantera::get_XML_File(infile); + m_r = get_XML_File(infile); m_id = id; if (id == "-") id = ""; - m_ok = Cantera::buildSolutionFromXML(*m_r, + m_ok = buildSolutionFromXML(*m_r, m_id, "phase", this, this); - if (!m_ok) throw Cantera::CanteraError("IdealGasMix", + if (!m_ok) throw CanteraError("IdealGasMix", "Cantera::buildSolutionFromXML returned false"); } - IdealGasMix(Cantera::XML_Node& root, + IdealGasMix(XML_Node& root, std::string id) : m_ok(false), m_r(&root), m_id(id) { - m_ok = Cantera::buildSolutionFromXML(root, id, - "phase", this, this); + m_ok = buildSolutionFromXML(root, id, "phase", this, this); } IdealGasMix(const IdealGasMix& other) : m_ok(false), m_r(other.m_r), m_id(other.m_id) { - m_ok = Cantera::buildSolutionFromXML(*m_r, m_id, - "phase", this, this); + m_ok = buildSolutionFromXML(*m_r, m_id, "phase", this, this); } - virtual ~IdealGasMix() {} bool operator!() { return !m_ok;} bool ready() const { return m_ok; } friend std::ostream& operator<<(std::ostream& s, IdealGasMix& mix) { - std::string r = Cantera::report(mix, true); + std::string r = mix.report(true); s << r; return s; } @@ -58,7 +55,7 @@ namespace Cantera_CXX { protected: bool m_ok; - Cantera::XML_Node* m_r; + XML_Node* m_r; std::string m_id; private: diff --git a/Cantera/cxx/include/IncompressibleSolid.h b/Cantera/cxx/include/IncompressibleSolid.h index f9fd3d0b0..3e443427c 100644 --- a/Cantera/cxx/include/IncompressibleSolid.h +++ b/Cantera/cxx/include/IncompressibleSolid.h @@ -6,22 +6,21 @@ #include "kernel/ConstDensityThermo.h" #include "kernel/importKinetics.h" -namespace Cantera_CXX { +namespace Cantera { - class IncompressibleSolid : public Cantera::ConstDensityThermo + class IncompressibleSolid : public ConstDensityThermo { public: IncompressibleSolid(std::string infile, std::string id="") : m_ok(false), m_r(0) { - m_r = Cantera::get_XML_File(infile); + m_r = get_XML_File(infile); if (id == "-") id = ""; - m_ok = Cantera::buildSolutionFromXML(*m_r, id, "phase", this, 0); - if (!m_ok) throw Cantera::CanteraError("IncompressibleSolid", + 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;} @@ -34,7 +33,7 @@ namespace Cantera_CXX { protected: bool m_ok; - Cantera::XML_Node* m_r; + XML_Node* m_r; private: }; diff --git a/Cantera/cxx/include/Interface.h b/Cantera/cxx/include/Interface.h index 0c468a7b3..1f078d63e 100644 --- a/Cantera/cxx/include/Interface.h +++ b/Cantera/cxx/include/Interface.h @@ -1,7 +1,6 @@ /** * @file Interface.h - * Declaration and Definition for the class Interface, part of - * Cantera's Cantera_CXX namespace. + * Declaration and Definition for the class Interface. */ #ifndef CXX_INTERFACE #define CXX_INTERFACE @@ -14,22 +13,19 @@ // #include "kernel/InterfaceKinetics.h" // #include "kernel/importKinetics.h" -/** - * This namespace is used for the Cantera C++ user interface. - */ -namespace Cantera_CXX { +namespace Cantera { /** * An interface between multiple bulk phases. This class is * defined mostly for convenience. It inherits both from - * Cantera::SurfPhase and Cantera::InterfaceKinetics. It therefore + * SurfPhase and InterfaceKinetics. It therefore * represents a surface phase, and also acts as the kinetics * manager to manage reaction occurring on the surface, possibly * involving species from other phases. */ class Interface : - public Cantera::SurfPhase, - public Cantera::InterfaceKinetics + public SurfPhase, + public InterfaceKinetics { public: @@ -43,18 +39,18 @@ namespace Cantera_CXX { * reactions on this interface. */ Interface(std::string infile, std::string id, - std::vector phases) + std::vector phases) : m_ok(false), m_r(0) { - m_r = Cantera::get_XML_File(infile); + m_r = get_XML_File(infile); if (id == "-") id = ""; - Cantera::XML_Node* x = Cantera::get_XML_Node("#"+id, m_r); + XML_Node* x = get_XML_Node("#"+id, m_r); if (!x) - throw Cantera::CanteraError("Interface","error in get_XML_Node"); + throw CanteraError("Interface","error in get_XML_Node"); - Cantera::importPhase(*x, this); + importPhase(*x, this); phases.push_back(this); - Cantera::importKinetics(*x, phases, this); + importKinetics(*x, phases, this); m_ok = true; } @@ -66,7 +62,7 @@ namespace Cantera_CXX { protected: bool m_ok; - Cantera::XML_Node* m_r; + XML_Node* m_r; private: }; @@ -77,7 +73,7 @@ namespace Cantera_CXX { * instance. */ inline Interface* importInterface(std::string infile, std::string id, - std::vector phases) { + std::vector phases) { return new Interface(infile, id, phases); } diff --git a/Cantera/cxx/include/Metal.h b/Cantera/cxx/include/Metal.h index 3c3b08cc6..15396e957 100644 --- a/Cantera/cxx/include/Metal.h +++ b/Cantera/cxx/include/Metal.h @@ -6,17 +6,17 @@ #include "kernel/MetalPhase.h" #include "kernel/importKinetics.h" -namespace Cantera_CXX { +namespace Cantera { - class Metal : public Cantera::MetalPhase + class Metal : public MetalPhase { public: Metal(std::string infile, std::string id="") : m_ok(false), m_r(0) { - m_r = Cantera::get_XML_File(infile); + m_r = get_XML_File(infile); if (id == "-") id = ""; - m_ok = Cantera::buildSolutionFromXML(*m_r, id, "phase", this, 0); - if (!m_ok) throw Cantera::CanteraError("Metal", + m_ok = buildSolutionFromXML(*m_r, id, "phase", this, 0); + if (!m_ok) throw CanteraError("Metal", "buildSolutionFromXML returned false"); } @@ -27,7 +27,7 @@ namespace Cantera_CXX { protected: bool m_ok; - Cantera::XML_Node* m_r; + XML_Node* m_r; private: }; diff --git a/Cantera/cxx/include/PureFluid.h b/Cantera/cxx/include/PureFluid.h index db4ad5e09..4e1df42a4 100644 --- a/Cantera/cxx/include/PureFluid.h +++ b/Cantera/cxx/include/PureFluid.h @@ -35,7 +35,7 @@ namespace Cantera { bool operator!() { return !m_ok;} bool ready() const { return m_ok; } friend std::ostream& operator<<(std::ostream& s, PureFluid& mix) { - std::string r = Cantera::report(mix, true); + std::string r = mix.report(true); s << r; return s; } diff --git a/Cantera/cxx/include/importPhase.h b/Cantera/cxx/include/importPhase.h deleted file mode 100644 index 50e1c649e..000000000 --- a/Cantera/cxx/include/importPhase.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef CXX_IMPORTPHASE -#define CXX_IMPORTPHASE - -#include - -#include "kernel/ThermoPhase.h" -#include "kernel/ThermoFactory.h" - -/* - * The Definitions for these functions are all located in - * libctxx.a - */ - -namespace Cantera_CXX { - Cantera::ThermoPhase* importPhase(std::string infile, std::string id=""); - - // -> this is a duplicate of a src/thermo/phasereport function - // We'll leave it here so that these are available externally - std::string report(const Cantera::ThermoPhase& th, bool show_thermo); - - std::string formatCompList(const Cantera::Phase& mix, int xyc); -} - - -#endif diff --git a/Cantera/cxx/include/thermo.h b/Cantera/cxx/include/thermo.h index a27b23336..fedd56b66 100755 --- a/Cantera/cxx/include/thermo.h +++ b/Cantera/cxx/include/thermo.h @@ -10,7 +10,6 @@ #define CT_THERMO_INCL #include "kernel/ThermoFactory.h" -#include "importPhase.h" #include "kernel/SurfPhase.h" #include "kernel/EdgePhase.h" diff --git a/Cantera/cxx/src/importPhase.cpp b/Cantera/cxx/src/importPhase.cpp deleted file mode 100644 index 622a7a1ea..000000000 --- a/Cantera/cxx/src/importPhase.cpp +++ /dev/null @@ -1,20 +0,0 @@ -/** - * @file cxx/src/importPhase.cpp - */ - -#include - -#include "kernel/ThermoPhase.h" -#include "kernel/ThermoFactory.h" - -namespace Cantera {} - -namespace Cantera_CXX { - - Cantera::ThermoPhase* importPhase(std::string infile, std::string id) { - Cantera::ThermoPhase* p = Cantera::newPhase(infile, id); - return p; - } -} - - diff --git a/Cantera/fortran/f77demos/demo_ftnlib.cpp b/Cantera/fortran/f77demos/demo_ftnlib.cpp index 4239878c7..511676406 100644 --- a/Cantera/fortran/f77demos/demo_ftnlib.cpp +++ b/Cantera/fortran/f77demos/demo_ftnlib.cpp @@ -30,7 +30,6 @@ #include using namespace Cantera; -using namespace Cantera_CXX; // store a pointer to an IdealGasMix object static IdealGasMix* _gas = 0; diff --git a/test_problems/ChemEquil_gri_matrix/gri_matrix.cpp b/test_problems/ChemEquil_gri_matrix/gri_matrix.cpp index 2475076a2..0e6d7e38b 100644 --- a/test_problems/ChemEquil_gri_matrix/gri_matrix.cpp +++ b/test_problems/ChemEquil_gri_matrix/gri_matrix.cpp @@ -8,7 +8,6 @@ using namespace std; using namespace Cantera; -using namespace Cantera_CXX; int main(int argc, char **argv) { #ifdef _MSC_VER diff --git a/test_problems/ChemEquil_gri_pairs/gri_pairs.cpp b/test_problems/ChemEquil_gri_pairs/gri_pairs.cpp index c13c29f0a..e061ae67d 100644 --- a/test_problems/ChemEquil_gri_pairs/gri_pairs.cpp +++ b/test_problems/ChemEquil_gri_pairs/gri_pairs.cpp @@ -15,7 +15,6 @@ using namespace std; using namespace Cantera; -using namespace Cantera_CXX; int main(int argc, char **argv) { #ifdef _MSC_VER diff --git a/test_problems/ChemEquil_ionizedGas/ionizedGasEquil.cpp b/test_problems/ChemEquil_ionizedGas/ionizedGasEquil.cpp index e778b5b24..43889f600 100644 --- a/test_problems/ChemEquil_ionizedGas/ionizedGasEquil.cpp +++ b/test_problems/ChemEquil_ionizedGas/ionizedGasEquil.cpp @@ -12,7 +12,6 @@ using namespace std; using namespace Cantera; -using namespace Cantera_CXX; int main(int argc, char **argv) { #ifdef _MSC_VER diff --git a/test_problems/ChemEquil_red1/basopt_red1.cpp b/test_problems/ChemEquil_red1/basopt_red1.cpp index 0f9653117..e5495df18 100644 --- a/test_problems/ChemEquil_red1/basopt_red1.cpp +++ b/test_problems/ChemEquil_red1/basopt_red1.cpp @@ -4,7 +4,6 @@ using namespace std; using namespace Cantera; -using namespace Cantera_CXX; int main(int argc, char **argv) { #ifdef _MSC_VER diff --git a/test_problems/CpJump/CpJump.cpp b/test_problems/CpJump/CpJump.cpp index 5a044f432..921fcfdc0 100644 --- a/test_problems/CpJump/CpJump.cpp +++ b/test_problems/CpJump/CpJump.cpp @@ -15,7 +15,6 @@ using namespace std; using namespace Cantera; -using namespace Cantera_CXX; int main(int argc, char **argv) { #ifdef _MSC_VER diff --git a/test_problems/NASA9poly_test/NASA9poly_test.cpp b/test_problems/NASA9poly_test/NASA9poly_test.cpp index f28bc6ff3..e96eb58ca 100644 --- a/test_problems/NASA9poly_test/NASA9poly_test.cpp +++ b/test_problems/NASA9poly_test/NASA9poly_test.cpp @@ -27,7 +27,6 @@ using namespace std; #include "kernel/TransportFactory.h" using namespace Cantera; -using namespace Cantera_CXX; void printDbl(double val) { if (fabs(val) < 5.0E-17) { diff --git a/test_problems/cxx_ex/equil_example1.cpp b/test_problems/cxx_ex/equil_example1.cpp index d2873a55e..e8a2f77fd 100755 --- a/test_problems/cxx_ex/equil_example1.cpp +++ b/test_problems/cxx_ex/equil_example1.cpp @@ -12,7 +12,6 @@ #include using namespace Cantera; -using namespace Cantera_CXX; //------------------------------------------------------------------- // utility functions for plotting diff --git a/test_problems/cxx_ex/kinetics_example1.cpp b/test_problems/cxx_ex/kinetics_example1.cpp index 3d3cd839b..ed002dc7c 100755 --- a/test_problems/cxx_ex/kinetics_example1.cpp +++ b/test_problems/cxx_ex/kinetics_example1.cpp @@ -11,7 +11,6 @@ #include #include "example_utils.h" using namespace Cantera; -using namespace Cantera_CXX; using namespace CanteraZeroD; using namespace std; diff --git a/test_problems/cxx_ex/kinetics_example2.cpp b/test_problems/cxx_ex/kinetics_example2.cpp index d3758e5be..00566ce2a 100755 --- a/test_problems/cxx_ex/kinetics_example2.cpp +++ b/test_problems/cxx_ex/kinetics_example2.cpp @@ -12,7 +12,6 @@ #include "example_utils.h" using namespace Cantera; -using namespace Cantera_CXX; /** * Same as kinetics_example1, except that it uses class GRI30 instead * of class IdealGasMix. diff --git a/test_problems/cxx_ex/kinetics_example3.cpp b/test_problems/cxx_ex/kinetics_example3.cpp index a32a1bc1d..9432a9b93 100644 --- a/test_problems/cxx_ex/kinetics_example3.cpp +++ b/test_problems/cxx_ex/kinetics_example3.cpp @@ -12,7 +12,6 @@ #include "example_utils.h" using namespace Cantera; -using namespace Cantera_CXX; // Kinetics example. This is written as a function so that one // driver program can run multiple examples. diff --git a/test_problems/cxx_ex/rxnpath_example1.cpp b/test_problems/cxx_ex/rxnpath_example1.cpp index 3d0407aa7..98608e574 100755 --- a/test_problems/cxx_ex/rxnpath_example1.cpp +++ b/test_problems/cxx_ex/rxnpath_example1.cpp @@ -15,7 +15,6 @@ // #include // using namespace std; using namespace Cantera; -using namespace Cantera_CXX; void writeRxnPathDiagram(double time, ReactionPathBuilder& b, IdealGasMix& gas, ostream& logfile, ostream& outfile) { diff --git a/test_problems/cxx_ex/transport_example1.cpp b/test_problems/cxx_ex/transport_example1.cpp index e09e5c559..7b4087e78 100755 --- a/test_problems/cxx_ex/transport_example1.cpp +++ b/test_problems/cxx_ex/transport_example1.cpp @@ -12,7 +12,6 @@ #include using namespace Cantera; -using namespace Cantera_CXX; template void makeTransportDataLabels(const G& gas, V& names) { diff --git a/test_problems/cxx_ex/transport_example2.cpp b/test_problems/cxx_ex/transport_example2.cpp index 0b95fc1b0..5b422b8cc 100755 --- a/test_problems/cxx_ex/transport_example2.cpp +++ b/test_problems/cxx_ex/transport_example2.cpp @@ -13,7 +13,6 @@ #include using namespace Cantera; -using namespace Cantera_CXX; template void makeTransportDataLabels(const G& gas, V& names) { diff --git a/test_problems/mixGasTransport/mixGasTransport.cpp b/test_problems/mixGasTransport/mixGasTransport.cpp index 8f4119dbd..686a43fe1 100644 --- a/test_problems/mixGasTransport/mixGasTransport.cpp +++ b/test_problems/mixGasTransport/mixGasTransport.cpp @@ -39,7 +39,6 @@ using namespace std; #include "kernel/TransportFactory.h" using namespace Cantera; -using namespace Cantera_CXX; void printDbl(double val) { if (fabs(val) < 5.0E-17) { diff --git a/test_problems/multiGasTransport/multiGasTransport.cpp b/test_problems/multiGasTransport/multiGasTransport.cpp index 4880ec637..a6a41420b 100644 --- a/test_problems/multiGasTransport/multiGasTransport.cpp +++ b/test_problems/multiGasTransport/multiGasTransport.cpp @@ -39,7 +39,6 @@ using namespace std; #include "kernel/TransportFactory.h" using namespace Cantera; -using namespace Cantera_CXX; void printDbl(double val) { if (fabs(val) < 1.0E-17) { diff --git a/test_problems/silane_equil/silane_equil.cpp b/test_problems/silane_equil/silane_equil.cpp index dd697ad02..b9bc11bf6 100644 --- a/test_problems/silane_equil/silane_equil.cpp +++ b/test_problems/silane_equil/silane_equil.cpp @@ -15,7 +15,6 @@ using namespace std; using namespace Cantera; -using namespace Cantera_CXX; int main(int argc, char **argv) { #ifdef _MSC_VER diff --git a/test_problems/surfkin/surfdemo.cpp b/test_problems/surfkin/surfdemo.cpp index 198d53b12..d8607a53d 100644 --- a/test_problems/surfkin/surfdemo.cpp +++ b/test_problems/surfkin/surfdemo.cpp @@ -9,9 +9,7 @@ #include "Interface.h" using namespace Cantera; -using namespace Cantera_CXX; using namespace std; -using namespace Cantera_CXX; int main() { diff --git a/tools/SConscript b/tools/SConscript index c2883fdfe..d656fec62 100644 --- a/tools/SConscript +++ b/tools/SConscript @@ -4,7 +4,7 @@ Import('env', 'buildTargets', 'installTargets') localenv = env.Clone() programs = [('cti2ctml', ['src/cti2ctml.cpp'], ['ctbase']), - ('ck2cti', ['src/ck2cti.cpp'], ['converters','ctbase','tpx','ctcxx']), + ('ck2cti', ['src/ck2cti.cpp'], ['converters','ctbase','tpx']), ('csvdiff', mglob(localenv, 'testtools', 'cpp'), [])] for name, src, libs in programs: diff --git a/tools/templates/cxx/demo.cpp b/tools/templates/cxx/demo.cpp index 7472f2232..267e3a735 100644 --- a/tools/templates/cxx/demo.cpp +++ b/tools/templates/cxx/demo.cpp @@ -19,15 +19,11 @@ #include // chemical equilibrium #include // transport properties - // All Cantera kernel names are in namespace Cantera. You can either // reference everything as Cantera::, or include the following // 'using namespace' line. using namespace Cantera; -using namespace Cantera_CXX; -// All Cantera C++ interface names are in namespace Cantera_CXX - // The program is put into a function so that error handling code can // be conveniently put around the whole thing. See main() below. diff --git a/tools/templates/f77/demo_ftnlib.cpp b/tools/templates/f77/demo_ftnlib.cpp index b31204f2a..4c1e94f82 100644 --- a/tools/templates/f77/demo_ftnlib.cpp +++ b/tools/templates/f77/demo_ftnlib.cpp @@ -30,7 +30,6 @@ #include using namespace Cantera; -using namespace Cantera_CXX; // store a pointer to an IdealGasMix object static IdealGasMix* _gas = 0;