From b5b536ff831796746d18b61b723147ad19cbf6ef Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Mon, 16 Jul 2012 22:19:10 +0000 Subject: [PATCH] Removed some deprecated code --- include/cantera/base/xml.h | 26 ----------- include/cantera/equil/MultiPhase.h | 16 ------- include/cantera/thermo/ConstDensityThermo.h | 23 --------- include/cantera/thermo/DebyeHuckel.h | 11 ----- include/cantera/thermo/HMWSoln.h | 11 ----- include/cantera/thermo/IdealGasPhase.h | 23 --------- include/cantera/thermo/IdealMolalSoln.h | 11 ----- include/cantera/thermo/IdealSolidSolnPhase.h | 9 ---- include/cantera/thermo/SurfPhase.h | 30 ------------ include/cantera/transport/TransportBase.h | 2 +- src/base/xml.cpp | 49 -------------------- src/clib/ct.cpp | 12 ----- src/equil/MultiPhase.cpp | 7 +-- src/kinetics/GRI_30_Kinetics.cpp | 10 ++-- src/matlab/mllogger.h | 4 -- src/python/pylogger.h | 4 -- src/thermo/ConstDensityThermo.cpp | 2 - src/thermo/DebyeHuckel.cpp | 4 -- src/thermo/HMWSoln.cpp | 4 -- src/thermo/IdealGasPhase.cpp | 2 - src/thermo/IdealMolalSoln.cpp | 4 -- src/thermo/IdealSolidSolnPhase.cpp | 16 ------- src/thermo/SurfPhase.cpp | 17 ------- 23 files changed, 8 insertions(+), 289 deletions(-) diff --git a/include/cantera/base/xml.h b/include/cantera/base/xml.h index 5ea427d7c..32fff945f 100644 --- a/include/cantera/base/xml.h +++ b/include/cantera/base/xml.h @@ -49,32 +49,6 @@ public: */ void getchr(char& ch); - //! Returns string 'aline' stripped of leading and trailing white - //! space. - /*! - * White space is defined by the ISO C function isspace(), and - * includes tabs, spaces, \\n. \\r, \\v, and \\f. - * - * @param aline Input line to be stripped - * - * @return Returns a string stripped of leading and trailing white - * space. - * - * @deprecated Use stripws (in stringUtils.h) - */ - DEPRECATED(std::string strip(const std::string& aline) const); - - //! Looks for a substring within 'aline' enclosed in double - //! quotes, and returns this substring (without the quotes) if - //! found. If not, an empty string is returned. - /*! - * - * @param aline This is the input string to be searched - * - * @deprecated why is this a class method? - */ - DEPRECATED(std::string inquotes(const std::string& aline) const); - //! Searches a string for the first occurrence of a valid //! quoted string. /*! diff --git a/include/cantera/equil/MultiPhase.h b/include/cantera/equil/MultiPhase.h index 174cc316b..792b11c67 100644 --- a/include/cantera/equil/MultiPhase.h +++ b/include/cantera/equil/MultiPhase.h @@ -554,22 +554,6 @@ public: // These methods are meant for internal use. - //! Update the locally-stored composition within this object - //! to match the current compositions of the phase objects. - /*! - * - * @deprecated 'update' is confusing within this context. - * Switching to the terminology 'uploadFrom' - * and 'downloadTo'. uploadFrom means to - * query the underlying ThermoPhase objects and - * fill in the resulting information within - * this object. downloadTo means to take information - * from this object and put it into the underlying - * ThermoPhase objects. - * switch to uploadMoleFractionsFromPhases(); - */ - DEPRECATED(void updateMoleFractions()); - //! Update the locally-stored composition within this object //! to match the current compositions of the phase objects. /*! diff --git a/include/cantera/thermo/ConstDensityThermo.h b/include/cantera/thermo/ConstDensityThermo.h index c6620822b..d24a35d8a 100644 --- a/include/cantera/thermo/ConstDensityThermo.h +++ b/include/cantera/thermo/ConstDensityThermo.h @@ -299,23 +299,6 @@ public: return m_cp0_R; } - //! Set the potential energy of species k - /*! - * @param k species index - * @param pe Potential energy (J kmol-1). - */ - virtual void setPotentialEnergy(int k, doublereal pe) { - m_pe[k] = pe; - } - - //! Returns the potential energy of species k - /*! - * @param k species index - */ - virtual doublereal potentialEnergy(int k) const { - return m_pe[k]; - } - //! Initialize the ThermoPhase object after all species have been set up /*! * @internal Initialize. @@ -433,12 +416,6 @@ protected: //! Temporary storage for dimensionless reference state entropies mutable vector_fp m_s0_R; - //! Currently unused - /* - * @deprecated - */ - mutable vector_fp m_pe; - //! Temporary array containing internally calculated partial pressures mutable vector_fp m_pp; diff --git a/include/cantera/thermo/DebyeHuckel.h b/include/cantera/thermo/DebyeHuckel.h index f36f7857b..0bcf6f146 100644 --- a/include/cantera/thermo/DebyeHuckel.h +++ b/include/cantera/thermo/DebyeHuckel.h @@ -1669,17 +1669,6 @@ protected: */ WaterProps* m_waterProps; - /** - * Vector containing the species reference exp(-G/RT) functions - * at T = m_tlast - */ - mutable vector_fp m_expg0_RT; - - /** - * Vector of potential energies for the species. - */ - mutable vector_fp m_pe; - /** * Temporary array used in equilibrium calculations */ diff --git a/include/cantera/thermo/HMWSoln.h b/include/cantera/thermo/HMWSoln.h index 5e19f96ab..1dc878d9c 100644 --- a/include/cantera/thermo/HMWSoln.h +++ b/include/cantera/thermo/HMWSoln.h @@ -2521,17 +2521,6 @@ private: */ WaterProps* m_waterProps; - /** - * Vector containing the species reference exp(-G/RT) functions - * at T = m_tlast - */ - mutable vector_fp m_expg0_RT; - - /** - * Vector of potential energies for the species. - */ - mutable vector_fp m_pe; - /** * Temporary array used in equilibrium calculations */ diff --git a/include/cantera/thermo/IdealGasPhase.h b/include/cantera/thermo/IdealGasPhase.h index b2c01ece0..315014876 100644 --- a/include/cantera/thermo/IdealGasPhase.h +++ b/include/cantera/thermo/IdealGasPhase.h @@ -803,19 +803,6 @@ public: return m_g0_RT; } - //! Returns a reference to the exponent of the dimensionless reference state Gibbs Free energy vector. - /*! - * This function is part of the layer that checks/recalculates the reference - * state thermo functions. - */ - const vector_fp& expGibbs_RT_ref() const { - _updateThermo(); - for (size_t k = 0; k != m_kk; k++) { - m_expg0_RT[k] = std::exp(m_g0_RT[k]); - } - return m_expg0_RT; - } - //! Returns a reference to the dimensionless reference state Entropy vector. /*! * This function is part of the layer that checks/recalculates the reference @@ -923,18 +910,8 @@ protected: //! Temporary storage for dimensionless reference state entropies mutable vector_fp m_s0_R; - //! currently unsed - /*! - * @deprecated - */ mutable vector_fp m_expg0_RT; - //! Currently unused - /* - * @deprecated - */ - mutable vector_fp m_pe; - //! Temporary array containing internally calculated partial pressures mutable vector_fp m_pp; diff --git a/include/cantera/thermo/IdealMolalSoln.h b/include/cantera/thermo/IdealMolalSoln.h index 1ff25f8bc..82f25622f 100644 --- a/include/cantera/thermo/IdealMolalSoln.h +++ b/include/cantera/thermo/IdealMolalSoln.h @@ -912,17 +912,6 @@ public: private: - /** - * Vector containing the species reference exp(-G/RT) functions - * at T = m_tlast - */ - mutable vector_fp m_expg0_RT; - - /** - * Vector of potential energies for the species. - */ - mutable vector_fp m_pe; - /** * Temporary array used in equilibrium calculations */ diff --git a/include/cantera/thermo/IdealSolidSolnPhase.h b/include/cantera/thermo/IdealSolidSolnPhase.h index fefefc85f..61512c1a4 100644 --- a/include/cantera/thermo/IdealSolidSolnPhase.h +++ b/include/cantera/thermo/IdealSolidSolnPhase.h @@ -855,15 +855,6 @@ public: return m_g0_RT; } - /** - * Returns a reference to the vector of nondimensional - * enthalpies of the reference state at the current temperature. - * Real reason for its existence is that it also checks - * to see if a recalculation of the reference thermodynamics - * functions needs to be done. - */ - const vector_fp& expGibbs_RT_ref() const; - /** * Returns a reference to the vector of nondimensional * enthalpies of the reference state at the current temperature. diff --git a/include/cantera/thermo/SurfPhase.h b/include/cantera/thermo/SurfPhase.h index 69cecf6cf..6a653c6d8 100644 --- a/include/cantera/thermo/SurfPhase.h +++ b/include/cantera/thermo/SurfPhase.h @@ -430,25 +430,6 @@ public: return m_n0; } - //! Sets the potential energy of species k. - /*! - * - * @param k Species index - * @param pe Value of the potential energy (J kmol-1) - */ - void setPotentialEnergy(int k, doublereal pe); - - //! Return the potential energy of species k. - /*! - * Returns the potential energy of species, k, - * J kmol-1 - * - * @param k Species index - */ - doublereal potentialEnergy(int k) { - return m_pe[k]; - } - //! Set the site density of the surface phase (kmol m-2) /*! * @param n0 Site density of the surface phase (kmol m-2) @@ -675,17 +656,6 @@ protected: //! Temporary work array mutable vector_fp m_work; - //! Potential energy of each species in the surface phase - /*! - * @todo Fix potential energy - * Note, the potential energy terms seem to be orphaned at the moment. - * They are not connected to the Gibbs free energy calculation in - * this object - * - * @deprecated - */ - mutable vector_fp m_pe; - //! vector storing the log of the size of each species. /*! * The size of each species is defined as the number of surface diff --git a/include/cantera/transport/TransportBase.h b/include/cantera/transport/TransportBase.h index 509a207ed..6f6f51d11 100644 --- a/include/cantera/transport/TransportBase.h +++ b/include/cantera/transport/TransportBase.h @@ -337,7 +337,7 @@ public: * * The size of mobRat must be at least equal to nsp*nsp */ - DEPRECATED(virtual void mobilityRatio(double* mobRat)) { + virtual void mobilityRatio(double* mobRat) { err("mobilityRatio"); } diff --git a/src/base/xml.cpp b/src/base/xml.cpp index a4d458477..7cb00d89e 100644 --- a/src/base/xml.cpp +++ b/src/base/xml.cpp @@ -173,55 +173,6 @@ void XML_Reader::getchr(char& ch) } } - -// Returns string 'aline' stripped of leading and trailing white -// space. -// @todo why is this a class method? -std::string XML_Reader::strip(const std::string& aline) const -{ - int len = static_cast(aline.size()); - int i, j, ll; - for (i = len-1; i >= 0; i--) { - ll = aline[i]; - if (! isspace(ll)) { - break; - } - } - for (j = 0; j < i; j++) { - ll = aline[j]; - if (! isspace(ll)) { - break; - } - } - // if (aline[j] != ' ' && aline[j] != '\n') break; - return aline.substr(j, i - j + 1); -} - - -/// Looks for a substring within 'aline' enclosed in double -/// quotes, and returns this substring (without the quotes) if -/// found. If not, an empty string is returned. -/// @todo why is this a class method? -std::string XML_Reader::inquotes(const std::string& aline) const -{ - int len = static_cast(aline.size()); - int i, j; - for (i = len-1; i >= 0; i--) - if (aline[i] == '"') { - break; - } - for (j = 0; j < i; j++) - if (aline[j] == '"') { - break; - } - if (j == i) { - return ""; - } else { - return aline.substr(j+1, i - j - 1); - } -} - - //! Find the first position of a character, q, in string, s, which is not immediately preceded by the backslash character /*! * @param s Input string diff --git a/src/clib/ct.cpp b/src/clib/ct.cpp index 56faf6ad9..869d5bc3d 100644 --- a/src/clib/ct.cpp +++ b/src/clib/ct.cpp @@ -1079,18 +1079,6 @@ extern "C" { } } - int kin_getDeltaEntropy(int n, size_t len, double* deltaS) - { - try { - Kinetics& k = KineticsCabinet::item(n); - k.checkReactionArraySize(len); - k.getDeltaEntropy(deltaS); - return 0; - } catch (...) { - return handleAllExceptions(-1, ERR); - } - } - int kin_getCreationRates(int n, size_t len, double* cdot) { try { diff --git a/src/equil/MultiPhase.cpp b/src/equil/MultiPhase.cpp index ff7ca2f0b..3023f0ede 100644 --- a/src/equil/MultiPhase.cpp +++ b/src/equil/MultiPhase.cpp @@ -1130,12 +1130,7 @@ bool MultiPhase::tempOK(const index_t p) const { return m_temp_OK[p]; } -//==================================================================================================================== -/// Update the locally-stored species mole fractions. -void MultiPhase::updateMoleFractions() -{ - uploadMoleFractionsFromPhases(); -} + //==================================================================================================================== /// Update the locally-stored species mole fractions. void MultiPhase::uploadMoleFractionsFromPhases() diff --git a/src/kinetics/GRI_30_Kinetics.cpp b/src/kinetics/GRI_30_Kinetics.cpp index d89b93808..4cf368641 100644 --- a/src/kinetics/GRI_30_Kinetics.cpp +++ b/src/kinetics/GRI_30_Kinetics.cpp @@ -46,14 +46,16 @@ gri30_update_rates_T() /** * Update the equilibrium constants in molar units. - * @todo This formulation assumes an ideal gas. */ void GRI_30_Kinetics::gri30_updateKc() { - const doublereal* a = - &((IdealGasPhase*)m_thermo[0])->expGibbs_RT_ref()[0]; + vector_fp a(m_kk); + m_thermo[0]->getGibbs_RT_ref(&a[0]); + for (size_t k = 0; k < m_kk; k++) { + a[k] = exp(a[k]); + } doublereal exp_c_ref = exp(m_logc_ref); - update_kc(a, exp_c_ref, &m_rkcn[0]); + update_kc(&a[0], exp_c_ref, &m_rkcn[0]); } diff --git a/src/matlab/mllogger.h b/src/matlab/mllogger.h index 1fa812788..53e5552e7 100644 --- a/src/matlab/mllogger.h +++ b/src/matlab/mllogger.h @@ -27,10 +27,6 @@ public: virtual void error(const std::string& msg) { mexErrMsgTxt(msg.c_str()); } - - DEPRECATED(virtual int env()) { - return 1; - } }; } diff --git a/src/python/pylogger.h b/src/python/pylogger.h index f950ce244..076fa20d8 100644 --- a/src/python/pylogger.h +++ b/src/python/pylogger.h @@ -38,10 +38,6 @@ public: std::string err = "raise \""+msg+"\""; PyRun_SimpleString((char*)err.c_str()); } - - DEPRECATED(virtual int env()) { - return 2; - } }; } diff --git a/src/thermo/ConstDensityThermo.cpp b/src/thermo/ConstDensityThermo.cpp index b138c97ce..8ba559808 100644 --- a/src/thermo/ConstDensityThermo.cpp +++ b/src/thermo/ConstDensityThermo.cpp @@ -44,7 +44,6 @@ ConstDensityThermo& ConstDensityThermo::operator=(const ConstDensityThermo& righ m_cp0_R = right.m_cp0_R; m_g0_RT = right.m_g0_RT; m_s0_R = right.m_s0_R; - m_pe = right.m_pe; m_pp = right.m_pp; return *this; @@ -168,7 +167,6 @@ void ConstDensityThermo::initThermo() m_g0_RT.resize(m_kk); m_cp0_R.resize(m_kk); m_s0_R.resize(m_kk); - m_pe.resize(m_kk, 0.0); m_pp.resize(m_kk); } diff --git a/src/thermo/DebyeHuckel.cpp b/src/thermo/DebyeHuckel.cpp index 4d8dd7ed6..bf35dce2e 100644 --- a/src/thermo/DebyeHuckel.cpp +++ b/src/thermo/DebyeHuckel.cpp @@ -176,8 +176,6 @@ operator=(const DebyeHuckel& b) m_waterProps = new WaterProps(m_waterSS); } - m_expg0_RT = b.m_expg0_RT; - m_pe = b.m_pe; m_pp = b.m_pp; m_tmpV = b.m_tmpV; m_speciesCharge_Stoich= b.m_speciesCharge_Stoich; @@ -1869,8 +1867,6 @@ void DebyeHuckel::initLengths() m_d2lnActCoeffMolaldT2.resize(m_kk, 0.0); m_dlnActCoeffMolaldP.resize(m_kk, 0.0); m_B_Dot.resize(m_kk, 0.0); - m_expg0_RT.resize(m_kk, 0.0); - m_pe.resize(m_kk, 0.0); m_pp.resize(m_kk, 0.0); m_tmpV.resize(m_kk, 0.0); if (m_formDH == DHFORM_BETAIJ || diff --git a/src/thermo/HMWSoln.cpp b/src/thermo/HMWSoln.cpp index f519d7798..6454d1e23 100644 --- a/src/thermo/HMWSoln.cpp +++ b/src/thermo/HMWSoln.cpp @@ -288,8 +288,6 @@ operator=(const HMWSoln& b) m_waterProps = new WaterProps(dynamic_cast(m_waterSS)); } - m_expg0_RT = b.m_expg0_RT; - m_pe = b.m_pe; m_pp = b.m_pp; m_tmpV = b.m_tmpV; m_speciesCharge_Stoich= b.m_speciesCharge_Stoich; @@ -1703,8 +1701,6 @@ void HMWSoln::initLengths() m_speciesCharge_Stoich.resize(m_kk, 0.0); m_Aionic.resize(m_kk, 0.0); - m_expg0_RT.resize(m_kk, 0.0); - m_pe.resize(m_kk, 0.0); m_pp.resize(m_kk, 0.0); m_tmpV.resize(m_kk, 0.0); m_molalitiesCropped.resize(m_kk, 0.0); diff --git a/src/thermo/IdealGasPhase.cpp b/src/thermo/IdealGasPhase.cpp index f1627ed50..564cfc817 100644 --- a/src/thermo/IdealGasPhase.cpp +++ b/src/thermo/IdealGasPhase.cpp @@ -65,7 +65,6 @@ operator=(const IdealGasPhase& right) m_g0_RT = right.m_g0_RT; m_s0_R = right.m_s0_R; m_expg0_RT= right.m_expg0_RT; - m_pe = right.m_pe; m_pp = right.m_pp; } return *this; @@ -482,7 +481,6 @@ void IdealGasPhase::initThermo() m_expg0_RT.resize(m_kk); m_cp0_R.resize(m_kk); m_s0_R.resize(m_kk); - m_pe.resize(m_kk, 0.0); m_pp.resize(m_kk); } diff --git a/src/thermo/IdealMolalSoln.cpp b/src/thermo/IdealMolalSoln.cpp index 6cdde86a3..b3650eb56 100644 --- a/src/thermo/IdealMolalSoln.cpp +++ b/src/thermo/IdealMolalSoln.cpp @@ -99,8 +99,6 @@ operator=(const IdealMolalSoln& b) IMS_egCut_ = b.IMS_egCut_; IMS_agCut_ = b.IMS_agCut_; IMS_bgCut_ = b.IMS_bgCut_; - m_expg0_RT = b.m_expg0_RT; - m_pe = b.m_pe; m_pp = b.m_pp; m_tmpV = b.m_tmpV; IMS_lnActCoeffMolal_ = b.IMS_lnActCoeffMolal_; @@ -1299,8 +1297,6 @@ void IdealMolalSoln::initLengths() * Obtain the limits of the temperature from the species * thermo handler's limits. */ - m_expg0_RT.resize(m_kk); - m_pe.resize(m_kk, 0.0); m_pp.resize(m_kk); m_speciesMolarVolume.resize(m_kk); m_tmpV.resize(m_kk); diff --git a/src/thermo/IdealSolidSolnPhase.cpp b/src/thermo/IdealSolidSolnPhase.cpp index 891a8723d..47d48ab98 100644 --- a/src/thermo/IdealSolidSolnPhase.cpp +++ b/src/thermo/IdealSolidSolnPhase.cpp @@ -1048,22 +1048,6 @@ const vector_fp& IdealSolidSolnPhase::enthalpy_RT_ref() const return m_h0_RT; } -/* - * Returns a reference to the vector of nondimensional - * enthalpies of the reference state at the current temperature. - * Real reason for its existence is that it also checks - * to see if a recalculation of the reference thermodynamics - * functions needs to be done. - */ -const vector_fp& IdealSolidSolnPhase::expGibbs_RT_ref() const -{ - _updateThermo(); - for (size_t k = 0; k != m_kk; k++) { - m_expg0_RT[k] = exp(m_g0_RT[k]); - } - return m_expg0_RT; -} - /* * Returns a reference to the vector of nondimensional * enthalpies of the reference state at the current temperature. diff --git a/src/thermo/SurfPhase.cpp b/src/thermo/SurfPhase.cpp index a3aedf492..c52150c2b 100644 --- a/src/thermo/SurfPhase.cpp +++ b/src/thermo/SurfPhase.cpp @@ -130,7 +130,6 @@ operator=(const SurfPhase& right) m_cp0 = right.m_cp0; m_mu0 = right.m_mu0; m_work = right.m_work; - m_pe = right.m_pe; m_logsize = right.m_logsize; } return *this; @@ -338,7 +337,6 @@ void SurfPhase::initThermo() m_cp0.resize(m_kk); m_mu0.resize(m_kk); m_work.resize(m_kk); - m_pe.resize(m_kk, 0.0); vector_fp cov(m_kk, 0.0); cov[0] = 1.0; setCoverages(DATA_PTR(cov)); @@ -348,27 +346,12 @@ void SurfPhase::initThermo() } } -void SurfPhase::setPotentialEnergy(int k, doublereal pe) -{ - m_pe[k] = pe; - _updateThermo(true); -} - void SurfPhase::setSiteDensity(doublereal n0) { doublereal x = n0; setParameters(1, &x); } -//void SurfPhase:: -//setElectricPotential(doublereal V) { -// for (int k = 0; k < m_kk; k++) { -// m_pe[k] = charge(k)*Faraday*V; -// } -// _updateThermo(true); -//} - - /** * Set the coverage fractions to a specified * state. This routine converts to concentrations