Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove code deprecated in Cantera 2.4.0 #580

Merged
merged 3 commits into from
Dec 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions doc/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,7 @@ if localenv['sphinx_docs']:
'1D/@Domain1D': ['1D/AxiStagnFlow.m', '1D/AxisymmetricFlow.m',
'1D/Inlet.m', '1D/Outlet.m', '1D/OutletRes.m',
'1D/Surface.m', '1D/SymmPlane.m'],
'1D/@Stack': ['1D/FreeFlame.m', '1D/npflame_init.m',
'1D/CounterFlowDiffusionFlame.m'],
'1D/@Stack': ['1D/FreeFlame.m', '1D/CounterFlowDiffusionFlame.m'],
'@Interface': ['importEdge.m', 'importInterface.m'],
'@Data': ['gasconstant.m', 'oneatm.m'],
'@Utilities': ['adddir.m', 'ck2cti.m', 'cleanup.m', 'geterr.m',
Expand Down
3 changes: 0 additions & 3 deletions doc/sphinx/cti/classes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@ Thermodynamic Properties
.. autoclass:: Shomate
:no-undoc-members:

.. autoclass:: Adsorbate
:no-undoc-members:

.. autoclass:: const_cp
:no-undoc-members:

Expand Down
28 changes: 26 additions & 2 deletions include/cantera/base/utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,19 @@ namespace Cantera
/*!
* The form of this operator is designed for use by std::transform.
* @see @ref scale().
*
* @deprecated To be removed after Cantera 2.5. Replaceable with C++11 lambda.
*/
template<class T> struct timesConstant : public std::unary_function<T, double> {
//! Constructor
/*!
* @param c Constant of templated type T that will be stored internally
* within the object and used in the multiplication operation
*/
timesConstant(T c) : m_c(c) {}
timesConstant(T c) : m_c(c) {
warn_deprecated("class timesConstant",
"To be removed after Cantera 2.5. Replaceable with C++11 lambda.");
}

//! Parenthesis operator returning a double
/*!
Expand Down Expand Up @@ -130,7 +135,8 @@ template<class InputIter, class OutputIter, class S>
inline void scale(InputIter begin, InputIter end,
OutputIter out, S scale_factor)
{
std::transform(begin, end, out, timesConstant<S>(scale_factor));
std::transform(begin, end, out,
[scale_factor](double x) { return x * scale_factor; });
}

//! Multiply each entry in x by the corresponding entry in y.
Expand All @@ -157,11 +163,13 @@ inline void scale(InputIter begin, InputIter end,
* begin determines the loop length
* @param y_begin Iterator pointing to the beginning of the vector y,
* belonging to the iterator class outputIter.
* @deprecated Unused. To be removed after Cantera 2.5.
*/
template<class InputIter, class OutputIter>
inline void multiply_each(OutputIter x_begin, OutputIter x_end,
InputIter y_begin)
{
warn_deprecated("multiply_each", "To be removed after Cantera 2.5.");
for (; x_begin != x_end; ++x_begin, ++y_begin) {
*x_begin *= *y_begin;
}
Expand Down Expand Up @@ -190,10 +198,12 @@ inline void multiply_each(OutputIter x_begin, OutputIter x_end,
* @param end Iterator pointing to the end of the x vector, belonging to
* the iterator class InputIter. The difference between end and
* begin determines the loop length
* @deprecated Unused. To be removed after Cantera 2.5.
*/
template<class InputIter>
inline doublereal absmax(InputIter begin, InputIter end)
{
warn_deprecated("absmax", "To be removed after Cantera 2.5.");
doublereal amax = 0.0;
for (; begin != end; ++begin) {
amax = std::max(fabs(*begin), amax);
Expand Down Expand Up @@ -229,11 +239,13 @@ inline doublereal absmax(InputIter begin, InputIter end)
* begin determines the loop length
* @param out Iterator pointing to the beginning of the output vector,
* belonging to the iterator class OutputIter.
* @deprecated Unused. To be removed after Cantera 2.5.
*/
template<class InputIter, class OutputIter>
inline void normalize(InputIter begin, InputIter end,
OutputIter out)
{
warn_deprecated("normalize", "To be removed after Cantera 2.5.");
doublereal sum = std::accumulate(begin, end, 0.0);
for (; begin != end; ++begin, ++out) {
*out = *begin/sum;
Expand Down Expand Up @@ -264,11 +276,13 @@ inline void normalize(InputIter begin, InputIter end,
* and begin determines the number of inner iterations.
* @param y_begin Iterator pointing to the beginning of the yvector, belonging
* to the iterator class InputIter.
* @deprecated Unused. To be removed after Cantera 2.5.
*/
template<class InputIter, class OutputIter>
inline void divide_each(OutputIter x_begin, OutputIter x_end,
InputIter y_begin)
{
warn_deprecated("divide_each", "To be removed after Cantera 2.5.");
for (; x_begin != x_end; ++x_begin, ++y_begin) {
*x_begin /= *y_begin;
}
Expand All @@ -285,11 +299,13 @@ inline void divide_each(OutputIter x_begin, OutputIter x_end,
* and begin determines the number of inner iterations.
* @param y_begin Iterator pointing to the beginning of the yvector, belonging
* to the iterator class InputIter.
* @deprecated Unused. To be removed after Cantera 2.5.
*/
template<class InputIter, class OutputIter>
inline void sum_each(OutputIter x_begin, OutputIter x_end,
InputIter y_begin)
{
warn_deprecated("sum_each", "To be removed after Cantera 2.5.");
for (; x_begin != x_end; ++x_begin, ++y_begin) {
*x_begin += *y_begin;
}
Expand Down Expand Up @@ -325,11 +341,13 @@ inline void sum_each(OutputIter x_begin, OutputIter x_end,
* belonging to the 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.5.
*/
template<class InputIter, class OutputIter, class IndexIter>
inline void scatter_copy(InputIter begin, InputIter end,
OutputIter result, IndexIter index)
{
warn_deprecated("scatter_copy", "To be removed after Cantera 2.5.");
for (; begin != end; ++begin, ++index) {
*(result + *index) = *begin;
}
Expand Down Expand Up @@ -362,11 +380,13 @@ inline void scatter_copy(InputIter begin, InputIter end,
* be selectively multiplied.
* @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.5.
*/
template<class InputIter, class RandAccessIter, class IndexIter>
inline void scatter_mult(InputIter mult_begin, InputIter mult_end,
RandAccessIter data, IndexIter index)
{
warn_deprecated("scatter_mult", "To be removed after Cantera 2.5.");
for (; mult_begin != mult_end; ++mult_begin, ++index) {
*(data + *index) *= *mult_begin;
}
Expand All @@ -384,10 +404,12 @@ inline void scatter_mult(InputIter mult_begin, InputIter mult_end,
* @param end Iterator pointing to the end, belonging to the
* iterator class InputIter.
* @return The return from this class is a double.
* @deprecated Unused. To be removed after Cantera 2.5.
*/
template<class InputIter>
inline doublereal sum_xlogx(InputIter begin, InputIter end)
{
warn_deprecated("sum_xlogx", "To be removed after Cantera 2.5.");
doublereal sum = 0.0;
for (; begin != end; ++begin) {
sum += (*begin) * std::log(*begin + Tiny);
Expand All @@ -410,11 +432,13 @@ inline doublereal sum_xlogx(InputIter begin, InputIter end)
* @param Q_begin Iterator pointing to the beginning of Q_k, belonging to the
* iterator class InputIter2.
* @return The return from this class is hard coded to a doublereal.
* @deprecated Unused. To be removed after Cantera 2.5.
*/
template<class InputIter1, class InputIter2>
inline doublereal sum_xlogQ(InputIter1 begin, InputIter1 end,
InputIter2 Q_begin)
{
warn_deprecated("sum_xlogQ", "To be removed after Cantera 2.5.");
doublereal sum = 0.0;
for (; begin != end; ++begin, ++Q_begin) {
sum += (*begin) * std::log(*Q_begin + Tiny);
Expand Down
1 change: 0 additions & 1 deletion include/cantera/clib/ct.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ extern "C" {
CANTERA_CAPI double thermo_thermalExpansionCoeff(int n);
CANTERA_CAPI double thermo_isothermalCompressibility(int n);
CANTERA_CAPI int thermo_chemPotentials(int n, size_t lenm, double* murt);
CANTERA_CAPI int thermo_elementPotentials(int n, size_t lenm, double* lambda);
CANTERA_CAPI int thermo_getEnthalpies_RT(int n, size_t lenm, double* h_rt);
CANTERA_CAPI int thermo_getEntropies_R(int n, size_t lenm, double* s_r);
CANTERA_CAPI int thermo_getCp_R(int n, size_t lenm, double* cp_r);
Expand Down
9 changes: 0 additions & 9 deletions include/cantera/equil/ChemEquil.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,6 @@ class ChemEquil
int equilibrate(thermo_t& s, const char* XY, vector_fp& elMoles,
int loglevel = 0);

//! @deprecated To be removed after Cantera 2.4.
const vector_fp& elementPotentials() const {
return m_lambda;
}

/**
* Options controlling how the calculation is carried out.
* @see EquilOptions
Expand Down Expand Up @@ -267,10 +262,6 @@ class ChemEquil
//! Current value of the mole fractions in the single phase. length = #m_kk.
vector_fp m_molefractions;

//! Current value of the dimensional element potentials. length = #m_mm
//! @deprecated To be removed after Cantera 2.4.
vector_fp m_lambda;

//! Current value of the sum of the element abundances given the current
//! element potentials.
doublereal m_elementTotalSum;
Expand Down
61 changes: 0 additions & 61 deletions include/cantera/kinetics/AqueousKinetics.h

This file was deleted.

1 change: 0 additions & 1 deletion include/cantera/kinetics/InterfaceKinetics.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

#include "Kinetics.h"
#include "Reaction.h"
#include "cantera/base/utilities.h"
#include "RateCoeffMgr.h"

namespace Cantera
Expand Down
7 changes: 4 additions & 3 deletions include/cantera/kinetics/ThirdBodyCalc.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#ifndef CT_THIRDBODYCALC_H
#define CT_THIRDBODYCALC_H

#include "cantera/base/utilities.h"
#include "cantera/base/ct_defs.h"
#include <cassert>

namespace Cantera
Expand Down Expand Up @@ -44,8 +44,9 @@ class ThirdBodyCalc
}

void multiply(double* output, const double* work) {
scatter_mult(work, work + m_reaction_index.size(),
output, m_reaction_index.begin());
for (size_t i = 0; i < m_reaction_index.size(); i++) {
output[m_reaction_index[i]] *= work[i];
}
}

size_t workSize() {
Expand Down
40 changes: 0 additions & 40 deletions include/cantera/oneD/StFlow.h
Original file line number Diff line number Diff line change
Expand Up @@ -466,46 +466,6 @@ class StFlow : public Domain1D
vector_fp m_ybar;
};

/**
* A class for axisymmetric stagnation flows.
*
* @deprecated To be removed after Cantera 2.4. Use class StFlow with the
* StFlow::setAxisymmetricFlow() method instead.
*
* @ingroup onedim
*/
class AxiStagnFlow : public StFlow
{
public:
AxiStagnFlow(IdealGasPhase* ph = 0, size_t nsp = 1, size_t points = 1) :
StFlow(ph, nsp, points) {
m_dovisc = true;
m_type = cAxisymmetricStagnationFlow;
warn_deprecated("Class AxiStagnFlow is deprecated",
"Use StFlow with setAxisymmetricFlow() instead. To be removed after Cantera 2.4.");
}
};

/**
* A class for freely-propagating premixed flames.
*
* @deprecated To be removed after Cantera 2.4. Use class StFlow with the
* StFlow::setFreeFlow() method instead.
*
* @ingroup onedim
*/
class FreeFlame : public StFlow
{
public:
FreeFlame(IdealGasPhase* ph = 0, size_t nsp = 1, size_t points = 1) :
StFlow(ph, nsp, points) {
m_dovisc = false;
m_type = cFreeFlow;
warn_deprecated("Class FreeFlame is deprecated",
"Use StFlow with setFreeFlow() instead. To be removed after Cantera 2.4.");
}
};

}

#endif
Loading