Feel++ 0.91.0
Public Types | Public Member Functions

Feel::Aitken< fs_type > Class Template Reference

Aitken relaxation method for fixed point iterations. More...

#include <aitken2.hpp>

List of all members.

Public Types

typedef fs_type functionspace_type
typedef boost::shared_ptr
< functionspace_type > 
functionspace_ptrtype
typedef
functionspace_type::element_type 
element_type
typedef
functionspace_type::template
Element< typename
functionspace_type::value_type,
typename VectorUblas< typename
functionspace_type::value_type >
::range::type > 
element_range_type
typedef fs_type functionspace_type
typedef boost::shared_ptr
< functionspace_type > 
functionspace_ptrtype
typedef
functionspace_type::element_type 
element_type
typedef
functionspace_type::template
Element< typename
functionspace_type::value_type,
typename VectorUblas< typename
functionspace_type::value_type >
::range::type > 
element_range_type

Public Member Functions

 Aitken (functionspace_ptrtype _Xh, double _failsafeParameter=1)
 Aitken (Aitken const &tc)
 ~Aitken ()
void initialize (element_type const &residual, element_type const &elem)
void initialize (element_type const &residual, element_range_type const &elem)
void setElement (element_type const &residual, element_type const &elem)
void setElement (element_type const &residual, element_range_type const &elem)
double calculateParameter ()
void relaxationStep (element_type &new_elem)
void shiftRight ()
void resetPreviousParameter ()
 Aitken (functionspace_ptrtype _Xh, double _failsafeParameter=0.1)
 Aitken (Aitken const &tc)
 ~Aitken ()
void initialize (element_type const &residual, element_type const &elem)
void initialize (element_type const &residual, element_range_type const &elem)
void setElement (element_type const &residual, element_type const &elem)
void setElement (element_type const &residual, element_range_type const &elem)
double calculateParameter ()
void relaxationStep (element_type &new_elem)
void shiftRight ()
void resetPreviousParameter ()

Detailed Description

template<typename fs_type>
class Feel::Aitken< fs_type >

Aitken relaxation method for fixed point iterations.

 space_ptrtype Xh;
 space_type::element_type residual( Xh );
 space_type::element_type u_old( Xh );
 space_type::element_type u_new( Xh );
 Aitken<space_type> aitken( Xh );
 // initialize aitken
 aitken.initialize( residual, u_new );
 // reset aitken parameter before entering the fixed point loop
 aitken.resetPreviousParameter();
 // fixed point loop
 for( int i = 0; i < niter; ++i )
 {
   // do some computation
   aitken.SetElement( residual, u_new );
   theta = aitken.calculateParameter();
   // exploit aitken relaxation parameter
   u = theta * u_old + (1-theta)* u_new;
   aitken.shiftRight();
   u_old = u_new;
 }
Author:
Goncalo Pena
Christophe Prud'homme
 space_ptrtype Xh;
 space_type::element_type residual( Xh );
 space_type::element_type u_old( Xh );
 space_type::element_type u_new( Xh );
 Aitken<space_type> aitken( Xh );
 // initialize aitken
 aitken.initialize( residual, u_new );
 // reset aitken parameter before entering the fixed point loop
 aitken.resetPreviousParameter();
 // fixed point loop
 for( int i = 0; i < niter; ++i )
 {
   // do some computation
   aitken.SetElement( residual, u_new );
   theta = aitken.calculateParameter();
   // exploit aitken relaxation parameter
   u = theta * u_new + (1-theta)* u_old;
   aitken.shiftRight();
   u_old = u_new;
 }
Author:
Vincent Chabannes

Constructor & Destructor Documentation

template<typename fs_type >
Feel::Aitken< fs_type >::Aitken ( functionspace_ptrtype  _Xh,
double  _failsafeParameter = 1 
) [inline]

Constructor

the _failsafeParameter is set to 1 by default. The _failsafeParameter parameter provides an upper value for the relaxation parameter that will not be exceeded.

Parameters:
_Xhthe function space from which the element will be used
_failsafeParameterfail safe parameter value
template<typename fs_type >
Feel::Aitken< fs_type >::Aitken ( Aitken< fs_type > const &  tc) [inline]

copy constructor

template<typename fs_type >
Feel::Aitken< fs_type >::~Aitken ( ) [inline]

destructor

template<typename fs_type >
Feel::Aitken< fs_type >::Aitken ( functionspace_ptrtype  _Xh,
double  _failsafeParameter = 0.1 
) [inline]

Constructor

the _failsafeParameter is set to 1 by default. The _failsafeParameter parameter provides an upper value for the relaxation parameter that will not be exceeded.

Parameters:
_Xhthe function space from which the element will be used
_failsafeParameterfail safe parameter value
template<typename fs_type >
Feel::Aitken< fs_type >::Aitken ( Aitken< fs_type > const &  tc) [inline]

copy constructor

template<typename fs_type >
Feel::Aitken< fs_type >::~Aitken ( ) [inline]

destructor


Member Function Documentation

template<typename fs_type >
double Feel::Aitken< fs_type >::calculateParameter ( )
Returns:
the Aitken parameter

References Feel::inner_product().

template<typename fs_type >
double Feel::Aitken< fs_type >::calculateParameter ( )
Returns:
the Aitken parameter
template<typename fs_type >
void Feel::Aitken< fs_type >::initialize ( element_type const &  residual,
element_type const &  elem 
) [inline]

initiliaze the aitken algorithm

Parameters:
residualprevious residual
elemprevious element
template<typename fs_type >
void Feel::Aitken< fs_type >::initialize ( element_type const &  residual,
element_type const &  elem 
) [inline]

initiliaze the aitken algorithm

Parameters:
residualprevious residual
elemprevious element
template<typename fs_type >
void Feel::Aitken< fs_type >::relaxationStep ( element_type &  new_elem) [inline]

Do a relaxation step

Parameters:
new_elemnew element to compute the relaxation step
template<typename fs_type >
void Feel::Aitken< fs_type >::relaxationStep ( element_type &  new_elem) [inline]

Do a relaxation step

Parameters:
new_elemnew element to compute the relaxation step
template<typename fs_type >
void Feel::Aitken< fs_type >::resetPreviousParameter ( ) [inline]

reset the previous parameter

template<typename fs_type >
void Feel::Aitken< fs_type >::resetPreviousParameter ( ) [inline]

reset the previous parameter

template<typename fs_type >
void Feel::Aitken< fs_type >::setElement ( element_type const &  residual,
element_type const &  elem 
) [inline]

Set the current element

Parameters:
residualcurrent residual
elemcurrent element
template<typename fs_type >
void Feel::Aitken< fs_type >::setElement ( element_type const &  residual,
element_type const &  elem 
) [inline]

Set the current element

Parameters:
residualcurrent residual
elemcurrent element
template<typename fs_type >
void Feel::Aitken< fs_type >::shiftRight ( ) [inline]

shift current step to previous step. After the call, we are ready for the next step.

template<typename fs_type >
void Feel::Aitken< fs_type >::shiftRight ( ) [inline]

shift current step to previous step. After the call, we are ready for the next step.