Skip to content

Commit

Permalink
canteta: remove m_iter variable and deprecate setIterator function
Browse files Browse the repository at this point in the history
Remove m_iter variable and deprecate setIterator function
because only Newton (CV_NEWTON) iteraration method is used.
  • Loading branch information
band-a-prend committed Aug 9, 2019
1 parent 26e47e5 commit f2e3003
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 32 deletions.
3 changes: 0 additions & 3 deletions include/cantera/numerics/CVodesIntegrator.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ class CVodesIntegrator : public Integrator
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);
Expand Down
11 changes: 5 additions & 6 deletions include/cantera/numerics/Integrator.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,11 @@ class Integrator
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("setInterator", "To be removed after Cantera 2.5.");
}

//! Set the maximum step size
virtual void setMaxStepSize(double hmax) {
Expand Down
3 changes: 0 additions & 3 deletions src/kinetics/ImplicitSurfChem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
18 changes: 1 addition & 17 deletions src/numerics/CVodesIntegrator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions src/zeroD/ReactorNet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f2e3003

Please sign in to comment.