diff --git a/include/cantera/base/utilities.h b/include/cantera/base/utilities.h index ed039d11f..c9565558f 100644 --- a/include/cantera/base/utilities.h +++ b/include/cantera/base/utilities.h @@ -17,6 +17,7 @@ #define CT_UTILITIES_H #include "ct_defs.h" +#include "global.h" #include @@ -98,10 +99,12 @@ inline doublereal dot5(const V& x, const V& y) * @param y second reference to the templated class V * @return * This class returns a hard-coded type, doublereal. + * @deprecated Unused. To be removed after Cantera 2.2. */ template inline doublereal dot6(const V& x, const V& y) { + warn_deprecated("dot6", "To be removed after Cantera 2.2."); return x[0]*y[0] + x[1]*y[1] + x[2]*y[2] + x[3]*y[3] + x[4]*y[4] + x[5]*y[5]; } @@ -187,11 +190,14 @@ inline void scale(InputIter begin, InputIter end, * @param end inputIter Iterator for end of y[] * @param out OutputIter Iterator for beginning of x[] * @param scale_factor Scale Factor to multiply y[i] by + * @deprecated Unused. To be removed after Cantera 2.2. */ template inline void increment_scale(InputIter begin, InputIter end, OutputIter out, S scale_factor) { + warn_deprecated("increment_scale", + "To be removed after Cantera 2.2."); for (; begin != end; ++begin, ++out) { *out += scale_factor * *begin; } @@ -258,10 +264,13 @@ inline void multiply_each(OutputIter x_begin, OutputIter x_end, * determines the loop length * * @note This is currently unused. + * @deprecated Unused. To be removed after Cantera 2.2. */ template inline void resize_each(int m, InputIter begin, InputIter end) { + warn_deprecated("resize_each", + "To be removed after Cantera 2.2."); for (; begin != end; ++begin) { begin->resize(m); } @@ -495,11 +504,14 @@ inline void scatter_mult(InputIter mult_begin, InputIter mult_end, * iterator class outputIter. * @param index Iterator pointing to the beginning of the index vector, belonging to the * iterator class IndexIter. + * @deprecated Unused. To be removed after Cantera 2.2. */ template inline void scatter_divide(InputIter begin, InputIter end, OutputIter result, IndexIter index) { + warn_deprecated("scatter_divide", + "To be removed after Cantera 2.2."); for (; begin != end; ++begin, ++index) { *(result + *index) /= *begin; } @@ -571,10 +583,13 @@ inline doublereal sum_xlogQ(InputIter1 begin, InputIter1 end, * @param alpha scale factor - double * @param x Templated Iterator to the start of the vector * to be scaled. + * @deprecated Unused. To be removed after Cantera 2.2. */ template inline void scale(int N, double alpha, OutputIter x) { + warn_deprecated("scale(int N, double alpha, OutputIter x)", + "To be removed after Cantera 2.2."); scale(x, x+N, x, alpha); } @@ -607,10 +622,13 @@ R poly8(D x, R* c) /*! * @param x Value of the independent variable - First template parameter * @param c Pointer to the polynomial - Second template parameter + * @deprecated Unused. To be removed after Cantera 2.2. */ template R poly10(D x, R* c) { + warn_deprecated("poly10", + "To be removed after Cantera 2.2."); return ((((((((((c[10]*x + c[9])*x + c[8])*x + c[7])*x + c[6])*x + c[5])*x + c[4])*x + c[3])*x + c[2])*x + c[1])*x + c[0]); diff --git a/include/cantera/base/vec_functions.h b/include/cantera/base/vec_functions.h index e544d0578..619ff4f1e 100644 --- a/include/cantera/base/vec_functions.h +++ b/include/cantera/base/vec_functions.h @@ -28,10 +28,12 @@ namespace Cantera * @param n Number of elements to copy from x to y * @param x The object x, of templated type const T& * @param y The object y, of templated type T& + * @deprecated Unused. To be removed after Cantera 2.2. */ template inline void copyn(size_t n, const T& x, T& y) { + warn_deprecated("copyn", "To be removed after Cantera 2.2."); std::copy(x.begin(), x.begin() + n, y.begin()); } @@ -42,10 +44,12 @@ inline void copyn(size_t n, const T& x, T& y) * @param x Numerator object of the division operation with template type T * At the end of the calculation, it contains the result. * @param y Denominator object of the division template type T + * @deprecated Unused. To be removed after Cantera 2.2. */ template inline void divide_each(T& x, const T& y) { + warn_deprecated("divide_each", "To be removed after Cantera 2.2."); std::transform(x.begin(), x.end(), y.begin(), x.begin(), std::divides()); } @@ -58,11 +62,12 @@ inline void divide_each(T& x, const T& y) * @param x First object of the multiplication with template type T * At the end of the calculation, it contains the result. * @param y Second object of the multiplication with template type T - * + * @deprecated Unused. To be removed after Cantera 2.2. */ template inline void multiply_each(T& x, const T& y) { + warn_deprecated("multiply_each", "To be removed after Cantera 2.2."); std::transform(x.begin(), x.end(), y.begin(), x.begin(), std::multiplies()); } @@ -74,10 +79,12 @@ inline void multiply_each(T& x, const T& y) * @param x First object of the multiplication with template type T * At the end of the calculation, it contains the result. * @param scale_factor scale factor with template type S + * @deprecated Unused. To be removed after Cantera 2.2. */ template inline void scale(T& x, S scale_factor) { + warn_deprecated("scale", "To be removed after Cantera 2.2."); scale(x.begin(), x.end(), x.begin(), scale_factor); } @@ -88,10 +95,12 @@ inline void scale(T& x, S scale_factor) * @param x First object of the dot product with template type T * At the end of the calculation, it contains the result. * @param y Second object of the dot product with template type T + * @deprecated Unused. To be removed after Cantera 2.2. */ template inline doublereal dot_product(const T& x, const T& y) { + warn_deprecated("dot_product", "To be removed after Cantera 2.2."); return std::inner_product(x.begin(), x.end(), y.begin(), 0.0); } @@ -102,10 +111,12 @@ inline doublereal dot_product(const T& x, const T& y) * @param x First object of the dot product with template type T * At the end of the calculation, it contains the result. * @param y Second object of the dot product with template type T + * @deprecated Unused. To be removed after Cantera 2.2. */ template inline doublereal dot_ratio(const T& x, const T& y) { + warn_deprecated("dot_ratio", "To be removed after Cantera 2.2."); return _dot_ratio(x.begin(), x.end(), y.begin(), 0.0); } @@ -116,10 +127,12 @@ inline doublereal dot_ratio(const T& x, const T& y) * @param x First object of the addition with template type T * At the end of the calculation, it contains the result. * @param y Second object of the addition with template type T + * @deprecated Unused. To be removed after Cantera 2.2. */ template inline void add_each(T& x, const T& y) { + warn_deprecated("add_each", "To be removed after Cantera 2.2."); std::transform(x.begin(), x.end(), y.begin(), x.begin(), std::plus()); } @@ -141,11 +154,13 @@ inline void add_each(T& x, const T& y) * first element of y * @param start_value S type, indicating the type of the * accumulation result. + * @deprecated Unused. To be removed after Cantera 2.2. */ template inline doublereal _dot_ratio(InputIter x_begin, InputIter x_end, InputIter y_begin, S start_value) { + warn_deprecated("_dot_ratio", "To be removed after Cantera 2.2."); for (; x_begin != x_end; ++x_begin, ++y_begin) { start_value += *x_begin / *y_begin; } @@ -158,10 +173,12 @@ inline doublereal _dot_ratio(InputIter x_begin, InputIter x_end, * @param v Vector to be queried for maximum value, with template type T * * @return Returns an object of type T that is the maximum value, + * @deprecated Unused. To be removed after Cantera 2.2. */ template inline T absmax(const std::vector& v) { + warn_deprecated("absmax", "To be removed after Cantera 2.2."); int n = v.size(); T maxval = 0.0; for (int i = 0; i < n; i++) { diff --git a/include/cantera/thermo/StatMech.h b/include/cantera/thermo/StatMech.h index 91f54bede..2b5150307 100644 --- a/include/cantera/thermo/StatMech.h +++ b/include/cantera/thermo/StatMech.h @@ -22,6 +22,7 @@ namespace Cantera //! Statistical mechanics /*! * @ingroup spthermo + * @deprecated Incomplete stub class, to be removed after Cantera 2.2. */ class StatMech : public SpeciesThermoInterpType { diff --git a/include/cantera/transport/PecosTransport.h b/include/cantera/transport/PecosTransport.h index e329b616c..f00264155 100644 --- a/include/cantera/transport/PecosTransport.h +++ b/include/cantera/transport/PecosTransport.h @@ -19,6 +19,7 @@ class GasTransportParams; /** * Class PecosTransport implements mixture-averaged transport * properties for ideal gas mixtures. + * @deprecated Incomplete stub class, to be removed after Cantera 2.2. */ class PecosTransport : public Transport { diff --git a/src/thermo/StatMech.cpp b/src/thermo/StatMech.cpp index 32ead3a64..7a56f3e2a 100644 --- a/src/thermo/StatMech.cpp +++ b/src/thermo/StatMech.cpp @@ -10,7 +10,9 @@ namespace Cantera { -StatMech::StatMech() {} +StatMech::StatMech() { + warn_deprecated("class StatMech", "To be removed after Cantera 2.2"); +} StatMech::StatMech(int n, doublereal tlow, doublereal thigh, doublereal pref, diff --git a/src/transport/PecosTransport.cpp b/src/transport/PecosTransport.cpp index 37a2df9c5..77915f4fa 100755 --- a/src/transport/PecosTransport.cpp +++ b/src/transport/PecosTransport.cpp @@ -23,6 +23,7 @@ PecosTransport::PecosTransport() : m_temp(-1.0), m_logt(0.0) { + warn_deprecated("class PecosTransport", "To be removed after Cantera 2.2"); } bool PecosTransport::initGas(GasTransportParams& tr) diff --git a/test_problems/SConscript b/test_problems/SConscript index 8561ee708..9746ea0e8 100644 --- a/test_problems/SConscript +++ b/test_problems/SConscript @@ -276,7 +276,7 @@ if haveConverters: Test('negA-cti', 'negATest', negA, 'negATest_blessed.out', options='noxNeg.cti', artifacts=negA_name) -CompileAndTest('pecosTransport', 'PecosTransport', 'pecosTransport', 'output_blessed.txt') +#CompileAndTest('pecosTransport', 'PecosTransport', 'pecosTransport', 'output_blessed.txt') CompileAndTest('pureFluid', 'pureFluidTest', 'testPureWater', 'output_blessed.txt') if haveConverters: CompileAndTest('rankine_democxx', 'rankine_democxx', 'rankine', 'output_blessed.txt') @@ -285,16 +285,16 @@ CompileAndTest('simpleTransport', 'simpleTransport', 'simpleTransport', 'output_blessed.txt') CompileAndTest('stoichSolidKinetics', 'stoichSolidKinetics', 'stoichSolidKinetics', 'output_blessed.txt') -CompileAndTest('statmech_test', 'statmech_test', - 'statmech_test', 'output_blessed.txt') -CompileAndTest('statmech_properties', 'statmech_properties', - 'statmech_properties', 'output_blessed.txt') -CompileAndTest('statmech_test_poly', 'statmech_test_poly', - 'statmech_test_poly', 'output_blessed.txt') -CompileAndTest('statmech_transport', 'statmech_transport', - 'statmech_transport', 'output_blessed.txt') -CompileAndTest('statmech_test_Fe', 'statmech', - 'statmech_test_Fe', 'output_blessed.txt') +# CompileAndTest('statmech_test', 'statmech_test', +# 'statmech_test', 'output_blessed.txt') +# CompileAndTest('statmech_properties', 'statmech_properties', +# 'statmech_properties', 'output_blessed.txt') +# CompileAndTest('statmech_test_poly', 'statmech_test_poly', +# 'statmech_test_poly', 'output_blessed.txt') +# CompileAndTest('statmech_transport', 'statmech_transport', +# 'statmech_transport', 'output_blessed.txt') +# CompileAndTest('statmech_test_Fe', 'statmech', +# 'statmech_test_Fe', 'output_blessed.txt') CompileAndTest('surfkin', 'surfkin', 'surfdemo', 'output_blessed.txt') CompileAndTest('surfSolver', 'surfSolverTest', 'surfaceSolver', None, arguments='haca2.xml',