FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ > Class Template Referenceabstract

Polynomial preconditioner implementation. More...

#include <polynomial_precond.hpp>

Inheritance diagram for FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >:
FEAT::Solver::SolverBase< Matrix_::VectorTypeL >

Public Types

typedef SolverBase< VectorTypeBaseClass
 Our base class. More...
 
typedef MatrixType::DataType DataType
 The floating point precision. More...
 
typedef Filter_ FilterType
 The filter type. More...
 
typedef Matrix_ MatrixType
 The matrix type. More...
 
typedef MatrixType::VectorTypeL VectorType
 The type of vector this solver can be applied to. More...
 

Public Member Functions

 PolynomialPrecond (const MatrixType &matrix, const FilterType &filter, Index m, DataType omega=DataType(1))
 Constructor. More...
 
 PolynomialPrecond (const String &section_name, const PropertyMap *section, const MatrixType &matrix, const FilterType &filter)
 Constructor using a PropertyMap. More...
 
virtual ~PolynomialPrecond ()
 Empty virtual destructor. More...
 
virtual Status apply (Matrix_::VectorTypeL &vec_cor, const Matrix_::VectorTypeL &vec_def)=0
 Solver application method. More...
 
virtual Status apply (VectorType &vec_cor, const VectorType &vec_def) override
 Solver application method. More...
 
virtual void done ()
 Finalization method. More...
 
virtual void done_numeric ()
 Numeric finalization method. More...
 
virtual void done_symbolic () override
 Symbolic finalization method. More...
 
virtual void init ()
 Initialization method. More...
 
virtual void init_numeric () override
 Numeric initialization method. More...
 
virtual void init_symbolic () override
 Symbolic initialization method. More...
 
virtual String name () const override
 Returns a descriptive string. More...
 
void set_m (Index m)
 Sets the polynomial order parameter. More...
 
void set_omega (DataType omega)
 Sets the damping parameter. More...
 

Protected Attributes

VectorType _aux1
 auxiliary vectors More...
 
VectorType _aux2
 
VectorType _aux3
 
const FilterType_filter
 The filter for projecting solution and defect to subspaces. More...
 
VectorType _inv_diag
 The component-wise inverted diagonal of _matrix. More...
 
Index _m
 order m of preconditioner More...
 
const MatrixType_matrix
 The system matrix. More...
 
DataType _omega
 The damping parameter for the internal jacobi preconditioner. More...
 

Detailed Description

template<typename Matrix_, typename Filter_>
class FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >

Polynomial preconditioner implementation.

This class represents the Neumann-Polynomial-Preconditioner \(M^{-1} = \sum_{k=0}^m (I - \tilde M^{-1}A)^k \tilde M^{-1}\)

Note
As of now, M is a hardcoded Jacobi (main diagonal inverse)

Definition at line 25 of file polynomial_precond.hpp.

Member Typedef Documentation

◆ BaseClass

template<typename Matrix_ , typename Filter_ >
typedef SolverBase<VectorType> FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >::BaseClass

Our base class.

Definition at line 38 of file polynomial_precond.hpp.

◆ DataType

template<typename Matrix_ , typename Filter_ >
typedef MatrixType::DataType FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >::DataType

The floating point precision.

Definition at line 36 of file polynomial_precond.hpp.

◆ FilterType

template<typename Matrix_ , typename Filter_ >
typedef Filter_ FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >::FilterType

The filter type.

Definition at line 32 of file polynomial_precond.hpp.

◆ MatrixType

template<typename Matrix_ , typename Filter_ >
typedef Matrix_ FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >::MatrixType

The matrix type.

Definition at line 30 of file polynomial_precond.hpp.

◆ VectorType

template<typename Matrix_ , typename Filter_ >
typedef MatrixType::VectorTypeL FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >::VectorType

The type of vector this solver can be applied to.

Definition at line 34 of file polynomial_precond.hpp.

Constructor & Destructor Documentation

◆ PolynomialPrecond() [1/2]

