FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
FEAT::Solver::UzawaPrecond< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ > Class Template Referenceabstract

Uzawa preconditioner. More...

#include <uzawa_precond.hpp>

Inheritance diagram for FEAT::Solver::UzawaPrecond< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >:
FEAT::Solver::SolverBase< LAFEM::TupleVector< MatrixB_::VectorTypeL, MatrixD_::VectorTypeL > >

Public Types

typedef SolverBase< VectorTypeBaseClass
 base-class typedef More...
 
typedef MatrixA_::DataType DataType
 our data type More...
 
typedef SolverBase< VectorTypeVSolverA
 A-block solver type. More...
 
typedef SolverBase< VectorTypePSolverS
 S-block solver type. More...
 
typedef LAFEM::TupleVector< VectorTypeV, VectorTypePVectorType
 system vector type More...
 
typedef MatrixD_::VectorTypeL VectorTypeP
 pressure vector type More...
 
typedef MatrixB_::VectorTypeL VectorTypeV
 velocity vector type More...
 

Public Member Functions

 UzawaPrecond (const MatrixA_ &matrix_a, const MatrixB_ &matrix_b, const MatrixD_ &matrix_d, const FilterV_ &filter_v, const FilterP_ &filter_p, std::shared_ptr< SolverA > solver_a, std::shared_ptr< SolverS > solver_s, UzawaType type=UzawaType::diagonal, bool auto_init_s=true)
 Constructs a Uzawa preconditioner. More...
 
virtual Status apply (LAFEM::TupleVector< MatrixB_::VectorTypeL, MatrixD_::VectorTypeL > &vec_cor, const LAFEM::TupleVector< MatrixB_::VectorTypeL, MatrixD_::VectorTypeL > &vec_def)=0
 Solver application method. More...
 
virtual Status apply (VectorType &vec_cor, const VectorType &vec_def) override
 
virtual void done ()
 Finalization method. More...
 
virtual void done_numeric () override
 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...
 

Private Attributes

const bool _auto_init_s
 auto-initialize of S-solver More...
 
const FilterP_ & _filter_p
 
const FilterV_ & _filter_v
 our system filter More...
 
const MatrixA_ & _matrix_a
 
const MatrixB_ & _matrix_b
 
const MatrixD_ & _matrix_d
 
std::shared_ptr< SolverA_solver_a
 our A-block solver More...
 
std::shared_ptr< SolverS_solver_s
 our S-block solver More...
 
UzawaType _uzawa_type
 our Uzawa type More...
 
VectorTypeP _vec_tmp_p
 
VectorTypeV _vec_tmp_v
 a temporary defect vector More...
 

Detailed Description

template<typename MatrixA_, typename MatrixB_, typename MatrixD_, typename FilterV_, typename FilterP_>
class FEAT::Solver::UzawaPrecond< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >

Uzawa preconditioner.

This class implements the Uzawa preconditioner, which is a special preconditioner for saddle-point systems of the form

\[\begin{bmatrix} A & B\\D & 0\end{bmatrix} \cdot \begin{bmatrix} x_u\\x_p\end{bmatrix} = \begin{bmatrix} f_u\\f_p\end{bmatrix}\]

Let \( S \approx -DA^{-1}B\) be an approximation of the Schur-complement matrix, then this class supports a total of four different preconditioners for the saddle-point system above:

  • UzawaType::diagonal: Solves the system

    \[\begin{bmatrix} A & 0\\0 & S\end{bmatrix} \cdot \begin{bmatrix} x_u\\x_p\end{bmatrix} = \begin{bmatrix} f_u\\f_p\end{bmatrix}\]

  • UzawaType::lower: Solves the system

    \[\begin{bmatrix} A & 0\\D & S\end{bmatrix} \cdot \begin{bmatrix} x_u\\x_p\end{bmatrix} = \begin{bmatrix} f_u\\f_p\end{bmatrix}\]

  • UzawaType::upper: Solves the system

    \[\begin{bmatrix} A & B\\0 & S\end{bmatrix} \cdot \begin{bmatrix} x_u\\x_p\end{bmatrix} = \begin{bmatrix} f_u\\f_p\end{bmatrix}\]

  • UzawaType::full: Solves the system

    \[\begin{bmatrix} I & 0\\-DA^{-1} & I\end{bmatrix} \cdot \begin{bmatrix} A & B\\0 & S\end{bmatrix} \cdot \begin{bmatrix} x_u\\x_p\end{bmatrix} = \begin{bmatrix} f_u\\f_p\end{bmatrix}\]

