AlgebraicMultigrid 0.1
C++ algebraic multigrid.
Loading...
Searching...
No Matches
AMG::SuccessiveOverRelaxation< EleType > Class Template Reference

Dense successive over relaxation iterative method. More...

#include <smoother.hpp>

Inheritance diagram for AMG::SuccessiveOverRelaxation< EleType >:
AMG::SmootherBase< EleType >

Public Member Functions

 SuccessiveOverRelaxation ()
 
 SuccessiveOverRelaxation (double omega_)
 Construct a new Successive Over Relaxation object.
 
 SuccessiveOverRelaxation (double omega_, double tolerance_, size_t compute_error_every_n_iters_, size_t n_iters_)
 Construct a new Successive Over Relaxation object.
 
void smooth (const Eigen::SparseMatrix< EleType > &A, Eigen::Matrix< EleType, -1, 1 > &u, const Eigen::Matrix< EleType, -1, 1 > &b)
 Update initial guess u inplace with SOR and internal relaxation param omega
 
- Public Member Functions inherited from AMG::SmootherBase< EleType >
 SmootherBase ()
 
 SmootherBase (size_t n_iters_)
 
 SmootherBase (double tolerance_, size_t compute_error_every_n_iters_, size_t n_iters_)
 Construct a new Smoother Base object with iterative solver member data.
 

Private Member Functions

void validate_omega ()
 Force omega to be in [0, 2].
 

Private Attributes

double omega {1.0}
 Relaxation parameter in [0, 2].
 

Additional Inherited Members

- Public Attributes inherited from AMG::SmootherBase< EleType >
EleType tolerance {1e-9}
 Tolerance below which a smoother is considered to have converged.
 
size_t compute_error_every_n_iters {100}
 Compute the error every n iterations during smoothing.
 
size_t n_iters {1}
 Maximum number of iterations before smoothing termination.
 

Detailed Description

template<class EleType>
class AMG::SuccessiveOverRelaxation< EleType >

Dense successive over relaxation iterative method.

Template Parameters
EleType

Constructor & Destructor Documentation

◆ SuccessiveOverRelaxation() [1/3]

template<class EleType >
AMG::SuccessiveOverRelaxation< EleType >::SuccessiveOverRelaxation ( )
inline

◆ SuccessiveOverRelaxation() [2/3]

template<class EleType >
AMG::SuccessiveOverRelaxation< EleType >::SuccessiveOverRelaxation ( double omega_)
inline

Construct a new Successive Over Relaxation object.

This constructor only sets the omega member data and leaves the Base class's member data alone.

Parameters
omega_

◆ SuccessiveOverRelaxation() [3/3]

template<class EleType >
AMG::SuccessiveOverRelaxation< EleType >::SuccessiveOverRelaxation ( double omega_,
double tolerance_,
size_t compute_error_every_n_iters_,
size_t n_iters_ )
inline

Construct a new Successive Over Relaxation object.

This constructor also sets the Base class's member data.

Parameters
omega_
tolerance_
compute_error_every_n_iters_
n_iters_

Member Function Documentation

◆ smooth()

template<class EleType >
void AMG::SuccessiveOverRelaxation< EleType >::smooth ( const Eigen::SparseMatrix< EleType > & A,
Eigen::Matrix< EleType, -1, 1 > & u,
const Eigen::Matrix< EleType, -1, 1 > & b )
inlinevirtual

Update initial guess u inplace with SOR and internal relaxation param omega

If this.omega == 1, then this is equivalent to a Gauss-Seidel smoother.

References:

[1] : Heath, M.T. Scientific Computing. pp 470. SIAM 2018.

Implements AMG::SmootherBase< EleType >.

◆ validate_omega()

template<class EleType >
void AMG::SuccessiveOverRelaxation< EleType >::validate_omega ( )
inlineprivate

Force omega to be in [0, 2].

TODO: Is there a better way to handle this in the constructor?

Member Data Documentation

◆ omega

template<class EleType >
double AMG::SuccessiveOverRelaxation< EleType >::omega {1.0}
private

Relaxation parameter in [0, 2].


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