From e778afad32cee7192119c441da12df4a579ebdc1 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Fri, 20 Jun 2014 18:44:33 +0000 Subject: [PATCH] Remove deprecated functions --- include/cantera/Cantera.h | 58 ----------- include/cantera/base/ctml.h | 40 -------- include/cantera/base/stringUtils.h | 16 --- include/cantera/equil/vcs_internal.h | 18 ---- include/cantera/oneD/StFlow.h | 10 -- src/base/ctml.cpp | 25 ----- src/base/stringUtils.cpp | 41 -------- src/equil/vcs_util.cpp | 59 ----------- src/transport/FtnTransport.h | 146 --------------------------- 9 files changed, 413 deletions(-) delete mode 100644 include/cantera/Cantera.h delete mode 100644 src/transport/FtnTransport.h diff --git a/include/cantera/Cantera.h b/include/cantera/Cantera.h deleted file mode 100644 index 1cd9d8d1b..000000000 --- a/include/cantera/Cantera.h +++ /dev/null @@ -1,58 +0,0 @@ -/** - * @file Cantera.h - * Basic include file to be used in all Cantera application environments. - * @deprecated To be removed in Cantera 2.2. Applications should include - * relevant headers directly. - */ - -/* - * $Revision: 923 $ - * $Date: 2012-01-03 10:05:28 -0700 (Tue, 03 Jan 2012) $ - */ - -// Copyright 2001 California Institute of Technology - -/* - * Note, this include should be the first include that code containing the - * Cantera namespace sees when in the Cantera application environment. - */ - -#ifndef CANTERA_H_INCL -#define CANTERA_H_INCL - -// If we are using this file, then we are in the Cantera Apps environment. -// Define a variable to signify this fact. -#ifndef CANTERA_APP -#define CANTERA_APP -#endif - -// define the presence of the Cantera_CXX namespace -namespace Cantera_CXX{ } - -// Include global typedefs and values for physical constants using SI units -#include "base/ct_defs.h" - -// some useful functions -#include "base/global.h" - -// the CanteraError exception class -#include "base/ctexceptions.h" - -// The Cantera logger class -#include "base/logger.h" - -// Include the timer -#include "base/clockWC.h" - -// Include routines for reading and writing XML files -#include "base/xml.h" - -// Include string utility routines -#include "base/stringUtils.h" - -// Include the array object -#include "base/Array.h" - -#endif - - diff --git a/include/cantera/base/ctml.h b/include/cantera/base/ctml.h index cac708661..77adf00d8 100644 --- a/include/cantera/base/ctml.h +++ b/include/cantera/base/ctml.h @@ -541,46 +541,6 @@ doublereal getFloatCurrent(const Cantera::XML_Node& currXML, const std::string& bool getOptionalFloat(const Cantera::XML_Node& parent, const std::string& name, doublereal& fltRtn, const std::string& type=""); -//! Get a vector of floating-point values from a child element. -/*! - * Returns a std::map containing a keyed values for child XML_Nodes of the - * current node with the name, "float". In the keyed mapping there will be a - * list of titles vs. values for all of the XML nodes. The float XML_nodes are - * expected to be in a particular form created by the function addFloat(). One - * value per XML_node is expected. - * - * Example: - * - * Code snippet: - * @code - * const XML_Node &State_XMLNode; - * std::map v; - * bool convert = true; - * getFloats(State_XMLNode, v, convert); - * @endcode - * - * reads the corresponding XML file: - * - * - * 32.4 <\float> - * 1. <\float> - * 100. <\float> - * <\state> - * - * Will produce the mapping: - * - * v["a1"] = 32.4 - * v["a2"] = 1.0E-6 - * v["a3"] = 100. - * - * @param node Current XML node to get the values from - * @param v Output map of the results. - * @param convert Turn on conversion to SI units - * @deprecated Unused. To be removed in Cantera 2.2. - */ -void getFloats(const Cantera::XML_Node& node, std::map& v, - const bool convert=true); - //! Get an integer value from a child element. /*! * Returns an integer value for the child named 'name' of element 'parent'. diff --git a/include/cantera/base/stringUtils.h b/include/cantera/base/stringUtils.h index dc2466ff5..2a960073a 100644 --- a/include/cantera/base/stringUtils.h +++ b/include/cantera/base/stringUtils.h @@ -196,22 +196,6 @@ std::string parseSpeciesName(const std::string& nameStr, std::string& phaseName) std::string wrapString(const std::string& s, const int len=70); -//! Routine strips off white space from a c character string -/*! - * This routine strips off blanks and tabs (only leading and trailing - * characters) in 'str'. On return, it returns the number of - * characters still included in the string (excluding the null character). - * - * Comments are excluded -> All instances of the comment character, '!', are - * replaced by NULL character thereby terminating the string. - * - * @param str On output 'str' contains the same characters as on input except - * the leading and trailing white space and comments have been - * removed. - * @deprecated - */ -int stripLTWScstring(char str[]); - //! Interpret one or two token string as a single double /*! * This is similar to atof(). However, the second token is interpreted as an diff --git a/include/cantera/equil/vcs_internal.h b/include/cantera/equil/vcs_internal.h index 3228698e2..7dea18f44 100644 --- a/include/cantera/equil/vcs_internal.h +++ b/include/cantera/equil/vcs_internal.h @@ -289,24 +289,6 @@ void vcs_print_stringTrunc(const char* str, size_t space, int alignment); * @return returns true if the doubles are "equal" and false otherwise */ bool vcs_doubleEqual(double d1, double d2); - -//! Sorts a vector of ints in place from lowest to the highest values -/*! - * The vector is returned sorted from lowest to highest. - * - * @param x Reference to a vector of ints. - * @deprecated - */ -void vcs_heapsort(std::vector &x); - -//! Sorts a vector of ints and eliminates duplicates from the resulting list -/*! - * @param xOrderedUnique Ordered vector of unique ints that were part of the original list - * @param x Reference to a constant vector of ints. - * @deprecated - */ -void vcs_orderedUnique(std::vector & xOrderedUnique, const std::vector & x); - } #endif diff --git a/include/cantera/oneD/StFlow.h b/include/cantera/oneD/StFlow.h index f838511ab..354e8b63e 100644 --- a/include/cantera/oneD/StFlow.h +++ b/include/cantera/oneD/StFlow.h @@ -99,16 +99,6 @@ public: return m_press; } - //! @deprecated unused - virtual void setState(size_t point, const doublereal* state, - doublereal* x) { - warn_deprecated("StFlow::setState"); - setTemperature(point, state[2]); - for (size_t k = 0; k < m_nsp; k++) { - setMassFraction(point, k, state[4+k]); - } - } - //! Write the initial solution estimate into array x. virtual void _getInitialSoln(doublereal* x) { for (size_t j = 0; j < m_points; j++) { diff --git a/src/base/ctml.cpp b/src/base/ctml.cpp index e6d04e16d..9d73d542a 100644 --- a/src/base/ctml.cpp +++ b/src/base/ctml.cpp @@ -205,31 +205,6 @@ void getIntegers(const Cantera::XML_Node& node, } } -void getFloats(const Cantera::XML_Node& node, std::map& v, - const bool convert) -{ - warn_deprecated("ctml::getFloats", - "To be removed in Cantera 2.2."); - std::vector f; - node.getChildren("float",f); - for (size_t i = 0; i < f.size(); i++) { - const XML_Node& fi = *(f[i]); - doublereal x = fpValue(fi()); - const string& vmin = fi["min"]; - const string& vmax = fi["max"]; - if (vmin != "" && x < fpValue(vmin) - Tiny) { - writelog("\nWarning: value "+fi()+" is below lower limit of " - +vmin+".\n"); - } - if (fi["max"] != "" && x > fpValue(vmax) + Tiny) { - writelog("\nWarning: value "+fi()+" is above upper limit of " - +vmax+".\n"); - } - doublereal fctr = (convert ? toSI(fi["units"]) : 1.0); // toSI(typ,units); - v[fi["title"]] = fctr*x; - } -} - doublereal getFloat(const Cantera::XML_Node& parent, const std::string& name, const std::string& type) diff --git a/src/base/stringUtils.cpp b/src/base/stringUtils.cpp index 2aff3031b..7b1fab0a5 100644 --- a/src/base/stringUtils.cpp +++ b/src/base/stringUtils.cpp @@ -328,47 +328,6 @@ std::string parseSpeciesName(const std::string& nameStr, std::string& phaseName) return s; } -int stripLTWScstring(char str[]) -{ - warn_deprecated("stripLTWScstring"); - int i = 0, j = 0; - char ch; - const char COM_CHAR='\0'; - /* - * Quick Returns - */ - if ((str == 0) || (str[0] == '\0')) { - return 0; - } - - /* Find first non-space character character */ - while (((ch = str[i]) != '\0') && isspace(ch)) { - i++; - } - - /* - * Move real part of str to the front by copying the string - * - Comments are handled here, by terminating the copy at the - * first comment indicator, and inserting the null character at - * that point. - */ - - while ((ch = str[j+i]) != '\0' && - (ch != COM_CHAR)) { - str[j] = ch; - j++; - } - str[j] = '\0'; - j--; - /* Remove trailing white space by inserting a null character */ - while ((j != -1) && isspace(str[j])) { - j--; - } - j++; - str[j] = '\0'; - return j; -} - doublereal strSItoDbl(const std::string& strSI) { std::vector v; diff --git a/src/equil/vcs_util.cpp b/src/equil/vcs_util.cpp index 4c7eee469..707262292 100644 --- a/src/equil/vcs_util.cpp +++ b/src/equil/vcs_util.cpp @@ -190,63 +190,4 @@ bool vcs_doubleEqual(double d1, double d2) return true; } -void vcs_heapsort(std::vector & x) -{ - int n = x.size(); - if (n < 2) { - return; - } - doublereal rra; - int ll = n / 2; - int iret = n - 1; - - while (1 > 0) { - if (ll > 0) { - ll--; - rra = x[ll]; - } else { - rra = x[iret]; - x[iret] = x[0]; - iret--; - if (iret == 0) { - x[0] = rra; - return; - } - } - - int i = ll; - int j = ll + ll + 1; - - while (j <= iret) { - if (j < iret) { - if (x[j] < x[j + 1]) { - j++; - } - } - if (rra < x[j]) { - x[i] = x[j]; - i = j; - j = j + j + 1; - } else { - j = iret + 1; - } - } - x[i] = rra; - } -} - -void vcs_orderedUnique(std::vector & xOrderedUnique, const std::vector & x) -{ - std::vector xordered(x); - vcs_heapsort(xordered); - int lastV = x[0] - 1; - xOrderedUnique.clear(); - for (int i = 0; i < (int) xordered.size(); i++) { - if (lastV != xordered[i]) { - xOrderedUnique.push_back(xordered[i]); - lastV = xordered[i]; - } - } -} - } diff --git a/src/transport/FtnTransport.h b/src/transport/FtnTransport.h deleted file mode 100644 index b87c4d8e7..000000000 --- a/src/transport/FtnTransport.h +++ /dev/null @@ -1,146 +0,0 @@ -/** - * @file FtnTransport.h - * - * Customizable Fortran transport manager. This manager calls - * external Fortran functions to evaluate the transport - * properties. This is designed to be used to build custom transport - * managers in Fortran. - */ - -// Copyright 2003 California Institute of Technology - - -#ifndef CT_FTNTRANSPORT_H -#define CT_FTNTRANSPORT_H - -#include "cantera/transport/TransportBase.h" - - -/** - * Change these definitions to change the names of the Fortran - * procedures. If you want to define more than one custom Fortran - * transport manager, copy this file, rename the class, and change - * these definitions. - * - * The Fortran procedure names must follow the conventions of the Fortran - * compiler. On most unix systems, this means the names must be lowercase, - * and must include a trailing underscore. - * - */ -#define __VISC__ visc_ -#define __BULKVISC__ bvisc_ -#define __TCON__ tcon_ -#define __TDIFF__ tdiff_ -#define __MULTIDIFF__ multidiff_ -#define __MIXDIFF__ mixdiff_ -#define __SIGMA__ sigma_ -#define __GETMOBILITIES__ getmobilities_ - - -extern "C" { - - doublereal __VISC__(doublereal* t, doublereal* p, doublereal* x); - doublereal __BULKVISC__(doublereal* t, doublereal* p, doublereal* x); - doublereal __TCON__(doublereal* t, doublereal* p, doublereal* x); - - void __TDIFF__(doublereal* t, doublereal* p, doublereal* x, doublereal* dt); - void __MULTIDIFF__(doublereal* t, doublereal* p, doublereal* x, - integer* ld, doublereal* d); - void __MIXDIFF__(doublereal* t, doublereal* p, doublereal* x, doublereal* d); - void __BINDIFF__(doublereal* t, doublereal* p, doublereal* x, integer* ld, doublereal* d); - doublereal __SIGMA__(doublereal* t, doublereal* p, doublereal* x); - - doublereal __GETMOBILITIES__(doublereal* t, doublereal* p, - doublereal* x, doublereal* mobil); - -} - -namespace Cantera -{ - -/** - * A class that calls external Fortran functions to evaluate - * transport properties. - * @deprecated Broken and unused - */ -class FtnTransport : public Transport -{ - -public: - - FtnTransport(int model, thermo_t* thermo) : Transport(thermo) { - warn_deprecated("FtnTransport", "This class will be removed in Cantera 2.2."); - m_model = model; - m_x.resize(m_thermo->nSpecies(), 0.0); - updateTPX(); - } - - virtual int model() { - return cFtnTransport + m_model; - } - - virtual doublereal viscosity() { - updateTPX(); - return __VISC__(&m_temp, &m_pres, m_x.begin()); - } - - virtual doublereal bulkViscosity() { - updateTPX(); - return __BULKVISC__(&m_temp, &m_pres, m_x.begin()); - } - - virtual doublereal thermalConductivity() { - updateTPX(); - return __TCON__(&m_temp, &m_pres, m_x.begin()); - } - - virtual doublereal electricalConductivity() { - updateTPX(); - return __SIGMA__(&m_temp, &m_pres, m_x.begin()); - } - - virtual void getMobilities(doublereal* mobil) { - updateTPX(); - __GETMOBILITIES__(&m_temp, &m_pres, m_x.begin(), mobil); - } - - - virtual void getThermalDiffCoeffs(doublereal* dt) { - updateTPX(); - __TDIFF__(&m_temp, &m_pres, m_x.begin(), dt); - } - - virtual void getBinaryDiffCoeffs(int ld, doublereal* d) { - updateTPX(); - integer ldd = ld; - __BINDIFF__(&m_temp, &m_pres, m_x.begin(), &ldd, d); - } - - virtual void getMultiDiffCoeffs(int ld, doublereal* d) { - updateTPX(); - integer ldd = ld; - __MULTIDIFF__(&m_temp, &m_pres, m_x.begin(), &ldd, d); - } - - virtual void getMixDiffCoeffs(doublereal* d) { - updateTPX(); - __MIXDIFF__(&m_temp, &m_pres, m_x.begin(), d); - } - - -private: - - void updateTPX() { - m_temp = m_thermo->temperature(); - m_pres = m_thermo->pressure(); - m_thermo->getMoleFractions(m_x.begin()); - } - doublereal m_temp; - doublereal m_pres; - vector_fp m_x; - int m_model; - -}; - -} -#endif