From 1606ce1565486f99bb68b3e432fcf39484611ee5 Mon Sep 17 00:00:00 2001 From: band-a-prend Date: Sat, 3 Aug 2019 12:46:59 +0300 Subject: [PATCH] Remove m_iter variable and deprecate setIterator function Remove m_iter variable and deprecate setIterator function because only Newton (CV_NEWTON) iteration method is used. --- include/cantera/numerics/CVodesIntegrator.h | 3 --- include/cantera/numerics/Integrator.h | 11 +++++------ src/kinetics/ImplicitSurfChem.cpp | 3 --- src/numerics/CVodesIntegrator.cpp | 18 +----------------- src/zeroD/ReactorNet.cpp | 3 --- 5 files changed, 6 insertions(+), 32 deletions(-) diff --git a/include/cantera/numerics/CVodesIntegrator.h b/include/cantera/numerics/CVodesIntegrator.h index 8bd39bf97..e17d042c8 100644 --- a/include/cantera/numerics/CVodesIntegrator.h +++ b/include/cantera/numerics/CVodesIntegrator.h @@ -51,9 +51,6 @@ public: m_maxord = n; } virtual void setMethod(MethodType t); - #if CT_SUNDIALS_VERSION < 40 - virtual void setIterator(IterType t); - #endif virtual void setMaxStepSize(double hmax); virtual void setMinStepSize(double hmin); virtual void setMaxSteps(int nmax); diff --git a/include/cantera/numerics/Integrator.h b/include/cantera/numerics/Integrator.h index 25884f122..58d073b29 100644 --- a/include/cantera/numerics/Integrator.h +++ b/include/cantera/numerics/Integrator.h @@ -175,12 +175,11 @@ public: warn("setMethodType"); } - #if CT_SUNDIALS_VERSION < 40 - //! Set the linear iterator. - virtual void setIterator(IterType t) { - warn("setInterator"); - } - #endif + //! Set the linear iterator. + //! @deprecated Unused. To be removed after Cantera 2.5. + virtual void setIterator(IterType t) { + warn_deprecated("Integrator::setIterator", "To be removed after Cantera 2.5."); + } //! Set the maximum step size virtual void setMaxStepSize(double hmax) { diff --git a/src/kinetics/ImplicitSurfChem.cpp b/src/kinetics/ImplicitSurfChem.cpp index c969ed6c0..798d1a7e8 100644 --- a/src/kinetics/ImplicitSurfChem.cpp +++ b/src/kinetics/ImplicitSurfChem.cpp @@ -84,9 +84,6 @@ ImplicitSurfChem::ImplicitSurfChem( // numerically, and use a Newton linear iterator m_integ->setMethod(BDF_Method); m_integ->setProblemType(DENSE + NOJAC); - #if CT_SUNDIALS_VERSION < 40 - m_integ->setIterator(Newton_Iter); - #endif m_work.resize(ntmax); } diff --git a/src/numerics/CVodesIntegrator.cpp b/src/numerics/CVodesIntegrator.cpp index 982e10145..92ee3312c 100644 --- a/src/numerics/CVodesIntegrator.cpp +++ b/src/numerics/CVodesIntegrator.cpp @@ -89,9 +89,6 @@ CVodesIntegrator::CVodesIntegrator() : m_type(DENSE+NOJAC), m_itol(CV_SS), m_method(CV_BDF), - #if CT_SUNDIALS_VERSION < 40 - m_iter(CV_NEWTON), - #endif m_maxord(0), m_reltol(1.e-9), m_abstols(1.e-15), @@ -229,19 +226,6 @@ void CVodesIntegrator::setMaxErrTestFails(int n) } } -#if CT_SUNDIALS_VERSION < 40 - void CVodesIntegrator::setIterator(IterType t) - { - if (t == Newton_Iter) { - m_iter = CV_NEWTON; - } else if (t == Functional_Iter) { - m_iter = CV_FUNCTIONAL; - } else { - throw CanteraError("CVodesIntegrator::setIterator", "unknown iterator"); - } - } -#endif - void CVodesIntegrator::sensInit(double t0, FuncEval& func) { m_np = func.nparams(); @@ -303,7 +287,7 @@ void CVodesIntegrator::initialize(double t0, FuncEval& func) //! CV_BDF - Use BDF methods //! CV_NEWTON - use Newton's method #if CT_SUNDIALS_VERSION < 40 - m_cvode_mem = CVodeCreate(m_method, m_iter); + m_cvode_mem = CVodeCreate(m_method, CV_NEWTON); #else m_cvode_mem = CVodeCreate(m_method); #endif diff --git a/src/zeroD/ReactorNet.cpp b/src/zeroD/ReactorNet.cpp index ebd5c7b19..256c1f9eb 100644 --- a/src/zeroD/ReactorNet.cpp +++ b/src/zeroD/ReactorNet.cpp @@ -28,9 +28,6 @@ ReactorNet::ReactorNet() : // numerically, and use a Newton linear iterator m_integ->setMethod(BDF_Method); m_integ->setProblemType(DENSE + NOJAC); - #if CT_SUNDIALS_VERSION < 40 - m_integ->setIterator(Newton_Iter); - #endif } void ReactorNet::setInitialTime(double time)