PTEMS  0.1.0-dev+git.81fd0e4
PolyTopic Element Method Solver
ptems::ILUPreconditioner< T > Class Template Reference

Defines a preconditioner using incomplete LU (ILU) factorisation. More...

#include <ptems/solvers/preconditioners/ilu.hpp>

Inheritance diagram for ptems::ILUPreconditioner< T >:
Collaboration diagram for ptems::ILUPreconditioner< T >:

Public Types

typedef T value_type
 The entry types of the matrix to precondition. More...
 

Public Member Functions

 ILUPreconditioner (const SparsityPattern &sparsity, PreconditionerType type=PreconditionerType::Right)
 Creates an incomplete LU factorisation preconditioner with the given sparsity pattern. More...
 
void Initialise (const ParallelComm &comm, const std::vector< SparseMatrixEntry< T >> &mat, std::size_t firstRow, std::size_t size, const std::vector< std::size_t > rowOffset) override
 Initialise the preconditioner for the specified matrix. More...
 
virtual void ApplyLeft (const ParallelComm &comm, std::vector< T > &rhs) override
 Apply the left preconditioner to the specified vector overriding the vector with the result. More...
 
virtual void ApplyRight (const ParallelComm &comm, std::vector< T > &rhs) override
 Apply the right preconditioner to the specified vector overriding the vector with the result. More...
 
virtual PreconditionerType Type () const override
 Gets the type of the preconditioner. More...
 

Detailed Description

template<typename T>
class ptems::ILUPreconditioner< T >

Defines a preconditioner using incomplete LU (ILU) factorisation.

An ILU factorisation performs LU factorisation computes SPARSE lower ( \(L\)) and upper ( \(U\)) triangular matrices such that the residual \(LU-A\), where \(A\) is the matrix being factorised has a given sparsity pattern, and, ideally, such that \(LU \approx A\).

Template Parameters
Thetype of the matrix entries the pre-conditioner is for

Member Typedef Documentation

◆ value_type

template<typename T >
typedef T ptems::Preconditioner< T >::value_type
inherited

The entry types of the matrix to precondition.

Constructor & Destructor Documentation

◆ ILUPreconditioner()

template<typename T >
ptems::ILUPreconditioner< T >::ILUPreconditioner ( const SparsityPattern sparsity,
PreconditionerType  type = PreconditionerType::Right 
)
inline

Creates an incomplete LU factorisation preconditioner with the given sparsity pattern.

Note
If the sparsity pattern is the same as the matrix being factorised then this gives an ILU(0) preconditioner.
Parameters
sparsitySparsity pattern of L+U
typeSpecifies whether this preconditioner should be applied as a left, right, or split preconditioner 9default=Right)

Member Function Documentation

◆ ApplyLeft()

template<typename T >
virtual void ptems::ILUPreconditioner< T >::ApplyLeft ( const ParallelComm comm,
std::vector< T > &  rhs 
)
inlineoverridevirtual

Apply the left preconditioner to the specified vector overriding the vector with the result.

Attention
If the preconditioner is a right preconditioner this method must perform a no-op (return vector unchanged)
Parameters
commMPI communicator for parallel preconditioning
rhsVector to precondition (contains complete vector NOT slice). Update with the preconditioned vector

Implements ptems::Preconditioner< T >.

◆ ApplyRight()

template<typename T >
virtual void ptems::ILUPreconditioner< T >::ApplyRight ( const ParallelComm comm,
std::vector< T > &  rhs 
)
inlineoverridevirtual

Apply the right preconditioner to the specified vector overriding the vector with the result.

Attention
If the preconditioner is a left preconditioner this method must perform a no-op (return vector unchanged)
Parameters
commMPI communicator for parallel preconditioning
rhsVector to precondition (contains complete vector NOT slice). Update with the preconditioned vector

Implements ptems::Preconditioner< T >.

◆ Initialise()

template<typename T >
void ptems::ILUPreconditioner< T >::Initialise ( const ParallelComm comm,
const std::vector< SparseMatrixEntry< T >> &  mat,
std::size_t  firstRow,
std::size_t  size,
const std::vector< std::size_t rowOffset 
)
inlineoverridevirtual

Initialise the preconditioner for the specified matrix.

The preconditioner can be called with a "slice" if using MPI (different processors get different slices)

Attention
If the linear solver is reused (for example in non-linear solvers) this method may be called multiply times with different matrices. The underlying implementation must, therefore, treat each call as a complete new initialisation (essentially construction) of the preconditioner.
Parameters
commMPI communicator for parallel preconditioning
matThe slice of the matrix for the current process as a sparse matrix. Entries are ordered by row, then column
firstRowThe row index of the first row in the slice
sizeThe number of rows (and columns) of the FULL matrix
rowOffsetThe offset into mat for each row in the slice (the offset with index 0 is for firstRow (and will always by 0), 1 for firstRow+1 etc.)

Implements ptems::Preconditioner< T >.

◆ Type()

template<typename T >
virtual PreconditionerType ptems::ILUPreconditioner< T >::Type ( ) const
inlineoverridevirtual

Gets the type of the preconditioner.

Implements ptems::Preconditioner< T >.


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