The required solution steps of \( A^{-1} \) and \( S^{-1} \) are performed by two sub-solvers, which have to be created by the user and supplied to the constructor of this object.

Template Parameters
MatrixA_,MatrixB_,MatrixD_The types of the sub-matrices A, B and D.
FilterV_,FilterP_The types of the filters for the velocity and pressure components, respectively.
Note
This class template is specialized for Global::Matrix and Global::Filter instances below.
Author
Peter Zajac

Definition at line 76 of file uzawa_precond.hpp.

Member Typedef Documentation

◆ BaseClass

template<typename MatrixA_ , typename MatrixB_ , typename MatrixD_ , typename FilterV_ , typename FilterP_ >
typedef SolverBase<VectorType> FEAT::Solver::UzawaPrecond< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >::BaseClass

base-class typedef

Definition at line 89 of file uzawa_precond.hpp.

◆ DataType

template<typename MatrixA_ , typename MatrixB_ , typename MatrixD_ , typename FilterV_ , typename FilterP_ >
typedef MatrixA_::DataType FEAT::Solver::UzawaPrecond< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >::DataType

our data type

Definition at line 81 of file uzawa_precond.hpp.

◆ SolverA

template<typename MatrixA_ , typename MatrixB_ , typename MatrixD_ , typename FilterV_ , typename FilterP_ >
typedef SolverBase<VectorTypeV> FEAT::Solver::UzawaPrecond< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >::SolverA

A-block solver type.

Definition at line 92 of file uzawa_precond.hpp.

◆ SolverS

template<typename MatrixA_ , typename MatrixB_ , typename MatrixD_ , typename FilterV_ , typename FilterP_ >
typedef SolverBase<VectorTypeP> FEAT::Solver::UzawaPrecond< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >::SolverS

S-block solver type.

Definition at line 94 of file uzawa_precond.hpp.

◆ VectorType

template<typename MatrixA_ , typename MatrixB_ , typename MatrixD_ , typename FilterV_ , typename FilterP_ >
typedef LAFEM::TupleVector<VectorTypeV, VectorTypeP> FEAT::Solver::UzawaPrecond< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >::VectorType

system vector type

Definition at line 87 of file uzawa_precond.hpp.

◆ VectorTypeP

template<typename MatrixA_ , typename MatrixB_ , typename MatrixD_ , typename FilterV_ , typename FilterP_ >
typedef MatrixD_::VectorTypeL FEAT::Solver::UzawaPrecond< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >::VectorTypeP

pressure vector type

Definition at line 85 of file uzawa_precond.hpp.

◆ VectorTypeV

template<typename MatrixA_ , typename MatrixB_ , typename MatrixD_ , typename FilterV_ , typename FilterP_ >
typedef MatrixB_::VectorTypeL FEAT::Solver::UzawaPrecond< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >::VectorTypeV

velocity vector type

Definition at line 83 of file uzawa_precond.hpp.

Constructor & Destructor Documentation

◆ UzawaPrecond()

template<typename MatrixA_ , typename MatrixB_ , typename MatrixD_ , typename FilterV_ , typename FilterP_ >
FEAT::Solver::UzawaPrecond< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >::UzawaPrecond ( const MatrixA_ &  matrix_a,
const MatrixB_ &  matrix_b,
const MatrixD_ &  matrix_d,
const FilterV_ &  filter_v,
const FilterP_ &  filter_p,
std::shared_ptr< SolverA solver_a,
std::shared_ptr< SolverS solver_s,
UzawaType  type = UzawaType::diagonal,
bool  auto_init_s = true 
)
inlineexplicit

