From 08fa7e3d026e49ddac0d002fc3f47168ad284ca2 Mon Sep 17 00:00:00 2001 From: Dave Goodwin Date: Tue, 22 Nov 2005 17:59:04 +0000 Subject: [PATCH] changed some variable names to eliminate leading ddouble (and some single) underscores --- Cantera/cxx/demos/kinetics1.cpp | 2 +- Cantera/src/FalloffFactory.cpp | 2 +- Cantera/src/FalloffFactory.h | 12 +- Cantera/src/GasKinetics.cpp | 2 +- Cantera/src/Integrator.h | 2 +- Cantera/src/KineticsFactory.cpp | 2 +- Cantera/src/KineticsFactory.h | 10 +- Cantera/src/SpeciesThermoFactory.cpp | 2 +- Cantera/src/SpeciesThermoFactory.h | 12 +- Cantera/src/SpeciesThermoMgr.h | 6 +- Cantera/src/State.cpp | 4 +- Cantera/src/StoichManager.h | 78 +++++----- Cantera/src/ThermoFactory.cpp | 2 +- Cantera/src/ThermoFactory.h | 12 +- Cantera/src/ThirdBodyMgr.h | 2 +- Cantera/src/misc.cpp | 158 ++++++++++----------- Cantera/src/transport/TransportFactory.cpp | 8 +- Cantera/src/transport/TransportFactory.h | 10 +- Cantera/src/units.h | 12 +- Cantera/src/utilities.h | 122 ++++++++-------- Cantera/src/vec_functions.h | 12 +- test_problems/silane_equil/Makefile.in | 2 +- test_problems/surfkin/Makefile.in | 2 +- tools/src/Makefile.in | 2 +- tools/src/ctlibsample.mak.in | 2 +- tools/src/sample.mak.in | 2 +- tools/src/sample_f90.mak.in | 2 +- tools/testtools/Makefile.in | 2 +- 28 files changed, 243 insertions(+), 243 deletions(-) diff --git a/Cantera/cxx/demos/kinetics1.cpp b/Cantera/cxx/demos/kinetics1.cpp index 9728b5ee2..689680917 100644 --- a/Cantera/cxx/demos/kinetics1.cpp +++ b/Cantera/cxx/demos/kinetics1.cpp @@ -53,7 +53,7 @@ int kinetics1(int np, void* p) { r.insert(gas); env.insert(gas); - r.addHomogenRxnSens(0); + //r.addHomogenRxnSens(0); // create a wall between the reactor and the environment Wall w; diff --git a/Cantera/src/FalloffFactory.cpp b/Cantera/src/FalloffFactory.cpp index fc65db57a..f42f5b6ba 100755 --- a/Cantera/src/FalloffFactory.cpp +++ b/Cantera/src/FalloffFactory.cpp @@ -20,7 +20,7 @@ namespace Cantera { - FalloffFactory* FalloffFactory::__factory = 0; + FalloffFactory* FalloffFactory::s_factory = 0; /** * The 3-parameter Troe falloff parameterization. diff --git a/Cantera/src/FalloffFactory.h b/Cantera/src/FalloffFactory.h index 3a6103bac..f014df598 100755 --- a/Cantera/src/FalloffFactory.h +++ b/Cantera/src/FalloffFactory.h @@ -97,14 +97,14 @@ namespace Cantera { * to the existing factory is returned. */ static FalloffFactory* factory() { - if (!__factory) __factory = new FalloffFactory; - return __factory; + if (!s_factory) s_factory = new FalloffFactory; + return s_factory; } static void deleteFalloffFactory() { - if (__factory) { - delete __factory; - __factory = 0; + if (s_factory) { + delete s_factory; + s_factory = 0; } } @@ -127,7 +127,7 @@ namespace Cantera { virtual Falloff* newFalloff(int type, const vector_fp& c); private: - static FalloffFactory* __factory; + static FalloffFactory* s_factory; FalloffFactory(){} }; diff --git a/Cantera/src/GasKinetics.cpp b/Cantera/src/GasKinetics.cpp index 5303f242d..e1ab80814 100755 --- a/Cantera/src/GasKinetics.cpp +++ b/Cantera/src/GasKinetics.cpp @@ -320,7 +320,7 @@ namespace Cantera { pr[i] *= m_rf_high[i]; } - _scatter_copy(pr.begin(), pr.begin() + m_nfall, + scatter_copy(pr.begin(), pr.begin() + m_nfall, ropf.begin(), m_fallindx.begin()); } diff --git a/Cantera/src/Integrator.h b/Cantera/src/Integrator.h index 1fb48d270..d0983abe6 100755 --- a/Cantera/src/Integrator.h +++ b/Cantera/src/Integrator.h @@ -86,7 +86,7 @@ namespace Cantera { { warn("setTolerances"); } virtual void setSensitivityTolerances(doublereal reltol, doublereal abstol) - { warn("setSensitivityTolerances"); } + {}// { warn("setSensitivityTolerances"); } /** * Set problem type. diff --git a/Cantera/src/KineticsFactory.cpp b/Cantera/src/KineticsFactory.cpp index 0d36aaa1d..24ac8cf05 100644 --- a/Cantera/src/KineticsFactory.cpp +++ b/Cantera/src/KineticsFactory.cpp @@ -25,7 +25,7 @@ namespace Cantera { - KineticsFactory* KineticsFactory::__factory = 0; + KineticsFactory* KineticsFactory::s_factory = 0; static int ntypes = 5; static string _types[] = {"none", "GasKinetics", "GRI30", "Interface", "Edge"}; diff --git a/Cantera/src/KineticsFactory.h b/Cantera/src/KineticsFactory.h index 535125b71..ac75f295f 100644 --- a/Cantera/src/KineticsFactory.h +++ b/Cantera/src/KineticsFactory.h @@ -38,13 +38,13 @@ namespace Cantera { public: static KineticsFactory* factory() { - if (!__factory) __factory = new KineticsFactory; - return __factory; + if (!s_factory) s_factory = new KineticsFactory; + return s_factory; } virtual ~KineticsFactory() { - delete __factory; - __factory = 0; + delete s_factory; + s_factory = 0; } /** @@ -57,7 +57,7 @@ namespace Cantera { private: - static KineticsFactory* __factory; + static KineticsFactory* s_factory; KineticsFactory(){} }; diff --git a/Cantera/src/SpeciesThermoFactory.cpp b/Cantera/src/SpeciesThermoFactory.cpp index 4d58ac61b..d9fd4aef0 100755 --- a/Cantera/src/SpeciesThermoFactory.cpp +++ b/Cantera/src/SpeciesThermoFactory.cpp @@ -29,7 +29,7 @@ using namespace ctml; namespace Cantera { - SpeciesThermoFactory* SpeciesThermoFactory::__factory = 0; + SpeciesThermoFactory* SpeciesThermoFactory::s_factory = 0; static void getSpeciesThermoTypes(XML_Node* node, diff --git a/Cantera/src/SpeciesThermoFactory.h b/Cantera/src/SpeciesThermoFactory.h index 5c2ca32dc..d1e0e3fa6 100755 --- a/Cantera/src/SpeciesThermoFactory.h +++ b/Cantera/src/SpeciesThermoFactory.h @@ -45,13 +45,13 @@ namespace Cantera { public: static SpeciesThermoFactory* factory() { - if (!__factory) __factory = new SpeciesThermoFactory; - return __factory; + if (!s_factory) s_factory = new SpeciesThermoFactory; + return s_factory; } static void deleteFactory() { - if (__factory) { - delete __factory; - __factory = 0; + if (s_factory) { + delete s_factory; + s_factory = 0; } } @@ -78,7 +78,7 @@ namespace Cantera { SpeciesThermo& spthermo); private: - static SpeciesThermoFactory* __factory; + static SpeciesThermoFactory* s_factory; SpeciesThermoFactory(){} }; diff --git a/Cantera/src/SpeciesThermoMgr.h b/Cantera/src/SpeciesThermoMgr.h index 8e3d4f0f6..8db52e90d 100755 --- a/Cantera/src/SpeciesThermoMgr.h +++ b/Cantera/src/SpeciesThermoMgr.h @@ -55,10 +55,10 @@ namespace Cantera { * 'maxTemp()', and returns the smallest 'maxTemp' value. */ template - doublereal _maxTemp(_InputIter __begin, _InputIter __end) { + doublereal _maxTemp(_InputIter begin, _InputIter end) { doublereal _maxT = 1.e10; - for (; __begin != __end; ++__begin) - _maxT = fminn(_maxT, __begin->maxTemp()); + for (; begin != end; ++begin) + _maxT = fminn(_maxT, begin->maxTemp()); return _maxT; } diff --git a/Cantera/src/State.cpp b/Cantera/src/State.cpp index 18c489bfa..9a4a23cdc 100644 --- a/Cantera/src/State.cpp +++ b/Cantera/src/State.cpp @@ -135,11 +135,11 @@ namespace Cantera { } doublereal State::sum_xlogx() const { - return m_mmw*_sum_xlogx(m_ym.begin(), m_ym.end()) + log(m_mmw); + return m_mmw* Cantera::sum_xlogx(m_ym.begin(), m_ym.end()) + log(m_mmw); } doublereal State::sum_xlogQ(doublereal* Q) const { - return m_mmw * _sum_xlogQ(m_ym.begin(), m_ym.end(), Q); + return m_mmw * Cantera::sum_xlogQ(m_ym.begin(), m_ym.end(), Q); } void State::setConcentrations(const doublereal* c) { diff --git a/Cantera/src/StoichManager.h b/Cantera/src/StoichManager.h index e4054325f..d80068a68 100755 --- a/Cantera/src/StoichManager.h +++ b/Cantera/src/StoichManager.h @@ -477,70 +477,70 @@ They are designed to explicitly unroll loops over species or reactions for }; - template - inline static void _multiply(_InputIter __begin, _InputIter __end, + template + inline static void _multiply(InputIter begin, InputIter end, const Vec1& input, Vec2& output) { - for (; __begin != __end; ++__begin) - __begin->multiply(input, output); + for (; begin != end; ++begin) + begin->multiply(input, output); } - template - inline static void _incrementSpecies(_InputIter __begin, - _InputIter __end, const Vec1& input, Vec2& output) { - for (; __begin != __end; ++__begin) - __begin->incrementSpecies(input, output); + template + inline static void _incrementSpecies(InputIter begin, + InputIter end, const Vec1& input, Vec2& output) { + for (; begin != end; ++begin) + begin->incrementSpecies(input, output); } - template - inline static void _decrementSpecies(_InputIter __begin, - _InputIter __end, const Vec1& input, Vec2& output) { - for (; __begin != __end; ++__begin) - __begin->decrementSpecies(input, output); + template + inline static void _decrementSpecies(InputIter begin, + InputIter end, const Vec1& input, Vec2& output) { + for (; begin != end; ++begin) + begin->decrementSpecies(input, output); } - template - inline static void _incrementReactions(_InputIter __begin, - _InputIter __end, const Vec1& input, Vec2& output) { - for (; __begin != __end; ++__begin) - __begin->incrementReaction(input, output); + template + inline static void _incrementReactions(InputIter begin, + InputIter end, const Vec1& input, Vec2& output) { + for (; begin != end; ++begin) + begin->incrementReaction(input, output); } - template - inline static void _decrementReactions(_InputIter __begin, - _InputIter __end, const Vec1& input, Vec2& output) { - for (; __begin != __end; ++__begin) - __begin->decrementReaction(input, output); + template + inline static void _decrementReactions(InputIter begin, + InputIter end, const Vec1& input, Vec2& output) { + for (; begin != end; ++begin) + begin->decrementReaction(input, output); } - template - inline static void _writeIncrementSpecies(_InputIter __begin, _InputIter __end, string r, + template + inline static void _writeIncrementSpecies(InputIter begin, InputIter end, string r, map& out) { - for (; __begin != __end; ++__begin) __begin->writeIncrementSpecies(r, out); + for (; begin != end; ++begin) begin->writeIncrementSpecies(r, out); } - template - inline static void _writeDecrementSpecies(_InputIter __begin, _InputIter __end, string r, + template + inline static void _writeDecrementSpecies(InputIter begin, InputIter end, string r, map& out) { - for (; __begin != __end; ++__begin) __begin->writeDecrementSpecies(r, out); + for (; begin != end; ++begin) begin->writeDecrementSpecies(r, out); } - template - inline static void _writeIncrementReaction(_InputIter __begin, _InputIter __end, string r, + template + inline static void _writeIncrementReaction(InputIter begin, InputIter end, string r, map& out) { - for (; __begin != __end; ++__begin) __begin->writeIncrementReaction(r, out); + for (; begin != end; ++begin) begin->writeIncrementReaction(r, out); } - template - inline static void _writeDecrementReaction(_InputIter __begin, _InputIter __end, string r, + template + inline static void _writeDecrementReaction(InputIter begin, InputIter end, string r, map& out) { - for (; __begin != __end; ++__begin) __begin->writeDecrementReaction(r, out); + for (; begin != end; ++begin) begin->writeDecrementReaction(r, out); } - template - inline static void _writeMultiply(_InputIter __begin, _InputIter __end, string r, + template + inline static void _writeMultiply(InputIter begin, InputIter end, string r, map& out) { - for (; __begin != __end; ++__begin) __begin->writeMultiply(r, out); + for (; begin != end; ++begin) begin->writeMultiply(r, out); } /* diff --git a/Cantera/src/ThermoFactory.cpp b/Cantera/src/ThermoFactory.cpp index 677fc4e38..8c32b5150 100644 --- a/Cantera/src/ThermoFactory.cpp +++ b/Cantera/src/ThermoFactory.cpp @@ -44,7 +44,7 @@ namespace Cantera { - ThermoFactory* ThermoFactory::__factory = 0; + ThermoFactory* ThermoFactory::s_factory = 0; static int ntypes = 8; static string _types[] = {"IdealGas", "Incompressible", diff --git a/Cantera/src/ThermoFactory.h b/Cantera/src/ThermoFactory.h index f048483df..9b9709457 100644 --- a/Cantera/src/ThermoFactory.h +++ b/Cantera/src/ThermoFactory.h @@ -38,14 +38,14 @@ namespace Cantera { public: static ThermoFactory* factory() { - if (!__factory) __factory = new ThermoFactory; - return __factory; + if (!s_factory) s_factory = new ThermoFactory; + return s_factory; } static void deleteFactory() { - if (__factory) { - delete __factory; - __factory = 0; + if (s_factory) { + delete s_factory; + s_factory = 0; } } @@ -67,7 +67,7 @@ namespace Cantera { private: - static ThermoFactory* __factory; + static ThermoFactory* s_factory; ThermoFactory(){} }; diff --git a/Cantera/src/ThirdBodyMgr.h b/Cantera/src/ThirdBodyMgr.h index f4e5b8a0e..41ac42cdf 100755 --- a/Cantera/src/ThirdBodyMgr.h +++ b/Cantera/src/ThirdBodyMgr.h @@ -44,7 +44,7 @@ namespace Cantera { } void multiply(doublereal* output, const_workPtr work) { - _scatter_mult(work, work + m_n, + scatter_mult(work, work + m_n, output, m_reaction_index.begin()); } diff --git a/Cantera/src/misc.cpp b/Cantera/src/misc.cpp index 05bdbb6cb..6d4116e25 100755 --- a/Cantera/src/misc.cpp +++ b/Cantera/src/misc.cpp @@ -105,13 +105,13 @@ namespace Cantera { void setDefaultDirectories(); /// Pointer to the single Application instance - static Application* __app = 0; + static Application* s_app = 0; - Unit* Unit::__u = 0; + Unit* Unit::s_u = 0; static void appinit() { - if (__app == 0) { - __app = new Application; + if (s_app == 0) { + s_app = new Application; } } @@ -120,9 +120,9 @@ namespace Cantera { * application if leak checking is to be done. */ void appdelete() { - if (__app) { - delete __app; - __app = 0; + if (s_app) { + delete s_app; + s_app = 0; } SpeciesThermoFactory::deleteFactory(); ThermoFactory::deleteFactory(); @@ -131,11 +131,11 @@ namespace Cantera { } Application* app() { - if (__app == 0) { - __app = new Application; + if (s_app == 0) { + s_app = new Application; setDefaultDirectories(); } - return __app; + return s_app; } @@ -205,7 +205,7 @@ namespace Cantera { cout << "get_XML_File(): File, " << ff << ", was previously read." << " Retrieving the storred xml tree." << endl; #endif - return __app->xmlfiles[ff]; + return s_app->xmlfiles[ff]; } /* * Ok, we didn't find the processed XML tree. Do the conversion @@ -226,7 +226,7 @@ namespace Cantera { if (s) { x->build(s); x->lock(); - __app->xmlfiles[ff] = x; + s_app->xmlfiles[ff] = x; } else { string estring = "cannot open "+ff+" for reading."; @@ -239,7 +239,7 @@ namespace Cantera { * lookup operation in the return statement will return a valid * pointer. */ - return __app->xmlfiles[ff]; + return s_app->xmlfiles[ff]; } void close_XML_File(string file) { @@ -249,14 +249,14 @@ namespace Cantera { for(; b != e; ++b) { b->second->unlock(); delete b->second; - __app->xmlfiles.erase(b->first); + s_app->xmlfiles.erase(b->first); } } else if (app()->xmlfiles.find(file) != app()->xmlfiles.end()) { - __app->xmlfiles[file]->unlock(); - delete __app->xmlfiles[file]; - __app->xmlfiles.erase(file); + s_app->xmlfiles[file]->unlock(); + delete s_app->xmlfiles[file]; + s_app->xmlfiles.erase(file); } } @@ -282,8 +282,8 @@ namespace Cantera { void popError() { appinit(); if (nErrors() > 0) { - __app->errorMessage.pop_back(); - __app->errorRoutine.pop_back(); + s_app->errorMessage.pop_back(); + s_app->errorRoutine.pop_back(); } } @@ -300,8 +300,8 @@ namespace Cantera { "\n\n************************************************\n" " Cantera Error! \n" "************************************************\n\n"; - return head+string("\nProcedure: ")+__app->errorRoutine.back() - +string("\nError: ")+__app->errorMessage.back(); + return head+string("\nProcedure: ")+s_app->errorRoutine.back() + +string("\nError: ")+s_app->errorMessage.back(); } else { return ""; @@ -318,7 +318,7 @@ namespace Cantera { */ void showErrors(ostream& f) { appinit(); - int i = static_cast(__app->errorMessage.size()); + int i = static_cast(s_app->errorMessage.size()); if (i == 0) return; f << endl << endl; f << "************************************************" << endl; @@ -328,12 +328,12 @@ namespace Cantera { int j; for (j = 0; j < i; j++) { f << endl; - f << "Procedure: " << __app->errorRoutine[j] << endl; - f << "Error: " << __app->errorMessage[j] << endl; + f << "Procedure: " << s_app->errorRoutine[j] << endl; + f << "Error: " << s_app->errorMessage[j] << endl; } f << endl << endl; - __app->errorMessage.clear(); - __app->errorRoutine.clear(); + s_app->errorMessage.clear(); + s_app->errorRoutine.clear(); } /** @@ -346,7 +346,7 @@ namespace Cantera { */ void showErrors() { appinit(); - int i = static_cast(__app->errorMessage.size()); + int i = static_cast(s_app->errorMessage.size()); if (i == 0) return; writelog("\n\n"); writelog("************************************************\n"); @@ -355,12 +355,12 @@ namespace Cantera { int j; for (j = 0; j < i; j++) { writelog("\n"); - writelog(string("Procedure: ")+ __app->errorRoutine[j]+" \n"); - writelog(string("Error: ")+__app->errorMessage[j]+" \n"); + writelog(string("Procedure: ")+ s_app->errorRoutine[j]+" \n"); + writelog(string("Error: ")+s_app->errorMessage[j]+" \n"); } writelog("\n\n"); - __app->errorMessage.clear(); - __app->errorRoutine.clear(); + s_app->errorMessage.clear(); + s_app->errorRoutine.clear(); } /** @@ -373,8 +373,8 @@ namespace Cantera { */ void setError(string r, string msg) { appinit(); - __app->errorMessage.push_back(msg); - __app->errorRoutine.push_back(r); + s_app->errorMessage.push_back(msg); + s_app->errorRoutine.push_back(r); } /// @defgroup inputfiles Input File Handling @@ -411,7 +411,7 @@ namespace Cantera { */ void setDefaultDirectories() { appinit(); - vector& dirs = __app->inputDirs; + vector& dirs = s_app->inputDirs; // always look in the local directory first dirs.push_back("."); @@ -475,15 +475,15 @@ namespace Cantera { /// @ingroup inputfiles void addDirectory(string dir) { appinit(); - if (__app->inputDirs.size() == 0) setDefaultDirectories(); + if (s_app->inputDirs.size() == 0) setDefaultDirectories(); string d = stripnonprint(dir); - size_t m, n = __app->inputDirs.size(); + size_t m, n = s_app->inputDirs.size(); // don't add if already present for (m = 0; m < n; m++) - if (d == __app->inputDirs[m]) return; + if (d == s_app->inputDirs[m]) return; - __app->inputDirs.push_back(stripnonprint(dir)); + s_app->inputDirs.push_back(stripnonprint(dir)); } /*! @@ -513,7 +513,7 @@ namespace Cantera { string::size_type islash = name.find('/'); string::size_type ibslash = name.find('\\'); string inname; - vector& dirs = __app->inputDirs; + vector& dirs = s_app->inputDirs; if (dirs.size() == 0) setDefaultDirectories(); int nd; @@ -672,8 +672,8 @@ namespace Cantera { /// @ingroup textlogs void setLogger(Logger* logwriter) { appinit(); - delete __app->logwriter; - __app->logwriter = logwriter; + delete s_app->logwriter; + s_app->logwriter = logwriter; } #ifdef WITH_HTML_LOGS @@ -711,48 +711,48 @@ namespace Cantera { /// @ingroup HTML_logs void beginLogGroup(string title, int loglevel) { appinit(); - if (loglevel != -99) __app->loglevel = loglevel; - else __app->loglevel--; - __app->loglevels.push_back(__app->loglevel); - __app->loggroups.push_back(title); - if (__app->loglevel <= 0) return; - if (__app->xmllog == 0) { - __app->xmllog = new XML_Node("html"); - __app->current = &__app->xmllog->addChild("ul"); + if (loglevel != -99) s_app->loglevel = loglevel; + else s_app->loglevel--; + s_app->loglevels.push_back(s_app->loglevel); + s_app->loggroups.push_back(title); + if (s_app->loglevel <= 0) return; + if (s_app->xmllog == 0) { + s_app->xmllog = new XML_Node("html"); + s_app->current = &s_app->xmllog->addChild("ul"); } - __app->current = &__app->current->addChild("li",""+title+""); - __app->current = &__app->current->addChild("ul"); + s_app->current = &s_app->current->addChild("li",""+title+""); + s_app->current = &s_app->current->addChild("ul"); } /// Add an entry to the log file. Entries appear in the form "tag: /// value". /// @ingroup HTML_logs void addLogEntry(string tag, string value) { - if (__app->loglevel > 0) - __app->current->addChild("li",tag+": "+value); + if (s_app->loglevel > 0) + s_app->current->addChild("li",tag+": "+value); } /// Add an entry to the log file. Entries appear in the form "tag: /// value". /// @ingroup HTML_logs void addLogEntry(string tag, doublereal value) { - if (__app->loglevel > 0) - __app->current->addChild("li",tag+": "+fp2str(value)); + if (s_app->loglevel > 0) + s_app->current->addChild("li",tag+": "+fp2str(value)); } /// Add an entry to the log file. Entries appear in the form "tag: /// value". /// @ingroup HTML_logs void addLogEntry(string tag, int value) { - if (__app->loglevel > 0) - __app->current->addChild("li",tag+": "+int2str(value)); + if (s_app->loglevel > 0) + s_app->current->addChild("li",tag+": "+int2str(value)); } /// Add an entry to the log file. /// @ingroup HTML_logs void addLogEntry(string msg) { - if (__app->loglevel > 0) - __app->current->addChild("li",msg); + if (s_app->loglevel > 0) + s_app->current->addChild("li",msg); } /// Close the current group of log messages. This is typically @@ -763,27 +763,27 @@ namespace Cantera { /// beginLogGroup is called first to create a new group. /// @ingroup HTML_logs void endLogGroup(string title) { - if (__app->loglevel > 0) { - __app->current = __app->current->parent(); - __app->current = __app->current->parent(); + if (s_app->loglevel > 0) { + s_app->current = s_app->current->parent(); + s_app->current = s_app->current->parent(); } - __app->loglevels.pop_back(); - __app->loglevel = __app->loglevels.back(); - if (title != "" && title != __app->loggroups.back()) { + s_app->loglevels.pop_back(); + s_app->loglevel = s_app->loglevels.back(); + if (title != "" && title != s_app->loggroups.back()) { writelog("Logfile error." - "\n beginLogGroup: "+ __app->loggroups.back()+ + "\n beginLogGroup: "+ s_app->loggroups.back()+ "\n endLogGroup: "+title+"\n"); write_logfile("logerror"); - //__app->loggroups.clear(); - //__app->loglevels.clear(); + //s_app->loggroups.clear(); + //s_app->loglevels.clear(); } - else if (__app->loggroups.size() == 1) { - write_logfile(__app->loggroups.back()+"_log"); - __app->loggroups.clear(); - __app->loglevels.clear(); + else if (s_app->loggroups.size() == 1) { + write_logfile(s_app->loggroups.back()+"_log"); + s_app->loggroups.clear(); + s_app->loglevels.clear(); } else - __app->loggroups.pop_back(); + s_app->loggroups.pop_back(); } /// Write the HTML log file. Log entries are stored in memory in @@ -796,7 +796,7 @@ namespace Cantera { /// file will be overwritten. will be appended to the name. /// @ingroup HTML_logs void write_logfile(string file) { - if (!__app->xmllog) { + if (!s_app->xmllog) { return; } string::size_type idot = file.rfind('.'); @@ -830,15 +830,15 @@ namespace Cantera { // existing file. Open it as an output stream, and dump the // XML (HTML) tree to it. - if (__app->xmllog) { + if (s_app->xmllog) { ofstream f(fname.c_str()); // go to the top of the tree, and write it all. - __app->xmllog->root().write(f); + s_app->xmllog->root().write(f); f.close(); writelog("Log file " + fname + " written.\n"); - delete __app->xmllog; - __app->xmllog = 0; - __app->current = 0; + delete s_app->xmllog; + s_app->xmllog = 0; + s_app->current = 0; } } diff --git a/Cantera/src/transport/TransportFactory.cpp b/Cantera/src/transport/TransportFactory.cpp index 8bb56c138..cfe2d4d1e 100755 --- a/Cantera/src/transport/TransportFactory.cpp +++ b/Cantera/src/transport/TransportFactory.cpp @@ -44,7 +44,7 @@ namespace Cantera { - TransportFactory* TransportFactory::__factory = 0; + TransportFactory* TransportFactory::s_factory = 0; ////////////////////////// exceptions ///////////////////////// @@ -268,9 +268,9 @@ namespace Cantera { * This static function deletes the statically allocated instance. */ void TransportFactory::deleteTransportFactory() { - if (__factory) { - delete __factory; - __factory = 0; + if (s_factory) { + delete s_factory; + s_factory = 0; } } diff --git a/Cantera/src/transport/TransportFactory.h b/Cantera/src/transport/TransportFactory.h index dd180bfbe..e95562658 100755 --- a/Cantera/src/transport/TransportFactory.h +++ b/Cantera/src/transport/TransportFactory.h @@ -91,10 +91,10 @@ namespace Cantera { * @endcode */ static TransportFactory* factory() { - if (!__factory) { - __factory = new TransportFactory(); + if (!s_factory) { + s_factory = new TransportFactory(); } - return __factory; + return s_factory; } /** @@ -124,7 +124,7 @@ namespace Cantera { private: - static TransportFactory* __factory; + static TransportFactory* s_factory; // The constructor is private; use static method factory() to // get a pointer to a factory instance @@ -191,7 +191,7 @@ namespace Cantera { } Transport* ptr = f->newTransport(transportModel, thermo, loglevel); /* - * Note: We delete the static __factory instance here, instead of in + * Note: We delete the static s_factory instance here, instead of in * appdelete() in misc.cpp, to avoid linking problems involving * the need for multiple cantera and transport library statements * for applications that don't have transport in them. diff --git a/Cantera/src/units.h b/Cantera/src/units.h index e4eb56fb3..c28ed28a7 100644 --- a/Cantera/src/units.h +++ b/Cantera/src/units.h @@ -16,14 +16,14 @@ namespace Cantera { public: static Unit* units() { - if (!__u) __u = new Unit; - return __u; + if (!s_u) s_u = new Unit; + return s_u; } static void deleteUnit() { - if (__u) { - delete __u; - __u = 0; + if (s_u) { + delete s_u; + s_u = 0; } } @@ -119,7 +119,7 @@ namespace Cantera { private: /// pointer to the single instance of Unit - static Unit* __u; + static Unit* s_u; map m_u; map m_act_u; diff --git a/Cantera/src/utilities.h b/Cantera/src/utilities.h index 1eea7258a..2d58e5b16 100755 --- a/Cantera/src/utilities.h +++ b/Cantera/src/utilities.h @@ -73,9 +73,9 @@ namespace Cantera { /** * Inner product. */ - template - inline doublereal dot(_InputIter x_begin, _InputIter x_end, - _InputIter2 y_begin) { + template + inline doublereal dot(InputIter x_begin, InputIter x_end, + InputIter2 y_begin) { doublereal sum = 0.0; for(; x_begin != x_end; ++x_begin, ++y_begin) sum += *x_begin * *y_begin; @@ -89,26 +89,26 @@ namespace Cantera { * scale(in.begin(), in.end(), out.begin(), factor); * \endcode */ - template - inline void scale(_InputIter __begin, _InputIter __end, - _OutputIter __out, S scale_factor) { - for (; __begin != __end; ++__begin, ++__out) - *__out = scale_factor * *__begin; + template + inline void scale(InputIter begin, InputIter end, + OutputIter out, S scale_factor) { + for (; begin != end; ++begin, ++out) + *out = scale_factor * *begin; } - template - inline void increment_scale(_InputIter __begin, _InputIter __end, - _OutputIter __out, S scale_factor) { - for (; __begin != __end; ++__begin, ++__out) - *__out += scale_factor * *__begin; + template + inline void increment_scale(InputIter begin, InputIter end, + OutputIter out, S scale_factor) { + for (; begin != end; ++begin, ++out) + *out += scale_factor * *begin; } /** * Multiply each entry in x by the corresponding entry in y. */ - template - inline void multiply_each(_OutputIter x_begin, _OutputIter x_end, - _InputIter y_begin) { + template + inline void multiply_each(OutputIter x_begin, OutputIter x_end, + InputIter y_begin) { for(; x_begin != x_end; ++x_begin, ++y_begin) *x_begin *= *y_begin; } @@ -116,47 +116,47 @@ namespace Cantera { /** * Invoke method 'resize' with argument \a m for a sequence of objects. */ - template - inline void _resize_each(int m, _InputIter __begin, _InputIter __end) { - for(; __begin != __end; ++__begin) __begin->resize(m); + template + inline void resize_each(int m, InputIter begin, InputIter end) { + for(; begin != end; ++begin) begin->resize(m); } /** * The maximum absolute value. */ - template - inline doublereal absmax(_InputIter __begin, _InputIter __end) { + template + inline doublereal absmax(InputIter begin, InputIter end) { doublereal amax = 0.0; - for(; __begin != __end; ++__begin) - if (fabs(*__begin) > amax) amax = fabs(*__begin); + for(; begin != end; ++begin) + if (fabs(*begin) > amax) amax = fabs(*begin); return amax; } /** * Normalize the values in a sequence, such that they sum to 1.0. */ - template - inline void normalize(_InputIter __begin, _InputIter __end, - _OutputIter __out) { - doublereal sum = accumulate(__begin, __end, 0.0); - for (; __begin != __end; ++__begin, ++__out) *__out = *__begin/sum; + template + inline void normalize(InputIter begin, InputIter end, + OutputIter out) { + doublereal sum = accumulate(begin, end, 0.0); + for (; begin != end; ++begin, ++out) *out = *begin/sum; } /** * Divide each element of \a x by the corresponding element of \a y. */ - template - inline void divide_each(_OutputIter x_begin, _OutputIter x_end, - _InputIter y_begin) { + template + inline void divide_each(OutputIter x_begin, OutputIter x_end, + InputIter y_begin) { for(; x_begin != x_end; ++x_begin, ++y_begin) *x_begin /= *y_begin; } /** * Increment each entry in \a x by the corresponding entry in \a y. */ - template - inline void sum_each(_OutputIter x_begin, _OutputIter x_end, - _InputIter y_begin) { + template + inline void sum_each(OutputIter x_begin, OutputIter x_end, + InputIter y_begin) { for(; x_begin != x_end; ++x_begin, ++y_begin) *x_begin += *y_begin; } @@ -169,14 +169,14 @@ namespace Cantera { * index[0] = 9; * index[1] = 2; * index[3] = 16; - * _scatter_copy(x.begin(), x.end(), y.begin(), index.begin()); + * scatter_copy(x.begin(), x.end(), y.begin(), index.begin()); * \endcode */ - template - inline void _scatter_copy(_InputIter __begin, _InputIter __end, - _OutputIter __result, _IndexIter __index) { - for (; __begin != __end; ++__begin, ++__index) { - *(__result + *__index) = *__begin; + template + inline void scatter_copy(InputIter begin, InputIter end, + OutputIter result, IndexIter index) { + for (; begin != end; ++begin, ++index) { + *(result + *index) = *begin; } } @@ -190,16 +190,16 @@ namespace Cantera { * vector_fp data(20); * ... * // multiply elements 7, 4, and 13 in data by multipliers - * _scatter_mult(multipliers, multipliers + 3, data.begin(), + * scatter_mult(multipliers, multipliers + 3, data.begin(), * index); * \endcode */ - template - inline void _scatter_mult(_InputIter __mult_begin, _InputIter __mult_end, - _RandAccessIter __data, _IndexIter __index) { - for (; __mult_begin != __mult_end; ++__mult_begin, ++__index) { - *(__data + *__index) *= *__mult_begin; + template + inline void scatter_mult(InputIter mult_begin, InputIter mult_end, + RandAccessIter data, IndexIter index) { + for (; mult_begin != mult_end; ++mult_begin, ++index) { + *(data + *index) *= *mult_begin; } } @@ -213,15 +213,15 @@ namespace Cantera { * vector_fp data(20); * ... * // divide elements 7, 4, and 13 in data by divisors - * _scatter_divide(divisors, divisors + 3, data.begin(), + * scatter_divide(divisors, divisors + 3, data.begin(), * index); * \endcode */ - template - inline void _scatter_divide(_InputIter __begin, _InputIter __end, - _OutputIter __result, _IndexIter __index) { - for (; __begin != __end; ++__begin, ++__index) { - *(__result + *__index) /= *__begin; + template + inline void scatter_divide(InputIter begin, InputIter end, + OutputIter result, IndexIter index) { + for (; begin != end; ++begin, ++index) { + *(result + *index) /= *begin; } } @@ -229,11 +229,11 @@ namespace Cantera { * Compute \f[ \sum_k x_k \log x_k. \f]. A small number (1.0E-20) * is added before taking the log. */ - template - inline doublereal _sum_xlogx(_InputIter __begin, _InputIter __end) { + template + inline doublereal sum_xlogx(InputIter begin, InputIter end) { doublereal sum = 0.0; - for (; __begin != __end; ++__begin) { - sum += (*__begin) * log(*__begin + Tiny); + for (; begin != end; ++begin) { + sum += (*begin) * log(*begin + Tiny); } return sum; } @@ -242,12 +242,12 @@ namespace Cantera { * Compute \f[ \sum_k x_k \log Q_k. \f]. A small number (1.0E-20) * is added before taking the log. */ - template - inline doublereal _sum_xlogQ(_InputIter1 __begin, _InputIter1 __end, - _InputIter2 _Q_begin) { + template + inline doublereal sum_xlogQ(InputIter1 begin, InputIter1 end, + InputIter2 Q_begin) { doublereal sum = 0.0; - for (; __begin != __end; ++__begin, ++_Q_begin) { - sum += (*__begin) * log(*_Q_begin + Tiny); + for (; begin != end; ++begin, ++Q_begin) { + sum += (*begin) * log(*Q_begin + Tiny); } return sum; } diff --git a/Cantera/src/vec_functions.h b/Cantera/src/vec_functions.h index de5e9e133..0c2b5eb94 100755 --- a/Cantera/src/vec_functions.h +++ b/Cantera/src/vec_functions.h @@ -72,7 +72,7 @@ namespace Cantera { */ template inline doublereal dot_ratio(const T& x, const T& y) { - return __dot_ratio(x.begin(), x.end(), y.begin(), 0.0); + return _dot_ratio(x.begin(), x.end(), y.begin(), 0.0); } /** @@ -84,11 +84,11 @@ namespace Cantera { x.begin(), plus()); } - template - inline doublereal __dot_ratio(_InputIter __x_begin, _InputIter __x_end, - _InputIter __y_begin, S start_value) { - for (; __x_begin != __x_end; ++__x_begin, ++__y_begin) - start_value += *__x_begin / *__y_begin; + template + inline doublereal _dot_ratio(InputIter x_begin, InputIter x_end, + InputIter y_begin, S start_value) { + for (; x_begin != x_end; ++x_begin, ++y_begin) + start_value += *x_begin / *y_begin; return start_value; } diff --git a/test_problems/silane_equil/Makefile.in b/test_problems/silane_equil/Makefile.in index 69486fc5f..fad215e5b 100644 --- a/test_problems/silane_equil/Makefile.in +++ b/test_problems/silane_equil/Makefile.in @@ -48,7 +48,7 @@ CANTERA_LIBS = @LOCAL_LIBS@ -lctcxx CANTERA_INCDIR=@ctroot@/build/include/cantera # flags passed to the C++ compiler/linker for the linking step -LCXX_FLAGS = -L$(CANTERA_LIBDIR) @CXXFLAGS@ +LCXX_FLAGS = -L$(CANTERA_LIBDIR) @LOCAL_LIB_DIRS@ @CXXFLAGS@ # How to compile C++ source files to object files .@CXX_EXT@.@OBJ_EXT@: diff --git a/test_problems/surfkin/Makefile.in b/test_problems/surfkin/Makefile.in index 81405f106..738a153b0 100644 --- a/test_problems/surfkin/Makefile.in +++ b/test_problems/surfkin/Makefile.in @@ -49,7 +49,7 @@ CANTERA_LIBS = @LOCAL_LIBS@ -lctcxx CANTERA_INCDIR=@ctroot@/build/include/cantera # flags passed to the C++ compiler/linker for the linking step -LCXX_FLAGS = -L$(CANTERA_LIBDIR) @CXXFLAGS@ +LCXX_FLAGS = -L$(CANTERA_LIBDIR) @LOCAL_LIB_DIRS@ @CXXFLAGS@ # how to compile C++ source files to object files .@CXX_EXT@.@OBJ_EXT@: Interface.h diff --git a/tools/src/Makefile.in b/tools/src/Makefile.in index 26d2a99d1..d80aff6ad 100755 --- a/tools/src/Makefile.in +++ b/tools/src/Makefile.in @@ -5,7 +5,7 @@ INCDIR = -I@ctroot@/Cantera/src BINDIR = @buildbin@ build_ck = @BUILD_CK@ -LCXX_FLAGS = -L$(LIBDIR) @CXXFLAGS@ +LCXX_FLAGS = -L$(LIBDIR) @LOCAL_LIB_DIRS@ @CXXFLAGS@ LOCAL_LIBS = -lcantera -ltpx -lctcxx #LOCAL_LIBS = -lcantera @math_libs@ @BLAS_LAPACK_LIBS@ -lctcxx diff --git a/tools/src/ctlibsample.mak.in b/tools/src/ctlibsample.mak.in index 7d8f973dc..75155451e 100755 --- a/tools/src/ctlibsample.mak.in +++ b/tools/src/ctlibsample.mak.in @@ -57,7 +57,7 @@ CANTERA_LIBS = -lct -lcantera -lckreader CANTERA_INCDIR=@CANTERA_INCDIR@ # flags passed to the C++ compiler/linker for the linking step -LCXX_FLAGS = -L$(CANTERA_LIBDIR) @CXXFLAGS@ +LCXX_FLAGS = -L$(CANTERA_LIBDIR) @LOCAL_LIB_DIRS@ @CXXFLAGS@ # how to compile C++ source files to object files .@CXX_EXT@.@OBJ_EXT@: diff --git a/tools/src/sample.mak.in b/tools/src/sample.mak.in index 23b989e43..bf53ca20e 100755 --- a/tools/src/sample.mak.in +++ b/tools/src/sample.mak.in @@ -53,7 +53,7 @@ CANTERA_LIBS = CANTERA_INCDIR=@CANTERA_INCDIR@ # flags passed to the C++ compiler/linker for the linking step -LCXX_FLAGS = -L$(CANTERA_LIBDIR) @CXXFLAGS@ +LCXX_FLAGS = -L$(CANTERA_LIBDIR) @LOCAL_LIB_DIRS@ @CXXFLAGS@ # how to compile C++ source files to object files .@CXX_EXT@.@OBJ_EXT@: diff --git a/tools/src/sample_f90.mak.in b/tools/src/sample_f90.mak.in index 166cb3981..62beb142a 100755 --- a/tools/src/sample_f90.mak.in +++ b/tools/src/sample_f90.mak.in @@ -60,7 +60,7 @@ CANTERA_LIBS = -lctf -lcantera -lckreader CANTERA_INCDIR=@CANTERA_INCDIR@ # flags passed to the C++ compiler/linker for the linking step -LCXX_FLAGS = -L$(CANTERA_LIBDIR) @CXXFLAGS@ +LCXX_FLAGS = -L$(CANTERA_LIBDIR) @LOCAL_LIB_DIRS@ @CXXFLAGS@ # how to compile C++ source files to object files .@CXX_EXT@.@OBJ_EXT@: diff --git a/tools/testtools/Makefile.in b/tools/testtools/Makefile.in index 046fe2983..bbc75e254 100644 --- a/tools/testtools/Makefile.in +++ b/tools/testtools/Makefile.in @@ -5,7 +5,7 @@ INCDIR = @ctroot@/build/include/cantera BINDIR = @ctroot@/bin build_ck = @BUILD_CK@ -LCXX_FLAGS = -L$(LIBDIR) @CXXFLAGS@ +LCXX_FLAGS = -L$(LIBDIR) @LOCAL_LIB_DIRS@ @CXXFLAGS@ LOCAL_LIBS = -lcantera -lckreader @math_libs@ @LAPACK_LIBRARY@ @BLAS_LIBRARY@ -lctcxx LCXX_END_LIBS = @LCXX_END_LIBS@