From 9373fe02f73390416ea4a6ed45b936f89c555f48 Mon Sep 17 00:00:00 2001 From: Harry Moffat Date: Wed, 27 Oct 2010 21:07:15 +0000 Subject: [PATCH] These routines needed std:: added to the arguments and function bodies of std c++ library calls. --- Cantera/src/thermo/NasaThermo.h | 40 +++++++++++++++--------------- Cantera/src/thermo/ShomateThermo.h | 38 ++++++++++++++-------------- Cantera/src/thermo/SimpleThermo.h | 10 ++++---- 3 files changed, 44 insertions(+), 44 deletions(-) diff --git a/Cantera/src/thermo/NasaThermo.h b/Cantera/src/thermo/NasaThermo.h index 46cf02a71..7d4d81fbd 100644 --- a/Cantera/src/thermo/NasaThermo.h +++ b/Cantera/src/thermo/NasaThermo.h @@ -155,7 +155,7 @@ namespace Cantera { * parameterization. * @see speciesThermoTypes.h */ - virtual void install(string name, int index, int type, + virtual void install(std::string name, int index, int type, const doublereal* c, doublereal minTemp, doublereal maxTemp, doublereal refPressure) { @@ -164,7 +164,7 @@ namespace Cantera { int imid = int(c[0]); // midpoint temp converted to integer int igrp = m_index[imid]; // has this value been seen before? if (igrp == 0) { // if not, prepare new group - vector v; + std::vector v; m_high.push_back(v); m_low.push_back(v); m_tmid.push_back(c[0]); @@ -209,7 +209,7 @@ namespace Cantera { if (m_p0 < 0.0) { m_p0 = refPressure; } else if (fabs(m_p0 - refPressure) > 0.1) { - string logmsg = " WARNING NasaThermo: New Species, " + name + ", has a different reference pressure, " + std::string logmsg = " WARNING NasaThermo: New Species, " + name + ", has a different reference pressure, " + fp2str(refPressure) + ", than existing reference pressure, " + fp2str(m_p0) + "\n"; writelog(logmsg); logmsg = " This may become a fatal error in the future \n"; @@ -253,14 +253,14 @@ namespace Cantera { int grp = m_group_map[k]; int pos = m_posInGroup_map[k]; - const vector &mlg = m_low[grp-1]; + const std::vector &mlg = m_low[grp-1]; const NasaPoly1 *nlow = &(mlg[pos]); doublereal tmid = nlow->maxTemp(); if (t < tmid) { nlow->updateProperties(&m_t[0], cp_R, h_RT, s_R); } else { - const vector &mhg = m_high[grp-1]; + const std::vector &mhg = m_high[grp-1]; const NasaPoly1 *nhigh = &(mhg[pos]); nhigh->updateProperties(&m_t[0], cp_R, h_RT, s_R); } @@ -294,7 +294,7 @@ namespace Cantera { m_t[5] = log(t); // iterate over the groups - vector::const_iterator _begin, _end; + std::vector::const_iterator _begin, _end; for (i = 0; i != m_ngroups; i++) { if (t > m_tmid[i]) { _begin = m_high[i].begin(); @@ -391,8 +391,8 @@ namespace Cantera { if (type == NASA) { int grp = m_group_map[index]; int pos = m_posInGroup_map[index]; - const vector &mlg = m_low[grp-1]; - const vector &mhg = m_high[grp-1]; + const std::vector &mlg = m_low[grp-1]; + const std::vector &mhg = m_high[grp-1]; const NasaPoly1 *lowPoly = &(mlg[pos]); const NasaPoly1 *highPoly = &(mhg[pos]); int itype = NASA; @@ -439,8 +439,8 @@ namespace Cantera { if (type == NASA) { int grp = m_group_map[index]; int pos = m_posInGroup_map[index]; - vector &mlg = m_low[grp-1]; - vector &mhg = m_high[grp-1]; + std::vector &mlg = m_low[grp-1]; + std::vector &mhg = m_high[grp-1]; NasaPoly1 *lowPoly = &(mlg[pos]); NasaPoly1 *highPoly = &(mhg[pos]); doublereal tmid = lowPoly->maxTemp(); @@ -460,14 +460,14 @@ namespace Cantera { int grp = m_group_map[k]; int pos = m_posInGroup_map[k]; - const vector &mlg = m_low[grp-1]; + const std::vector &mlg = m_low[grp-1]; const NasaPoly1 *nlow = &(mlg[pos]); doublereal tmid = nlow->maxTemp(); double h; if (298.15 <= tmid) { h = nlow->reportHf298(0); } else { - const vector &mhg = m_high[grp-1]; + const std::vector &mhg = m_high[grp-1]; const NasaPoly1 *nhigh = &(mhg[pos]); h = nhigh->reportHf298(0); } @@ -477,9 +477,9 @@ namespace Cantera { virtual void modifyOneHf298(const int k, const doublereal Hf298New) { int grp = m_group_map[k]; int pos = m_posInGroup_map[k]; - vector &mlg = m_low[grp-1]; + std::vector &mlg = m_low[grp-1]; NasaPoly1 *nlow = &(mlg[pos]); - vector &mhg = m_high[grp-1]; + std::vector &mhg = m_high[grp-1]; NasaPoly1 *nhigh = &(mhg[pos]); doublereal tmid = nlow->maxTemp(); @@ -508,7 +508,7 @@ namespace Cantera { * The second vector is equal to the number of species * in that particular group. */ - vector > m_high; + std::vector > m_high; //! Vector of vector of NasaPoly1's for the low temp region. /*! @@ -517,13 +517,13 @@ namespace Cantera { * The second vector is equal to the number of species * in that particular group. */ - vector > m_low; + std::vector > m_low; //! Map between the midpoint temperature, as an int, to the group number /*! * Length is equal to the number of groups. Only used in the setup. */ - map m_index; + std::map m_index; //! Vector of log temperature limits /*! @@ -567,17 +567,17 @@ namespace Cantera { * for that species are stored. group indecises start at 1, * so a decrement is always performed to access vectors. */ - mutable map m_group_map; + mutable std::map m_group_map; /*! * This map takes as its index, the species index in the phase. * It returns the position index within the group, where the * temperature polynomials for that species are storred. */ - mutable map m_posInGroup_map; + mutable std::map m_posInGroup_map; //! Species name as a function of the species index - mutable map m_name; + mutable std::map m_name; private: diff --git a/Cantera/src/thermo/ShomateThermo.h b/Cantera/src/thermo/ShomateThermo.h index c37822801..06ef0bf2a 100644 --- a/Cantera/src/thermo/ShomateThermo.h +++ b/Cantera/src/thermo/ShomateThermo.h @@ -162,14 +162,14 @@ namespace Cantera { * @see ShomatePoly * @see ShomatePoly2 */ - virtual void install(string name, int index, int type, + virtual void install(std::string name, int index, int type, const doublereal* c, doublereal minTemp, doublereal maxTemp, doublereal refPressure) { int imid = int(c[0]); // midpoint temp converted to integer int igrp = m_index[imid]; // has this value been seen before? if (igrp == 0) { // if not, prepare new group - vector v; + std::vector v; m_high.push_back(v); m_low.push_back(v); m_tmid.push_back(c[0]); @@ -201,7 +201,7 @@ namespace Cantera { if (m_p0 < 0.0) { m_p0 = refPressure; } else if (fabs(m_p0 - refPressure) > 0.1) { - string logmsg = " WARNING ShomateThermo: New Species, " + name + std::string logmsg = " WARNING ShomateThermo: New Species, " + name + ", has a different reference pressure, " + fp2str(refPressure) + ", than existing reference pressure, " + fp2str(m_p0) + "\n"; writelog(logmsg); @@ -247,14 +247,14 @@ namespace Cantera { int grp = m_group_map[k]; int pos = m_posInGroup_map[k]; - const vector &mlg = m_low[grp-1]; + const std::vector &mlg = m_low[grp-1]; const ShomatePoly *nlow = &(mlg[pos]); doublereal tmid = nlow->maxTemp(); if (t < tmid) { nlow->updateProperties(&m_t[0], cp_R, h_RT, s_R); } else { - const vector &mhg = m_high[grp-1]; + const std::vector &mhg = m_high[grp-1]; const ShomatePoly *nhigh = &(mhg[pos]); nhigh->updateProperties(&m_t[0], cp_R, h_RT, s_R); } @@ -288,7 +288,7 @@ namespace Cantera { m_t[5] = 1.0/GasConstant; m_t[6] = 1.0/(GasConstant * t); - vector::const_iterator _begin, _end; + std::vector::const_iterator _begin, _end; for (i = 0; i != m_ngroups; i++) { if (t > m_tmid[i]) { _begin = m_high[i].begin(); @@ -387,8 +387,8 @@ namespace Cantera { int grp = m_group_map[index]; int pos = m_posInGroup_map[index]; int itype = SHOMATE; - const vector &mlg = m_low[grp-1]; - const vector &mhg = m_high[grp-1]; + const std::vector &mlg = m_low[grp-1]; + const std::vector &mhg = m_high[grp-1]; const ShomatePoly *lowPoly = &(mlg[pos]); const ShomatePoly *highPoly = &(mhg[pos]); doublereal tmid = lowPoly->maxTemp(); @@ -427,8 +427,8 @@ namespace Cantera { if (type == SHOMATE) { int grp = m_group_map[index]; int pos = m_posInGroup_map[index]; - vector &mlg = m_low[grp-1]; - vector &mhg = m_high[grp-1]; + std::vector &mlg = m_low[grp-1]; + std::vector &mhg = m_high[grp-1]; ShomatePoly *lowPoly = &(mlg[pos]); ShomatePoly *highPoly = &(mhg[pos]); doublereal tmid = lowPoly->maxTemp(); @@ -453,14 +453,14 @@ namespace Cantera { int grp = m_group_map[k]; int pos = m_posInGroup_map[k]; - const vector &mlg = m_low[grp-1]; + const std::vector &mlg = m_low[grp-1]; const ShomatePoly *nlow = &(mlg[pos]); doublereal tmid = nlow->maxTemp(); if (t <= tmid) { h = nlow->reportHf298(); } else { - const vector &mhg = m_high[grp-1]; + const std::vector &mhg = m_high[grp-1]; const ShomatePoly *nhigh = &(mhg[pos]); h = nhigh->reportHf298(); } @@ -471,9 +471,9 @@ namespace Cantera { int grp = m_group_map[k]; int pos = m_posInGroup_map[k]; - vector &mlg = m_low[grp-1]; + std::vector &mlg = m_low[grp-1]; ShomatePoly *nlow = &(mlg[pos]); - vector &mhg = m_high[grp-1]; + std::vector &mhg = m_high[grp-1]; ShomatePoly *nhigh = &(mhg[pos]); doublereal tmid = nlow->maxTemp(); @@ -504,7 +504,7 @@ namespace Cantera { * The second vector is equal to the number of species * in that particular group. */ - vector > m_high; + std::vector > m_high; //! Vector of vector of NasaPoly1's for the low temp region. /*! @@ -513,13 +513,13 @@ namespace Cantera { * The second vector is equal to the number of species * in that particular group. */ - vector > m_low; + std::vector > m_low; //! Map between the midpoint temperature, as an int, to the group number /*! * Length is equal to the number of groups. Only used in the setup. */ - map m_index; + std::map m_index; //! Vector of log temperature limits /*! @@ -563,14 +563,14 @@ namespace Cantera { * for that species are stored. group indecises start at 1, * so a decrement is always performed to access vectors. */ - mutable map m_group_map; + mutable std::map m_group_map; /*! * This map takes as its index, the species index in the phase. * It returns the position index within the group, where the * temperature polynomials for that species are storred. */ - mutable map m_posInGroup_map; + mutable std::map m_posInGroup_map; }; } diff --git a/Cantera/src/thermo/SimpleThermo.h b/Cantera/src/thermo/SimpleThermo.h index e0536259f..cced50e0c 100644 --- a/Cantera/src/thermo/SimpleThermo.h +++ b/Cantera/src/thermo/SimpleThermo.h @@ -13,6 +13,7 @@ #define CT_SIMPLETHERMO_H #include "SpeciesThermoMgr.h" +#include "speciesThermoTypes.h" namespace Cantera { @@ -150,10 +151,9 @@ namespace Cantera { * * @see ConstCpPoly */ - virtual void install(string name, int index, int type, - const doublereal* c, + virtual void install(std::string name, int index, int type, const doublereal* c, doublereal minTemp, doublereal maxTemp, doublereal refPressure) { - //writelog("installing const_cp for species "+name+"\n"); + m_logt0.push_back(log(c[0])); m_t0.push_back(c[0]); m_h0_R.push_back(c[1]/GasConstant); @@ -178,7 +178,7 @@ namespace Cantera { if (m_p0 < 0.0) { m_p0 = refPressure; } else if (fabs(m_p0 - refPressure) > 0.1) { - string logmsg = " WARNING SimpleThermo: New Species, " + name + + std::string logmsg = " WARNING SimpleThermo: New Species, " + name + ", has a different reference pressure, " + fp2str(refPressure) + ", than existing reference pressure, " + fp2str(m_p0) + "\n"; writelog(logmsg); @@ -382,7 +382,7 @@ namespace Cantera { * This index keeps track of it. * indexData = m_loc[kspec] */ - mutable map m_loc; + mutable std::map m_loc; //! Map between the vector index where the coefficients are kept and the species index /*!