|
Feel++ 0.91.0
|
Aitken relaxation method for fixed point iterations. More...
#include <aitken2.hpp>
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 () |
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; }
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; }
| 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.
| _Xh | the function space from which the element will be used |
| _failsafeParameter | fail safe parameter value |
| Feel::Aitken< fs_type >::Aitken | ( | Aitken< fs_type > const & | tc | ) | [inline] |
copy constructor
| Feel::Aitken< fs_type >::~Aitken | ( | ) | [inline] |
destructor
| 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.
| _Xh | the function space from which the element will be used |
| _failsafeParameter | fail safe parameter value |
| Feel::Aitken< fs_type >::Aitken | ( | Aitken< fs_type > const & | tc | ) | [inline] |
copy constructor
| Feel::Aitken< fs_type >::~Aitken | ( | ) | [inline] |
destructor
| double Feel::Aitken< fs_type >::calculateParameter | ( | ) |
References Feel::inner_product().
| double Feel::Aitken< fs_type >::calculateParameter | ( | ) |
| void Feel::Aitken< fs_type >::initialize | ( | element_type const & | residual, |
| element_type const & | elem | ||
| ) | [inline] |
initiliaze the aitken algorithm
| residual | previous residual |
| elem | previous element |
| void Feel::Aitken< fs_type >::initialize | ( | element_type const & | residual, |
| element_type const & | elem | ||
| ) | [inline] |
initiliaze the aitken algorithm
| residual | previous residual |
| elem | previous element |
| void Feel::Aitken< fs_type >::relaxationStep | ( | element_type & | new_elem | ) | [inline] |
Do a relaxation step
| new_elem | new element to compute the relaxation step |
| void Feel::Aitken< fs_type >::relaxationStep | ( | element_type & | new_elem | ) | [inline] |
Do a relaxation step
| new_elem | new element to compute the relaxation step |
| void Feel::Aitken< fs_type >::resetPreviousParameter | ( | ) | [inline] |
reset the previous parameter
| void Feel::Aitken< fs_type >::resetPreviousParameter | ( | ) | [inline] |
reset the previous parameter
| void Feel::Aitken< fs_type >::setElement | ( | element_type const & | residual, |
| element_type const & | elem | ||
| ) | [inline] |
Set the current element
| residual | current residual |
| elem | current element |
| void Feel::Aitken< fs_type >::setElement | ( | element_type const & | residual, |
| element_type const & | elem | ||
| ) | [inline] |
Set the current element
| residual | current residual |
| elem | current element |
| void Feel::Aitken< fs_type >::shiftRight | ( | ) | [inline] |
shift current step to previous step. After the call, we are ready for the next step.
| void Feel::Aitken< fs_type >::shiftRight | ( | ) | [inline] |
shift current step to previous step. After the call, we are ready for the next step.
1.7.3