G+Smo  25.01.0
Geometry + Simulation Modules
 
Loading...
Searching...
No Matches
gsINSBlockPrecondAL< T, MatOrder, BlockFType > Class Template Reference

Detailed Description

template<class T, int MatOrder, class BlockFType = gsINSPrecondBlockFwhole<T, MatOrder>>
class gismo::gsINSBlockPrecondAL< T, MatOrder, BlockFType >

Augmented Lagrangian preconditioner.

Template Parameters
Tcoefficient type
BlockFTypetype of block \fF\f
+ Inheritance diagram for gsINSBlockPrecondAL< T, MatOrder, BlockFType >:
+ Collaboration diagram for gsINSBlockPrecondAL< T, MatOrder, BlockFType >:

Public Member Functions

virtual void apply (const gsMatrix< T > &input, gsMatrix< T > &x) const
 Apply the preconditioner. Computes the vector \fx = P^{-1} y\f.
 
virtual int cols () const
 Returns the number of columns of the preconditioner.
 
virtual std::string getName ()
 Returns the preconditioner name as a string.
 
 gsINSBlockPrecondAL (const std::map< std::string, gsSparseMatrix< T, MatOrder > > &mat, const gsOptionList &opt)
 Constructor.
 
virtual int rows () const
 Returns the number of rows of the preconditioner.
 
virtual void setOptions (const gsOptionList &)
 Set options based on a gsOptionList object.
 
virtual void update (const std::map< std::string, gsSparseMatrix< T, MatOrder > > &mat)
 Update the preconditioner (new linearization or time step).
 

Static Public Member Functions

static gsOptionList defaultOptions ()
 Returns default preconditioner options as a gsOptionList object.
 
static void fillALgammaPart_into (gsSparseMatrix< T, MatOrder > &matGammaPart, gsMatrix< T > &rhsGammaPart, const std::map< std::string, gsSparseMatrix< T, MatOrder > > &mat, const gsMatrix< T > &rhs, const gsOptionList &opt)
 Fill the extra part of the Augmented Lagrangian linear system.
 
static void fillALmodifSystem_into (gsSparseMatrix< T, MatOrder > &matGamma, gsMatrix< T > &rhsGamma, const std::map< std::string, gsSparseMatrix< T, MatOrder > > &mat, const gsMatrix< T > &rhs, const gsOptionList &opt)
 Fill the Augmented Lagrangian linear system.
 
static gsIdentityOp< T > Identity (const index_t dim)
 Identity operator.
 
static uPtr make ()
 Returns a unique pointer to a newly created instance.
 
static uPtr make (const std::map< std::string, gsSparseMatrix< T, MatOrder > > &mat, const gsOptionList &opt)
 Returns a unique pointer to a newly created instance.
 
static uPtr make (gsINSPrecondBlock< T > *Finv, gsLinearOperator< T > *B, gsINSPrecondBlock< T > *Sinv, const gsOptionList &opt)
 Returns a unique pointer to a newly created instance.
 
static uPtr make (std::string precType, const std::map< std::string, gsSparseMatrix< T, MatOrder > > &mat, const gsOptionList &opt)
 Returns a unique pointer to a newly created instance of the given preconditioner type.
 

Protected Member Functions

void update (gsINSPrecondBlock< T > *Finv)
 Update the preconditioner (new linearization or time step). To be used when only the \fF\f block changes.
 
void update (gsINSPrecondBlock< T > *Finv, gsINSPrecondBlock< T > *Sinv)
 Update the preconditioner (new linearization or time step). To be used when both \fF\f and \fS\f block change.
 

Constructor & Destructor Documentation

◆ gsINSBlockPrecondAL()

template<class T , int MatOrder, class BlockFType = gsINSPrecondBlockFwhole<T, MatOrder>>
gsINSBlockPrecondAL ( const std::map< std::string, gsSparseMatrix< T, MatOrder > > &  mat,
const gsOptionList opt 
)
inline

Constructor.

Parameters
[in]mata reference to the std::map of labeled matrices needed for construction of the preconditioner
[in]opta list of options for the preconditioner

Member Function Documentation

◆ apply()

template<class T , int MatOrder>
void apply ( const gsMatrix< T > &  input,
gsMatrix< T > &  x 
) const
virtualinherited

