12#ifndef CGTERMINATIONCRITERIA_HH
13#define CGTERMINATIONCRITERIA_HH
23 class PCGTerminationCriterion {
67 virtual operator bool() = 0;
96 : tol(tol_), maxit(maxit_), eps(eps_)
112 : tol(tol_), maxit(maxit_), eps(eps_), minTol(minTol_)
120 scaledGamma2.clear();
149 scaledGamma2.push_back( stepLength * rPINVr );
150 energyNorm += stepLength * rPINVr;
164 virtual operator bool()
175 return std::accumulate(scaledGamma2.end() - d, scaledGamma2.end(), 0.) / energyNorm;
184 std::vector<Real> scaledGamma2;
187 double eps = 1e-12, minTol = 1e-2;
215 : tol(tol_), maxit(maxit_), eps(eps_)
231 : tol(tol_), maxit(maxit_), eps(eps_), minTol(minTol_)
239 scaledGamma2.clear();
268 scaledGamma2.push_back( stepLength * rPINVr );
269 energyNorm += stepLength * rPINVr;
270 steps2.push_back(qPq/qAq);
284 virtual operator bool()
296 size_t j = scaledGamma2.size() - 2*d;
298 for(
size_t i = j; i < j + d; ++i)
299 tau += steps2[i] * ( scaledGamma2[i] + 2 * std::accumulate(scaledGamma2.begin()+i+1, scaledGamma2.end(),0) );
309 std::vector<Real> scaledGamma2, steps2;
312 double eps = 1e-12, minTol = 1e-2;
Interface for IterateType::PCG termination criterion policy classes.
virtual void setTolerance(Real tol)=0
set requested tolerance
virtual void clear()=0
re-initializes the termination criterion for a new IterateType::CG run
virtual int getMaxIterationSteps()=0
get the maximum number of allowed iteration steps
virtual void setLookAhead(int lah)=0
set requested look-ahead count
virtual void addStepQuantities(Real stepLength, Real qAq, Real qPq, Real rPINVr)=0
addStepQuantities supplies algorithmic quantities to the termination criterion
virtual bool minimalDecreaseAchieved()
Relative energy error termination criterion according to Strakos, Tichy: Error estimation in precondi...
StrakosTichyEnergyErrorTerminationCriterion(Real tol_, Real minTol_, int maxit_, double eps_=1e-12)
constructor
StrakosTichyEnergyErrorTerminationCriterion(Real tol_, int maxit_, double eps_=1e-12)
constructor
bool minimalDecreaseAchieved()
virtual void setLookAhead(int d_)
set requested lookahead value
virtual void clear()
re-initializes the termination criterion for a new IterateType::CG run
virtual void addStepQuantities(Real stepLength, Real, Real, Real rPINVr)
addStepQuantities supplies algorithmic quantities to the termination criterion
virtual void setTolerance(Real tol_)
set requested relative tolerance
virtual int getMaxIterationSteps()
get the maximum number of allowed iteration steps
Real relativeError()
returns the estimated absolute energy error
Relative error termination criterion based on the norm induced by the preconditioner,...
virtual void setTolerance(Real tol_)
set requested relative tolerance
Real relativeError()
returns the estimated absolute energy error
StrakosTichyPTerminationCriterion(Real tol_, int maxit_, double eps_=1e-12)
constructor
virtual void clear()
re-initializes the termination criterion for a new IterateType::CG run
bool minimalDecreaseAchieved()
StrakosTichyPTerminationCriterion(Real tol_, Real minTol_, int maxit_, double eps_=1e-12)
constructor
virtual void addStepQuantities(Real stepLength, Real qAq, Real qPq, Real rPINVr)
addStepQuantities supplies algorithmic quantities to the termination criterion
virtual int getMaxIterationSteps()
get the maximum number of allowed iteration steps
virtual void setLookAhead(int d_)
set requested lookahead value
Dune::FieldVector< T, n > max(Dune::FieldVector< T, n > x, Dune::FieldVector< T, n > const &y)
Componentwise maximum.