Constructs a Uzawa preconditioner.

Parameters
[in]matrix_a,matrix_b,matrix_dThe three sub-matrices of the saddle-point matrix.
[in]filter_v,filter_pThe velocity and pressure filter, resp.
[in]solver_aThe solver representing \(A^{-1}\).
[in]solver_sThe solver representing \(S^{-1}\).
[in]typeSpecifies the type of the preconditioner. See this class' documentation for details.
[in]auto_init_sSpecifies whether this solver object should call the init/done functions of the solver_s object. If set to false, then the caller is responsible for the initialization and finalization of the S-block solver object.

Definition at line 139 of file uzawa_precond.hpp.

References XASSERTM.

◆ ~UzawaPrecond()

template<typename MatrixA_ , typename MatrixB_ , typename MatrixD_ , typename FilterV_ , typename FilterP_ >
virtual FEAT::Solver::UzawaPrecond< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >::~UzawaPrecond ( )
inlinevirtual

Definition at line 163 of file uzawa_precond.hpp.

Member Function Documentation

◆ apply() [1/2]

virtual Status FEAT::Solver::SolverBase< LAFEM::TupleVector< MatrixB_::VectorTypeL, MatrixD_::VectorTypeL > >::apply ( LAFEM::TupleVector< MatrixB_::VectorTypeL, MatrixD_::VectorTypeL > &  vec_cor,
const LAFEM::TupleVector< MatrixB_::VectorTypeL, MatrixD_::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.

◆ apply() [2/2]

template<typename MatrixA_ , typename MatrixB_ , typename MatrixD_ , typename FilterV_ , typename FilterP_ >
virtual Status FEAT::Solver::UzawaPrecond< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >::apply ( VectorType vec_cor,
const VectorType vec_def 
)
inlineoverridevirtual

Definition at line 224 of file uzawa_precond.hpp.

◆ done()

virtual void FEAT::Solver::SolverBase< LAFEM::TupleVector< MatrixB_::VectorTypeL, MatrixD_::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()

template<typename MatrixA_ , typename MatrixB_ , typename MatrixD_ , typename FilterV_ , typename FilterP_ >
virtual void FEAT::Solver::UzawaPrecond< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >::done_numeric ( )
inlineoverridevirtual

◆ done_symbolic()

◆ init()

virtual void FEAT::Solver::SolverBase< LAFEM::TupleVector< MatrixB_::VectorTypeL, MatrixD_::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 MatrixA_ , typename MatrixB_ , typename MatrixD_ , typename FilterV_ , typename FilterP_ >
virtual void FEAT::Solver::UzawaPrecond< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >::init_numeric ( )
inlineoverridevirtual

◆ init_symbolic()

◆ name()

template<typename MatrixA_ , typename MatrixB_ , typename MatrixD_ , typename FilterV_ , typename FilterP_ >
virtual String FEAT::Solver::UzawaPrecond< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >::name ( ) const
inlineoverridevirtual

Returns a descriptive string.

Returns
A string describing the solver.

Implements FEAT::Solver::SolverBase< LAFEM::TupleVector< MatrixB_::VectorTypeL, MatrixD_::VectorTypeL > >.

Definition at line 167 of file uzawa_precond.hpp.

Member Data Documentation

◆ _auto_init_s

template<typename MatrixA_ , typename MatrixB_ , typename MatrixD_ , typename FilterV_ , typename FilterP_ >
const bool FEAT::Solver::UzawaPrecond< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >::_auto_init_s
private

auto-initialize of S-solver

Definition at line 110 of file uzawa_precond.hpp.

Referenced by FEAT::Solver::UzawaPrecond< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >::done_numeric(), FEAT::Solver::UzawaPrecond< Global::Matrix< MatrixA_, MirrorV_, MirrorV_ >, Global::Matrix< MatrixB_, MirrorV_, MirrorP_ >, Global::Matrix< MatrixD_, MirrorP_, MirrorV_ >, Global::Filter< FilterV_, MirrorV_ >, Global::Filter< FilterP_, MirrorP_ > >::done_numeric(), FEAT::Solver::UzawaPrecond< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >::done_symbolic(), FEAT::Solver::UzawaPrecond< Global::Matrix< MatrixA_, MirrorV_, MirrorV_ >, Global::Matrix< MatrixB_, MirrorV_, MirrorP_ >, Global::Matrix< MatrixD_, MirrorP_, MirrorV_ >, Global::Filter< FilterV_, MirrorV_ >, Global::Filter< FilterP_, MirrorP_ > >::done_symbolic(), FEAT::Solver::UzawaPrecond< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >::init_numeric(), FEAT::Solver::UzawaPrecond< Global::Matrix< MatrixA_, MirrorV_, MirrorV_ >, Global::Matrix< MatrixB_, MirrorV_, MirrorP_ >, Global::Matrix< MatrixD_, MirrorP_, MirrorV_ >, Global::Filter< FilterV_, MirrorV_ >, Global::Filter< FilterP_, MirrorP_ > >::init_numeric(), FEAT::Solver::UzawaPrecond< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >::init_symbolic(), and FEAT::Solver::UzawaPrecond< Global::Matrix< MatrixA_, MirrorV_, MirrorV_ >, Global::Matrix< MatrixB_, MirrorV_, MirrorP_ >, Global::Matrix< MatrixD_, MirrorP_, MirrorV_ >, Global::Filter< FilterV_, MirrorV_ >, Global::Filter< FilterP_, MirrorP_ > >::init_symbolic().

◆ _filter_p

template<typename MatrixA_ , typename MatrixB_ , typename MatrixD_ , typename FilterV_ , typename FilterP_ >
const FilterP_& FEAT::Solver::UzawaPrecond< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >::_filter_p
private

Definition at line 102 of file uzawa_precond.hpp.

◆ _filter_v

template<typename MatrixA_ , typename MatrixB_ , typename MatrixD_ , typename FilterV_ , typename FilterP_ >
const FilterV_& FEAT::Solver::UzawaPrecond< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >::_filter_v
private

our system filter

Definition at line 101 of file uzawa_precond.hpp.

◆ _matrix_a

template<typename MatrixA_ , typename MatrixB_ , typename MatrixD_ , typename FilterV_ , typename FilterP_ >
const MatrixA_& FEAT::Solver::UzawaPrecond< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >::_matrix_a
private

Definition at line 97 of file uzawa_precond.hpp.

◆ _matrix_b

template<typename MatrixA_ , typename MatrixB_ , typename MatrixD_ , typename FilterV_ , typename FilterP_ >
const MatrixB_& FEAT::Solver::UzawaPrecond< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >::_matrix_b
private

Definition at line 98 of file uzawa_precond.hpp.

◆ _matrix_d

template<typename MatrixA_ , typename MatrixB_ , typename MatrixD_ , typename FilterV_ , typename FilterP_ >
const MatrixD_& FEAT::Solver::UzawaPrecond< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >::_matrix_d
private

Definition at line 99 of file uzawa_precond.hpp.

◆ _solver_a

template<typename MatrixA_ , typename MatrixB_ , typename MatrixD_ , typename FilterV_ , typename FilterP_ >
std::shared_ptr<SolverA> FEAT::Solver::UzawaPrecond< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >::_solver_a
private

our A-block solver

Definition at line 104 of file uzawa_precond.hpp.

Referenced by FEAT::Solver::UzawaPrecond< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >::done_numeric(), FEAT::Solver::UzawaPrecond< Global::Matrix< MatrixA_, MirrorV_, MirrorV_ >, Global::Matrix< MatrixB_, MirrorV_, MirrorP_ >, Global::Matrix< MatrixD_, MirrorP_, MirrorV_ >, Global::Filter< FilterV_, MirrorV_ >, Global::Filter< FilterP_, MirrorP_ > >::done_numeric(), FEAT::Solver::UzawaPrecond< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >::done_symbolic(), FEAT::Solver::UzawaPrecond< Global::Matrix< MatrixA_, MirrorV_, MirrorV_ >, Global::Matrix< MatrixB_, MirrorV_, MirrorP_ >, Global::Matrix< MatrixD_, MirrorP_, MirrorV_ >, Global::Filter< FilterV_, MirrorV_ >, Global::Filter< FilterP_, MirrorP_ > >::done_symbolic(), FEAT::Solver::UzawaPrecond< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >::init_numeric(), FEAT::Solver::UzawaPrecond< Global::Matrix< MatrixA_, MirrorV_, MirrorV_ >, Global::Matrix< MatrixB_, MirrorV_, MirrorP_ >, Global::Matrix< MatrixD_, MirrorP_, MirrorV_ >, Global::Filter< FilterV_, MirrorV_ >, Global::Filter< FilterP_, MirrorP_ > >::init_numeric(), FEAT::Solver::UzawaPrecond< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >::init_symbolic(), and FEAT::Solver::UzawaPrecond< Global::Matrix< MatrixA_, MirrorV_, MirrorV_ >, Global::Matrix< MatrixB_, MirrorV_, MirrorP_ >, Global::Matrix< MatrixD_, MirrorP_, MirrorV_ >, Global::Filter< FilterV_, MirrorV_ >, Global::Filter< FilterP_, MirrorP_ > >::init_symbolic().

◆ _solver_s

template<typename MatrixA_ , typename MatrixB_ , typename MatrixD_ , typename FilterV_ , typename FilterP_ >
std::shared_ptr<SolverS> FEAT::Solver::UzawaPrecond< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >::_solver_s
private

our S-block solver

Definition at line 106 of file uzawa_precond.hpp.

Referenced by FEAT::Solver::UzawaPrecond< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >::done_numeric(), FEAT::Solver::UzawaPrecond< Global::Matrix< MatrixA_, MirrorV_, MirrorV_ >, Global::Matrix< MatrixB_, MirrorV_, MirrorP_ >, Global::Matrix< MatrixD_, MirrorP_, MirrorV_ >, Global::Filter< FilterV_, MirrorV_ >, Global::Filter< FilterP_, MirrorP_ > >::done_numeric(), FEAT::Solver::UzawaPrecond< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >::done_symbolic(), FEAT::Solver::UzawaPrecond< Global::Matrix< MatrixA_, MirrorV_, MirrorV_ >, Global::Matrix< MatrixB_, MirrorV_, MirrorP_ >, Global::Matrix< MatrixD_, MirrorP_, MirrorV_ >, Global::Filter< FilterV_, MirrorV_ >, Global::Filter< FilterP_, MirrorP_ > >::done_symbolic(), FEAT::Solver::UzawaPrecond< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >::init_numeric(), FEAT::Solver::UzawaPrecond< Global::Matrix< MatrixA_, MirrorV_, MirrorV_ >, Global::Matrix< MatrixB_, MirrorV_, MirrorP_ >, Global::Matrix< MatrixD_, MirrorP_, MirrorV_ >, Global::Filter< FilterV_, MirrorV_ >, Global::Filter< FilterP_, MirrorP_ > >::init_numeric(), FEAT::Solver::UzawaPrecond< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >::init_symbolic(), and FEAT::Solver::UzawaPrecond< Global::Matrix< MatrixA_, MirrorV_, MirrorV_ >, Global::Matrix< MatrixB_, MirrorV_, MirrorP_ >, Global::Matrix< MatrixD_, MirrorP_, MirrorV_ >, Global::Filter< FilterV_, MirrorV_ >, Global::Filter< FilterP_, MirrorP_ > >::init_symbolic().

◆ _uzawa_type

◆ _vec_tmp_p

template<typename MatrixA_ , typename MatrixB_ , typename MatrixD_ , typename FilterV_ , typename FilterP_ >
VectorTypeP FEAT::Solver::UzawaPrecond< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >::_vec_tmp_p
private

Definition at line 113 of file uzawa_precond.hpp.

◆ _vec_tmp_v

template<typename MatrixA_ , typename MatrixB_ , typename MatrixD_ , typename FilterV_ , typename FilterP_ >
VectorTypeV FEAT::Solver::UzawaPrecond< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >::_vec_tmp_v
private

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