diff --git a/Cantera/clib/src/clib_defs.h b/Cantera/clib/src/clib_defs.h index f3fa601f7..7e89e7dc2 100755 --- a/Cantera/clib/src/clib_defs.h +++ b/Cantera/clib/src/clib_defs.h @@ -48,8 +48,6 @@ #endif namespace Cantera {} -//using namespace Cantera; namespace std {} -//using namespace std; #endif diff --git a/Cantera/cxx/include/Cantera.h b/Cantera/cxx/include/Cantera.h index 0093fe998..08dad4bb9 100755 --- a/Cantera/cxx/include/Cantera.h +++ b/Cantera/cxx/include/Cantera.h @@ -21,8 +21,6 @@ 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..40eaa25e7 100644 --- a/Cantera/cxx/include/Edge.h +++ b/Cantera/cxx/include/Edge.h @@ -7,7 +7,6 @@ #include "kernel/EdgeKinetics.h" #include "kernel/importKinetics.h" -using namespace Cantera; namespace Cantera_CXX { class Edge : diff --git a/Cantera/cxx/include/GRI30.h b/Cantera/cxx/include/GRI30.h index 6bc28cb26..d11afede0 100644 --- a/Cantera/cxx/include/GRI30.h +++ b/Cantera/cxx/include/GRI30.h @@ -11,6 +11,7 @@ #include "kernel/importKinetics.h" #include "kernel/stringUtils.h" + namespace Cantera_CXX { /** diff --git a/Cantera/cxx/include/zerodim.h b/Cantera/cxx/include/zerodim.h index 168039815..fb32b807d 100644 --- a/Cantera/cxx/include/zerodim.h +++ b/Cantera/cxx/include/zerodim.h @@ -11,7 +11,6 @@ #include "kernel/FlowReactor.h" #include "kernel/ConstPressureReactor.h" -using namespace CanteraZeroD; #endif diff --git a/Cantera/fortran/src/fct.cpp b/Cantera/fortran/src/fct.cpp index cbfb0c84d..29f7a812a 100644 --- a/Cantera/fortran/src/fct.cpp +++ b/Cantera/fortran/src/fct.cpp @@ -30,6 +30,9 @@ #include "flib_defs.h" +using namespace Cantera; +using namespace std; + // Assert that there is storage // for the templated classes' static member // (needed to compile on solaris) @@ -39,7 +42,7 @@ inline XML_Node* _xml(const integer* n) { return Cabinet::cabinet()->item(*n); } -inline ThermoPhase* _fph(const integer* n) { +inline Cantera::ThermoPhase* _fph(const integer* n) { return th(*n); } diff --git a/Cantera/fortran/src/fctxml.cpp b/Cantera/fortran/src/fctxml.cpp index 93efbc8a3..246c187da 100644 --- a/Cantera/fortran/src/fctxml.cpp +++ b/Cantera/fortran/src/fctxml.cpp @@ -19,6 +19,7 @@ using namespace ctml; using namespace std; +using namespace Cantera; #include "../../clib/src/Cabinet.h" diff --git a/Cantera/fortran/src/flib_defs.h b/Cantera/fortran/src/flib_defs.h index 3da47e4a9..e879a2479 100644 --- a/Cantera/fortran/src/flib_defs.h +++ b/Cantera/fortran/src/flib_defs.h @@ -21,8 +21,6 @@ typedef integer status_t; namespace Cantera {} -using namespace Cantera; namespace std{} -using namespace std; #endif diff --git a/Cantera/matlab/cantera/private/ctmatutils.h b/Cantera/matlab/cantera/private/ctmatutils.h index ffabe9d40..17e4f3369 100755 --- a/Cantera/matlab/cantera/private/ctmatutils.h +++ b/Cantera/matlab/cantera/private/ctmatutils.h @@ -2,7 +2,6 @@ const double Undef = -999.123; //const double DERR = -999.999; #include -using namespace std; void reportError(); @@ -24,13 +23,13 @@ inline char* getString(const mxArray* p) { int m = mxGetM(p); int n = mxGetN(p); int buflen = m*n + 1; - string msg; + std::string msg; if (m == 1) { input_buf = (char*)mxCalloc(buflen, sizeof(char)); status = mxGetString(p, input_buf, buflen); if(status != 0) { - msg = string(input_buf) + msg = std::string(input_buf) + "\nNot enough space. String is truncated."; mexWarnMsgTxt(msg.c_str()); } diff --git a/Cantera/matlab/cantera/private/mllogger.h b/Cantera/matlab/cantera/private/mllogger.h index 30d0e2dd3..94844c42a 100644 --- a/Cantera/matlab/cantera/private/mllogger.h +++ b/Cantera/matlab/cantera/private/mllogger.h @@ -13,7 +13,6 @@ #include "cantera/kernel/logger.h" #include -//using namespace std; static std::string ss = "disp(' "; diff --git a/Cantera/python/src/pylogger.h b/Cantera/python/src/pylogger.h index 9a84139cb..a60ac2447 100644 --- a/Cantera/python/src/pylogger.h +++ b/Cantera/python/src/pylogger.h @@ -5,7 +5,6 @@ #include #include "cantera/kernel/logger.h" -using namespace std; static std::string ss = "print \"\"\" "; @@ -18,7 +17,7 @@ namespace Cantera { Py_Logger() {} virtual ~Py_Logger() {} - virtual void write(const string& s) { + virtual void write(const std::string& s) { char ch = s[0]; int n = 0; while (ch != '\0') { @@ -35,7 +34,7 @@ namespace Cantera { } virtual void error(const std::string& msg) { - string err = "raise \""+msg+"\""; + std::string err = "raise \""+msg+"\""; PyRun_SimpleString((char *)err.c_str()); } diff --git a/Cantera/src/equil/vcs_internal.h b/Cantera/src/equil/vcs_internal.h index b816240e2..b3d87bbf7 100644 --- a/Cantera/src/equil/vcs_internal.h +++ b/Cantera/src/equil/vcs_internal.h @@ -249,8 +249,6 @@ namespace VCSnonideal { #include "Cantera.h" #include "kernel/vcs_internal.h" - using namespace Cantera; - using namespace VCSnonideal; const double g_cgs = 980.; const double mass_cyl = 0.066; diff --git a/Cantera/src/kinetics/Group.h b/Cantera/src/kinetics/Group.h index 82e13b74f..cf44e475c 100644 --- a/Cantera/src/kinetics/Group.h +++ b/Cantera/src/kinetics/Group.h @@ -14,7 +14,6 @@ #include "ct_defs.h" -//using namespace std; namespace Cantera { /** diff --git a/Cantera/src/numerics/Func1.h b/Cantera/src/numerics/Func1.h index fa3e6b23f..e91263101 100644 --- a/Cantera/src/numerics/Func1.h +++ b/Cantera/src/numerics/Func1.h @@ -23,7 +23,6 @@ #include #include -using namespace std; namespace Cantera { diff --git a/Cantera/src/oneD/boundaries1D.cpp b/Cantera/src/oneD/boundaries1D.cpp index cfe591a33..b87ab2e79 100644 --- a/Cantera/src/oneD/boundaries1D.cpp +++ b/Cantera/src/oneD/boundaries1D.cpp @@ -262,8 +262,8 @@ namespace Cantera { restore(const XML_Node& dom, doublereal* soln) { //map x; //getFloats(dom, x); - soln[0] = getFloat(dom, "mdot", "massflowrate"); // x["mdot"]; - soln[1] = getFloat(dom, "temperature", "temperature"); // x["temperature"]; + soln[0] = ctml::getFloat(dom, "mdot", "massflowrate"); // x["mdot"]; + soln[1] = ctml::getFloat(dom, "temperature", "temperature"); // x["temperature"]; resize(2,1); } @@ -726,7 +726,7 @@ namespace Cantera { void Surf1D:: restore(const XML_Node& dom, doublereal* soln) { map x; - getFloats(dom, x); + ctml::getFloats(dom, x); soln[0] = x["temperature"]; resize(1,1); } @@ -886,7 +886,7 @@ namespace Cantera { void ReactingSurf1D:: restore(const XML_Node& dom, doublereal* soln) { map x; - getFloats(dom, x); + ctml::getFloats(dom, x); soln[0] = x["temperature"]; resize(1,1); } diff --git a/Cantera/src/transport/LTPspecies.cpp b/Cantera/src/transport/LTPspecies.cpp index 74ce83edb..7fa8b4cb7 100644 --- a/Cantera/src/transport/LTPspecies.cpp +++ b/Cantera/src/transport/LTPspecies.cpp @@ -13,6 +13,7 @@ */ #include "LTPspecies.h" using namespace std; +using namespace ctml; namespace Cantera { //==================================================================================================================== diff --git a/Cantera/src/transport/LiquidTranInteraction.cpp b/Cantera/src/transport/LiquidTranInteraction.cpp index f6c0ae203..7d52b2127 100644 --- a/Cantera/src/transport/LiquidTranInteraction.cpp +++ b/Cantera/src/transport/LiquidTranInteraction.cpp @@ -15,7 +15,7 @@ #include "MargulesVPSSTP.h" #include using namespace std; - +using namespace ctml; namespace Cantera { diff --git a/Cantera/src/transport/SimpleTransport.cpp b/Cantera/src/transport/SimpleTransport.cpp index 405baedee..6c9b62c64 100644 --- a/Cantera/src/transport/SimpleTransport.cpp +++ b/Cantera/src/transport/SimpleTransport.cpp @@ -210,8 +210,8 @@ namespace Cantera { * */ std::string modelName = ""; - if (getOptionalModel(transportNode, "compositionDependence", - modelName)) { + if (ctml::getOptionalModel(transportNode, "compositionDependence", + modelName)) { modelName = lowercase(modelName); if (modelName == "solvent_only") { compositionDepType_ = 0; diff --git a/Cantera/src/transport/TransportFactory.cpp b/Cantera/src/transport/TransportFactory.cpp index 8162bdec5..0b82466a8 100644 --- a/Cantera/src/transport/TransportFactory.cpp +++ b/Cantera/src/transport/TransportFactory.cpp @@ -867,15 +867,15 @@ namespace Cantera { // child are skipped, instead of throwing an exception. try { XML_Node& tr = sp.child("transport"); - getString(tr, "geometry", val, type); + ctml::getString(tr, "geometry", val, type); geom = gindx[val] - 100; map fv; - welldepth = getFloat(tr, "LJ_welldepth"); - diam = getFloat(tr, "LJ_diameter"); - dipole = getFloat(tr, "dipoleMoment"); - polar = getFloat(tr, "polarizability"); - rot = getFloat(tr, "rotRelax"); + welldepth = ctml::getFloat(tr, "LJ_welldepth"); + diam = ctml::getFloat(tr, "LJ_diameter"); + dipole = ctml::getFloat(tr, "dipoleMoment"); + polar = ctml::getFloat(tr, "polarizability"); + rot = ctml::getFloat(tr, "rotRelax"); GasTransportData data; data.speciesName = name; diff --git a/apps/bvp/BoundaryValueProblem.h b/apps/bvp/BoundaryValueProblem.h index 106aabc4b..dc000fb91 100644 --- a/apps/bvp/BoundaryValueProblem.h +++ b/apps/bvp/BoundaryValueProblem.h @@ -7,8 +7,6 @@ #include #include -using namespace Cantera; -using namespace std; /// Namespace for the boundary value problem package. namespace BVP { diff --git a/examples/cxx/example_utils.h b/examples/cxx/example_utils.h index 9211aa94d..f9b529c43 100755 --- a/examples/cxx/example_utils.h +++ b/examples/cxx/example_utils.h @@ -4,7 +4,6 @@ #include #include -using namespace Cantera; namespace CanteraZeroD{} // Save the temperature, density, pressure, and mole fractions at one diff --git a/ext/f2c_math/gmres.h b/ext/f2c_math/gmres.h index 1f6a044d5..8bde197c2 100644 --- a/ext/f2c_math/gmres.h +++ b/ext/f2c_math/gmres.h @@ -33,7 +33,6 @@ gmres( int m, int N, const Matrix &A, const doublereal *b, doublereal *x, double #include "cblas.h" #include "../../Cantera/src/ctlapack.h" -using namespace Cantera; template< class Matrix > inline int diff --git a/ext/math/gmres.h b/ext/math/gmres.h index 1f6a044d5..8bde197c2 100755 --- a/ext/math/gmres.h +++ b/ext/math/gmres.h @@ -33,7 +33,6 @@ gmres( int m, int N, const Matrix &A, const doublereal *b, doublereal *x, double #include "cblas.h" #include "../../Cantera/src/ctlapack.h" -using namespace Cantera; template< class Matrix > inline int