diff --git a/include/cantera/kinetics/ImplicitSurfChem.h b/include/cantera/kinetics/ImplicitSurfChem.h index 2b28f71ca..87a28ca52 100644 --- a/include/cantera/kinetics/ImplicitSurfChem.h +++ b/include/cantera/kinetics/ImplicitSurfChem.h @@ -141,6 +141,7 @@ public: * @param y Value of the solution vector to be used. * On output, this contains the initial value * of the solution. + * @deprecated Use getState() instead. To be removed after Cantera 2.3. */ virtual void getInitialConditions(doublereal t0, size_t leny, doublereal* y); diff --git a/include/cantera/numerics/FuncEval.h b/include/cantera/numerics/FuncEval.h index b9d5fc4ee..bdef34159 100644 --- a/include/cantera/numerics/FuncEval.h +++ b/include/cantera/numerics/FuncEval.h @@ -8,6 +8,8 @@ #define CT_FUNCEVAL_H #include "cantera/base/ct_defs.h" +#include "cantera/base/ctexceptions.h" +#include "cantera/base/global.h" namespace Cantera { @@ -38,8 +40,18 @@ public: /** * Fill the solution vector with the initial conditions * at initial time t0. + * @deprecated Use getState() instead. To be removed after Cantera 2.3. */ - virtual void getInitialConditions(double t0, size_t leny, double* y)=0; + virtual void getInitialConditions(double t0, size_t leny, double* y) { + warn_deprecated("FuncEval::getInitialConditions", + "Use getState instead. To be removed after Cantera 2.3."); + getState(y); + } + + //! Fill in the vector *y* with the current state of the system + virtual void getState(double* y) { + throw NotImplementedError("FuncEval::getState"); + } //! Number of equations. virtual size_t neq()=0; diff --git a/include/cantera/zeroD/ConstPressureReactor.h b/include/cantera/zeroD/ConstPressureReactor.h index 5582b4d37..4bc0f843a 100644 --- a/include/cantera/zeroD/ConstPressureReactor.h +++ b/include/cantera/zeroD/ConstPressureReactor.h @@ -29,6 +29,7 @@ public: return ConstPressureReactorType; } + //! @deprecated Use getState instead. To be removed after Cantera 2.3. virtual void getInitialConditions(doublereal t0, size_t leny, doublereal* y); virtual void getState(doublereal* y); diff --git a/include/cantera/zeroD/FlowReactor.h b/include/cantera/zeroD/FlowReactor.h index 3d059a2b7..407e465d4 100644 --- a/include/cantera/zeroD/FlowReactor.h +++ b/include/cantera/zeroD/FlowReactor.h @@ -24,6 +24,7 @@ public: return FlowReactorType; } + //! @deprecated Use getState instead. To be removed after Cantera 2.3. virtual void getInitialConditions(doublereal t0, size_t leny, doublereal* y); virtual void getState(doublereal* y); diff --git a/include/cantera/zeroD/IdealGasConstPressureReactor.h b/include/cantera/zeroD/IdealGasConstPressureReactor.h index f69aceb7b..8dd0919a6 100644 --- a/include/cantera/zeroD/IdealGasConstPressureReactor.h +++ b/include/cantera/zeroD/IdealGasConstPressureReactor.h @@ -31,6 +31,7 @@ public: virtual void setThermoMgr(ThermoPhase& thermo); + //! @deprecated Use getState instead. To be removed after Cantera 2.3. virtual void getInitialConditions(doublereal t0, size_t leny, doublereal* y); virtual void getState(doublereal* y); diff --git a/include/cantera/zeroD/IdealGasReactor.h b/include/cantera/zeroD/IdealGasReactor.h index 9f2304ffd..b77ebfedc 100644 --- a/include/cantera/zeroD/IdealGasReactor.h +++ b/include/cantera/zeroD/IdealGasReactor.h @@ -28,6 +28,7 @@ public: virtual void setThermoMgr(ThermoPhase& thermo); + //! @deprecated Use getState instead. To be removed after Cantera 2.3. virtual void getInitialConditions(doublereal t0, size_t leny, doublereal* y); virtual void getState(doublereal* y); diff --git a/include/cantera/zeroD/Reactor.h b/include/cantera/zeroD/Reactor.h index 124bb2e6f..6a337525c 100644 --- a/include/cantera/zeroD/Reactor.h +++ b/include/cantera/zeroD/Reactor.h @@ -100,6 +100,7 @@ public: * @param[in] t0 Time at which initial conditions are determined * @param[in] leny Length of *y* (unused) * @param[out] y state vector representing the initial state of the reactor + * @deprecated Use getState instead. To be removed after Cantera 2.3. */ virtual void getInitialConditions(doublereal t0, size_t leny, doublereal* y); diff --git a/include/cantera/zeroD/ReactorNet.h b/include/cantera/zeroD/ReactorNet.h index b7616a8b8..c7c211368 100644 --- a/include/cantera/zeroD/ReactorNet.h +++ b/include/cantera/zeroD/ReactorNet.h @@ -193,6 +193,8 @@ public: } virtual void eval(doublereal t, doublereal* y, doublereal* ydot, doublereal* p); + + //! @deprecated Use getState instead. To be removed after Cantera 2.3. virtual void getInitialConditions(doublereal t0, size_t leny, doublereal* y); virtual void getState(doublereal* y); diff --git a/src/kinetics/ImplicitSurfChem.cpp b/src/kinetics/ImplicitSurfChem.cpp index 773a657e5..3d94190ec 100644 --- a/src/kinetics/ImplicitSurfChem.cpp +++ b/src/kinetics/ImplicitSurfChem.cpp @@ -102,6 +102,8 @@ int ImplicitSurfChem::checkMatch(std::vector m_vec, ThermoPhase* t void ImplicitSurfChem::getInitialConditions(doublereal t0, size_t lenc, doublereal* c) { + warn_deprecated("ImplicitSurfChem::getInitialConditions", + "Use getState instead. To be removed after Cantera 2.3."); getState(c); } diff --git a/src/numerics/CVodeInt.cpp b/src/numerics/CVodeInt.cpp index 1f1fc29f1..98e80d72c 100644 --- a/src/numerics/CVodeInt.cpp +++ b/src/numerics/CVodeInt.cpp @@ -200,7 +200,7 @@ void CVodeInt::initialize(double t0, FuncEval& func) if (m_itol == 1 && m_nabs < m_neq) { throw CVodeErr("not enough absolute tolerance values specified."); } - func.getInitialConditions(m_t0, m_neq, N_VDATA(m_y)); + func.getState(N_VDATA(m_y)); // set options m_iopt[MXSTEP] = m_maxsteps; @@ -247,7 +247,7 @@ void CVodeInt::initialize(double t0, FuncEval& func) void CVodeInt::reinitialize(double t0, FuncEval& func) { m_t0 = t0; - func.getInitialConditions(m_t0, m_neq, N_VDATA(m_y)); + func.getState(N_VDATA(m_y)); // set options m_iopt[MXSTEP] = m_maxsteps; diff --git a/src/numerics/CVodesIntegrator.cpp b/src/numerics/CVodesIntegrator.cpp index 44a5bcb6c..8ae2526fa 100644 --- a/src/numerics/CVodesIntegrator.cpp +++ b/src/numerics/CVodesIntegrator.cpp @@ -281,7 +281,7 @@ void CVodesIntegrator::initialize(double t0, FuncEval& func) throw CVodesErr("not enough absolute tolerance values specified."); } - func.getInitialConditions(m_t0, m_neq, NV_DATA_S(m_y)); + func.getState(NV_DATA_S(m_y)); if (m_cvode_mem) { CVodeFree(&m_cvode_mem); @@ -344,8 +344,7 @@ void CVodesIntegrator::reinitialize(double t0, FuncEval& func) { m_t0 = t0; m_time = t0; - func.getInitialConditions(m_t0, static_cast(m_neq), - NV_DATA_S(m_y)); + func.getState(NV_DATA_S(m_y)); int result; result = CVodeReInit(m_cvode_mem, m_t0, m_y); diff --git a/src/zeroD/ConstPressureReactor.cpp b/src/zeroD/ConstPressureReactor.cpp index 2eef4c684..610977c09 100644 --- a/src/zeroD/ConstPressureReactor.cpp +++ b/src/zeroD/ConstPressureReactor.cpp @@ -16,6 +16,8 @@ namespace Cantera void ConstPressureReactor::getInitialConditions(double t0, size_t leny, double* y) { + warn_deprecated("ConstPressureReactor::getInitialConditions", + "Use getState instead. To be removed after Cantera 2.3."); getState(y); } diff --git a/src/zeroD/FlowReactor.cpp b/src/zeroD/FlowReactor.cpp index 9c6a180da..e7c365dd7 100644 --- a/src/zeroD/FlowReactor.cpp +++ b/src/zeroD/FlowReactor.cpp @@ -26,6 +26,8 @@ FlowReactor::FlowReactor() : void FlowReactor::getInitialConditions(double t0, size_t leny, double* y) { + warn_deprecated("FlowReactor::getInitialConditions", + "Use getState instead. To be removed after Cantera 2.3."); getState(y); } diff --git a/src/zeroD/IdealGasConstPressureReactor.cpp b/src/zeroD/IdealGasConstPressureReactor.cpp index 030d3c60d..1df97c47a 100644 --- a/src/zeroD/IdealGasConstPressureReactor.cpp +++ b/src/zeroD/IdealGasConstPressureReactor.cpp @@ -28,6 +28,8 @@ void IdealGasConstPressureReactor::setThermoMgr(ThermoPhase& thermo) void IdealGasConstPressureReactor::getInitialConditions(double t0, size_t leny, double* y) { + warn_deprecated("IdealGasConstPressureReactor::getInitialConditions", + "Use getState instead. To be removed after Cantera 2.3."); getState(y); } diff --git a/src/zeroD/IdealGasReactor.cpp b/src/zeroD/IdealGasReactor.cpp index 974f42351..80f0d711a 100644 --- a/src/zeroD/IdealGasReactor.cpp +++ b/src/zeroD/IdealGasReactor.cpp @@ -24,6 +24,8 @@ void IdealGasReactor::setThermoMgr(ThermoPhase& thermo) void IdealGasReactor::getInitialConditions(double t0, size_t leny, double* y) { + warn_deprecated("IdealGasReactor::getInitialConditions", + "Use getState instead. To be removed after Cantera 2.3."); getState(y); } diff --git a/src/zeroD/Reactor.cpp b/src/zeroD/Reactor.cpp index 1f2927afd..dbe14a7cb 100644 --- a/src/zeroD/Reactor.cpp +++ b/src/zeroD/Reactor.cpp @@ -29,6 +29,8 @@ Reactor::Reactor() : void Reactor::getInitialConditions(double t0, size_t leny, double* y) { + warn_deprecated("Reactor::getInitialConditions", + "Use getState instead. To be removed after Cantera 2.3."); getState(y); } diff --git a/src/zeroD/ReactorNet.cpp b/src/zeroD/ReactorNet.cpp index 02aba4f03..449f2ceeb 100644 --- a/src/zeroD/ReactorNet.cpp +++ b/src/zeroD/ReactorNet.cpp @@ -177,6 +177,8 @@ void ReactorNet::updateState(doublereal* y) void ReactorNet::getInitialConditions(double t0, size_t leny, double* y) { + warn_deprecated("ReactorNet::getInitialConditions", + "Use getState instead. To be removed after Cantera 2.3."); getState(y); }