Loading...
Searching...
No Matches
DiagonalPreconditioner< Type, DType, LUType > Class Template Reference

Diagonal preconditioner for both symmetric and asymmetric matrices. More...

#include <DiagonalPreconditioner.H>

Inheritance diagram for DiagonalPreconditioner< Type, DType, LUType >:
Collaboration diagram for DiagonalPreconditioner< Type, DType, LUType >:

Public Member Functions

 TypeName ("diagonal")
 Runtime type information.
 DiagonalPreconditioner (const typename LduMatrix< Type, DType, LUType >::solver &sol, const dictionary &preconditionerDict)
 Construct from matrix components and preconditioner data dictionary.
virtual ~DiagonalPreconditioner ()=default
virtual void read (const dictionary &preconditionerDict)
 Read and reset the preconditioner parameters from the given.
virtual void precondition (Field< Type > &wA, const Field< Type > &rA) const
 Return wA the preconditioned form of residual rA.
virtual void preconditionT (Field< Type > &wT, const Field< Type > &rT) const
 Return wT the transpose-matrix preconditioned form of.
Public Member Functions inherited from LduMatrix< Type, DType, LUType >::preconditioner
virtual const wordtype () const =0
 Runtime type information.
 declareRunTimeSelectionTable (autoPtr, preconditioner, symMatrix,(const solver &sol, const dictionary &preconditionerDict),(sol, preconditionerDict))
 declareRunTimeSelectionTable (autoPtr, preconditioner, asymMatrix,(const solver &sol, const dictionary &preconditionerDict),(sol, preconditionerDict))
 preconditioner (const solver &sol)
 Construct for given solver.
virtual ~preconditioner ()=default
 Destructor.

Additional Inherited Members

Static Public Member Functions inherited from LduMatrix< Type, DType, LUType >::preconditioner
static autoPtr< preconditionerNew (const solver &sol, const dictionary &preconditionerDict)
 Return a new preconditioner.
Protected Attributes inherited from LduMatrix< Type, DType, LUType >::preconditioner
const solversolver_
 Reference to the base-solver this preconditioner is used with.

Detailed Description

template<class Type, class DType, class LUType>
class Foam::DiagonalPreconditioner< Type, DType, LUType >

Diagonal preconditioner for both symmetric and asymmetric matrices.

The inverse (reciprocal for scalar) of the diagonal is calculated and stored.

Source files

Definition at line 51 of file DiagonalPreconditioner.H.

Constructor & Destructor Documentation

◆ DiagonalPreconditioner()

template<class Type, class DType, class LUType>
DiagonalPreconditioner ( const typename LduMatrix< Type, DType, LUType >::solver & sol,
const dictionary & preconditionerDict )

Construct from matrix components and preconditioner data dictionary.

Definition at line 26 of file DiagonalPreconditioner.C.

References Foam::diag(), Foam::inv(), LduMatrix< Type, DType, LUType >::preconditioner::preconditioner(), and LduMatrix< Type, DType, LUType >::preconditioner::solver_.

Here is the call graph for this function:

◆ ~DiagonalPreconditioner()

template<class Type, class DType, class LUType>
virtual ~DiagonalPreconditioner ( )
virtualdefault

Member Function Documentation

◆ TypeName()

template<class Type, class DType, class LUType>
TypeName ( "diagonal" )

Runtime type information.

◆ read()

template<class Type, class DType, class LUType>
void read ( const dictionary & preconditionerDict)
virtual

Read and reset the preconditioner parameters from the given.

dictionary

Reimplemented from LduMatrix< Type, DType, LUType >::preconditioner.

Definition at line 51 of file DiagonalPreconditioner.C.

◆ precondition()

template<class Type, class DType, class LUType>
void precondition ( Field< Type > & wA,
const Field< Type > & rA ) const
virtual

Return wA the preconditioned form of residual rA.

Implements LduMatrix< Type, DType, LUType >::preconditioner.

Definition at line 56 of file DiagonalPreconditioner.C.

References UList< T >::begin(), Foam::dot(), and UList< T >::size().

Referenced by preconditionT().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ preconditionT()

template<class Type, class DType, class LUType>
virtual void preconditionT ( Field< Type > & wT,
const Field< Type > & rT ) const
inlinevirtual

Return wT the transpose-matrix preconditioned form of.

residual rT.

Reimplemented from LduMatrix< Type, DType, LUType >::preconditioner.

Definition at line 124 of file DiagonalPreconditioner.H.

References precondition().

Here is the call graph for this function:

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