PTEMS  0.1.0-dev+git.81fd0e4
PolyTopic Element Method Solver
ptems::LeftPreconditioner< T > Struct Template Referenceabstract

Base type for a left preconditioner. More...

#include <ptems/solvers/gmres.hpp>

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

Public Types

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

Public Member Functions

virtual void ApplyRight (const ParallelComm &, std::vector< T > &) override
 Overridden to no-op. More...
 
virtual PreconditionerType Type () const override
 Overridden to return PreconditionerType::Left. More...
 
virtual 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)=0
 Initialise the preconditioner for the specified matrix. More...
 
virtual void ApplyLeft (const ParallelComm &comm, std::vector< T > &rhs)=0
 Apply the left preconditioner to the specified vector overriding the vector with the result. More...
 

Detailed Description

template<typename T>
struct ptems::LeftPreconditioner< T >

Base type for a left preconditioner.

Overrides Preconditioner::Type() and Preconditioner::ApplyRight() (as a no-op) so that derived types only need to implement Preconditioner::Initialise and Preconditioner::ApplyLeft.

See also
Preconditioner
PreconditionerType
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.

Member Function Documentation

◆ ApplyLeft()

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

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

Implemented in ptems::ILUPreconditioner< T >, and ptems::RightPreconditioner< T >.

◆ ApplyRight()

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

Overridden to no-op.

Implements ptems::Preconditioner< T >.

◆ Initialise()

template<typename T >
virtual void ptems::Preconditioner< 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 
)
pure virtualinherited

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.)

Implemented in ptems::ILUPreconditioner< T >.

◆ Type()

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

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