Apply the preconditioner. Computes the vector \fx = P^{-1} y\f.

Parameters
[in]inputa const reference the vector \f y \f
[out]xa reference to the resulting vector \f x \f

Implements gsLinearOperator< T >.

Reimplemented in gsINSBlockPrecondSIMPLE< T, MatOrder, BlockFType >, gsINSBlockPrecondSIMPLE< T, MatOrder, gsINSPrecondBlockF< T, MatOrder > >, gsINSBlockPrecondSIMPLER< T, MatOrder, BlockFType >, and gsINSBlockPrecondMSIMPLER< T, MatOrder, BlockFType >.

◆ fillALgammaPart_into()

template<class T , int MatOrder, class BlockFType >
void fillALgammaPart_into ( gsSparseMatrix< T, MatOrder > &  matGammaPart,
gsMatrix< T > &  rhsGammaPart,
const std::map< std::string, gsSparseMatrix< T, MatOrder > > &  mat,
const gsMatrix< T > &  rhs,
const gsOptionList opt 
)
static

Fill the extra part of the Augmented Lagrangian linear system.

Parameters
[out]matGammaParta reference to the resulting matrix
[out]rhsGammaParta reference to the resulting right-hand side
[in]mata const reference to std::map of labeled blocks of the original system
[in]rhsthe original right-hand side
[in]opta list of options for the preconditioner

◆ fillALmodifSystem_into()

template<class T , int MatOrder, class BlockFType >
void fillALmodifSystem_into ( gsSparseMatrix< T, MatOrder > &  matGamma,
gsMatrix< T > &  rhsGamma,
const std::map< std::string, gsSparseMatrix< T, MatOrder > > &  mat,
const gsMatrix< T > &  rhs,
const gsOptionList opt 
)
static

Fill the Augmented Lagrangian linear system.

Parameters
[out]matGammaa reference to the resulting matrix
[out]rhsGammaa reference to the resulting right-hand side
[in]mata const reference to std::map of labeled blocks of the original system
[in]rhsthe original right-hand side
[in]opta list of options for the preconditioner

◆ make() [1/2]

template<class T , int MatOrder, class BlockFType = gsINSPrecondBlockFwhole<T, MatOrder>>
static uPtr make ( const std::map< std::string, gsSparseMatrix< T, MatOrder > > &  mat,
const gsOptionList opt 
)
inlinestatic

Returns a unique pointer to a newly created instance.

Parameters
[in]mata const reference to std::map of labeled matrices needed for construction of the preconditioner
[in]opta list of options for the preconditioner

◆ make() [2/2]

template<class T , int MatOrder>
gsINSPreconditioner< T, MatOrder >::uPtr make ( std::string  precType,
const std::map< std::string, gsSparseMatrix< T, MatOrder > > &  mat,
const gsOptionList opt 
)
staticinherited

Returns a unique pointer to a newly created instance of the given preconditioner type.

Parameters
[in]precTypethe reqiured preconditioner type as a string
[in]mata const reference to std::map of labeled matrices needed for construction of the preconditioner (assuming the following order: NS system matrix, mass matrix (velocity, pressure or both), other matrices)
[in]opta list of options for the preconditioner

◆ update() [1/3]

template<class T , int MatOrder, class BlockFType = gsINSPrecondBlockFwhole<T, MatOrder>>
virtual void update ( const std::map< std::string, gsSparseMatrix< T, MatOrder > > &  mat)
inlinevirtual

Update the preconditioner (new linearization or time step).

Parameters
[in]mata const reference to std::map of updated matrices

◆ update() [2/3]

template<class T , int MatOrder>
void update ( gsINSPrecondBlock< T > *  Finv)
inlineprotectedinherited

Update the preconditioner (new linearization or time step). To be used when only the \fF\f block changes.

Parameters
[in]Finva pointer to the new \fF\f block

◆ update() [3/3]

template<class T , int MatOrder>
void update ( gsINSPrecondBlock< T > *  Finv,
gsINSPrecondBlock< T > *  Sinv 
)
inlineprotectedinherited

Update the preconditioner (new linearization or time step). To be used when both \fF\f and \fS\f block change.

Parameters
[in]Finva pointer to the new \fF\f block
[in]Sinva pointer to the new \fS\f block