Logo  0.95.0-final
Finite Element Embedded Library and Language in C++
Feel++ Feel++ on Github Feel++ community
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Feel::Iteration< Real > Class Template Reference

#include <iteration.hpp>

Detailed Description

template<typename Real>
class Feel::Iteration< Real >

brief description

The Iteration object calculates whether the solution has reached the desired accuracy, or whether the maximum number of iterations has been reached. The method isFinished() checks both convergence and number of iterations. The method isConverged() only checks convergence. The isFirst() method is used to determine the first iteration of the loop.

The following notation will be used

  • $r$ the residual
  • $\epsilon$ the relative precision
  • $I$ the number of already performed iterations
  • $M$ the maximum number of iterations allowed
    Author
    Christophe Prud'homme
    See Also
    Version
    Id:
    Iteration.hpp,v 1.6 2002/08/22 13:09:56 prudhomm Exp

Public Types

Typedefs
typedef Real NumericalType
 Numerical Type.
 
typedef ublas::type_traits
< Real >::value_type 
value_type
 
typedef ublas::type_traits
< Real >::real_type 
real_type
 

Public Member Functions

Operators
Iterationoperator= (Iteration< NumericalType > const &iter)
 copy operator
 
void operator++ () throw ()
 prefix ++ operator
 
Accessors
int numberOfIterations () const
 
real_type residual () const throw ()
 get the Residual
 
real_type relativePrecision () const
 
int maximumNumberOfIterations () const
 
NumericalType initialResidual () const
 
real_type relaxation () const
 
int iteration () const
 
Mutators
void setMaximumNumberOfIterations (int m) throw ()
 set the Max number of iterations More...
 
void setRelativePrecision (NumericalType p) throw ()
 set the relative precision to reach More...
 
void setInitialResidual (NumericalType ninit) throw ()
 initial norm for the residual More...
 
void setRelaxation (real_type __w)
 
Methods
bool isFinished (NumericalType r, bool verbose=false)
 tells if the iteration finished More...
 
template<typename VectorX >
bool isFinished (const VectorX &r, bool verbose=false)
 
bool isConverged (NumericalType r) throw ()
 
template<typename VectorX >
bool isConverged (VectorX const &x) throw ()
 
bool isFirst () const
 
void reset ()
 

Protected Member Functions

virtual void handleEvents (bool __is_finished, bool verbose)
 
 Iteration ()
 

Constructors, destructor

static Iteration< NumericalType > * New ()
 create a new instance
 
 Iteration (Iteration const &iter)
 
virtual ~Iteration ()
 destructor
 

Constructor & Destructor Documentation

template<typename Real>
Feel::Iteration< Real >::Iteration ( )
inlineprotected

Default constructor.

Member Function Documentation

template<typename Real>
bool Feel::Iteration< Real >::isFinished ( NumericalType  r,
bool  verbose = false 
)
inline

tells if the iteration finished

Three cases can occur:

  • if $ r < \epsilon $ then the iteration is over
  • if $ I > M $ then the iteration is over
  • else the iteration must continue
Parameters
rresidual to test the convergence
verbosetrue for verbose output, false otherwise
Returns
false if not finished and true otherwise
template<typename Real>
void Feel::Iteration< Real >::setInitialResidual ( NumericalType  ninit)
throw (
)
inline

initial norm for the residual

Parameters
ninitinitial norm for the residual
template<typename Real>
void Feel::Iteration< Real >::setMaximumNumberOfIterations ( int  m)
throw (
)
inline

set the Max number of iterations

Parameters
mmax number of iterations to perform
template<typename Real>
void Feel::Iteration< Real >::setRelativePrecision ( NumericalType  p)
throw (
)
inline

set the relative precision to reach

Parameters
pprecision

The documentation for this class was generated from the following file:

Generated on Fri Oct 25 2013 14:24:30 for Feel++ by doxygen 1.8.4