template<typename Matrix_ , typename Filter_ >
FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >::PolynomialPrecond ( const MatrixType matrix,
const FilterType filter,
Index  m,
DataType  omega = DataType(1) 
)
inlineexplicit

Constructor.

Parameters
[in]matrixThe source matrix.
[in]filterThe system filter.
[in]mThe order of the polynom
[in]omegaThe damping parameter for the internal jacobi preconditioner.

Definition at line 70 of file polynomial_precond.hpp.

◆ PolynomialPrecond() [2/2]

template<typename Matrix_ , typename Filter_ >
FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >::PolynomialPrecond ( const String section_name,
const PropertyMap section,
const MatrixType matrix,
const FilterType filter 
)
inlineexplicit

Constructor using a PropertyMap.

Parameters
[in]section_nameThe name of the config section, which it does not know by itself
[in]sectionA pointer to the PropertyMap section configuring this solver
[in]matrixThe system matrix.
[in]filterThe system filter.
Returns
A shared pointer to a new PolynomialPrecond object.

Definition at line 96 of file polynomial_precond.hpp.

References FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >::name(), FEAT::PropertyMap::query(), FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >::set_m(), FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >::set_omega(), and XABORTM.

◆ ~PolynomialPrecond()

template<typename Matrix_ , typename Filter_ >
virtual FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >::~PolynomialPrecond ( )
inlinevirtual

Empty virtual destructor.

Definition at line 128 of file polynomial_precond.hpp.

Member Function Documentation

◆ apply() [1/2]

virtual Status FEAT::Solver::SolverBase< Matrix_::VectorTypeL >::apply ( Matrix_::VectorTypeL &  vec_cor,
const Matrix_::VectorTypeL &  vec_def 
)
pure virtualinherited

Solver application method.

This method applies the solver represented by this object onto a given defect vector and returns the corresponding correction vector.

Note
Solvers which derive from the IterativeSolver base class also provide a correct() method which corrects an initial solution instead of starting with the null vector.
Parameters
[out]vec_corThe vector that shall receive the solution of the linear system. It is assumed to be allocated, but its numerical contents may be undefined upon calling this method.
[in]vec_defThe vector that represents the right-hand-side of the linear system to be solved.
Attention
vec_cor and vec_def must not refer to the same vector object!
Returns
A Status code that represents the status of the solution step.

Implemented in FEAT::Solver::AmaVanka< Matrix_, Filter_ >.

◆ apply() [2/2]

template<typename Matrix_ , typename Filter_ >
virtual Status FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >::apply ( VectorType vec_cor,
const VectorType vec_def 
)
inlineoverridevirtual

Solver application method.

This method applies the solver represented by this object onto a given defect vector and returns the corresponding correction vector.

Note
Solvers which derive from the IterativeSolver base class also provide a correct() method which corrects an initial solution instead of starting with the null vector.
Parameters
[out]vec_corThe vector that shall receive the solution of the linear system. It is assumed to be allocated, but its numerical contents may be undefined upon calling this method.
[in]vec_defThe vector that represents the right-hand-side of the linear system to be solved.
Attention
vec_cor and vec_def must not refer to the same vector object!
Returns
A Status code that represents the status of the solution step.

Definition at line 193 of file polynomial_precond.hpp.

References FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >::_aux1, FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >::_filter, FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >::_inv_diag, FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >::_m, FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >::_matrix, and FEAT::Solver::success.

◆ done()

virtual void FEAT::Solver::SolverBase< Matrix_::VectorTypeL >::done ( )
inlinevirtualinherited

Finalization method.

This function performs both the symbolic and numeric finalization, i.e. it simply performs

this->done_numeric();
this->done_symbolic();

Definition at line 283 of file base.hpp.

◆ done_numeric()

virtual void FEAT::Solver::SolverBase< Matrix_::VectorTypeL >::done_numeric ( )
inlinevirtualinherited

Numeric finalization method.

This method is called to release any data allocated in the numeric initialization step.

Reimplemented in FEAT::Solver::GenericUmfpack< Matrix_ >.

Definition at line 246 of file base.hpp.

◆ done_symbolic()

template<typename Matrix_ , typename Filter_ >
virtual void FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >::done_symbolic ( )
inlineoverridevirtual

Symbolic finalization method.

This method is called to release any data allocated in the symbolic initialization step.

Reimplemented from FEAT::Solver::SolverBase< Matrix_::VectorTypeL >.

Definition at line 148 of file polynomial_precond.hpp.

References FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >::_aux1, and FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >::_inv_diag.

◆ init()

virtual void FEAT::Solver::SolverBase< Matrix_::VectorTypeL >::init ( )
inlinevirtualinherited

Initialization method.

This function performs both the symbolic and numeric initialization, i.e. it simply performs

this->init_symbolic();
this->init_numeric();

Definition at line 268 of file base.hpp.

◆ init_numeric()

template<typename Matrix_ , typename Filter_ >
virtual void FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >::init_numeric ( )
inlineoverridevirtual

Numeric initialization method.

This method is called to perform numeric initialization of the solver.
Before this function can be called, the symbolic initialization must be performed.

Reimplemented from FEAT::Solver::SolverBase< Matrix_::VectorTypeL >.

Definition at line 157 of file polynomial_precond.hpp.

References FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >::_inv_diag, FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >::_matrix, and FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >::_omega.

◆ init_symbolic()

template<typename Matrix_ , typename Filter_ >
virtual void FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >::init_symbolic ( )
inlineoverridevirtual

Symbolic initialization method.

This method is called to perform symbolic initialization of the solver.

Reimplemented from FEAT::Solver::SolverBase< Matrix_::VectorTypeL >.

Definition at line 139 of file polynomial_precond.hpp.

References FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >::_aux1, FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >::_inv_diag, and FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >::_matrix.

◆ name()

template<typename Matrix_ , typename Filter_ >
virtual String FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >::name ( ) const
inlineoverridevirtual

Returns a descriptive string.

Returns
A string describing the solver.

Implements FEAT::Solver::SolverBase< Matrix_::VectorTypeL >.

Definition at line 133 of file polynomial_precond.hpp.

Referenced by FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >::PolynomialPrecond().

◆ set_m()

template<typename Matrix_ , typename Filter_ >
void FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >::set_m ( Index  m)
inline

Sets the polynomial order parameter.

Parameters
[in]mThe new polynomial order parameter.

Definition at line 186 of file polynomial_precond.hpp.

References FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >::_m, and XASSERT.

Referenced by FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >::PolynomialPrecond().

◆ set_omega()

template<typename Matrix_ , typename Filter_ >
void FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >::set_omega ( DataType  omega)
inline

Sets the damping parameter.

Parameters
[in]omegaThe new damping parameter.

Definition at line 173 of file polynomial_precond.hpp.

References FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >::_omega, and XASSERT.

Referenced by FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >::PolynomialPrecond().

Member Data Documentation

◆ _aux1

◆ _aux2

template<typename Matrix_ , typename Filter_ >
VectorType FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >::_aux2
protected

Definition at line 52 of file polynomial_precond.hpp.

◆ _aux3

template<typename Matrix_ , typename Filter_ >
VectorType FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >::_aux3
protected

Definition at line 52 of file polynomial_precond.hpp.

◆ _filter

template<typename Matrix_ , typename Filter_ >
const FilterType& FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >::_filter
protected

The filter for projecting solution and defect to subspaces.

Definition at line 44 of file polynomial_precond.hpp.

Referenced by FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >::apply().

◆ _inv_diag

◆ _m

template<typename Matrix_ , typename Filter_ >
Index FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >::_m
protected

◆ _matrix

◆ _omega

template<typename Matrix_ , typename Filter_ >
DataType FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >::_omega
protected

The damping parameter for the internal jacobi preconditioner.

Definition at line 48 of file polynomial_precond.hpp.

Referenced by FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >::init_numeric(), and FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >::set_omega().


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