GEOSX
Public Types | Public Member Functions | List of all members
geos::LinearOperator< VECTOR > Class Template Referenceabstract

Abstract base class for linear operators. More...

#include <LinearOperator.hpp>

Inheritance diagram for geos::LinearOperator< VECTOR >:
Inheritance graph
[legend]

Public Types

using Vector = VECTOR
 Alias for template parameter.
 

Public Member Functions

 LinearOperator ()=default
 Constructor.
 
virtual ~LinearOperator ()=default
 Destructor.
 
virtual void apply (Vector const &src, Vector &dst) const =0
 Apply operator to a vector, dst = this(src). More...
 
virtual void residual (Vector const &x, Vector const &b, Vector &r) const
 Compute residual r = b - this(x). More...
 
virtual globalIndex numGlobalRows () const =0
 Get the number of global rows. More...
 
virtual globalIndex numGlobalCols () const =0
 Get the number of global columns. More...
 
virtual localIndex numLocalRows () const =0
 Get the number of local rows. More...
 
virtual localIndex numLocalCols () const =0
 Get the number of local columns. More...
 
virtual MPI_Comm comm () const =0
 Get the MPI communicator the matrix was created with. More...
 

Detailed Description

template<typename VECTOR>
class geos::LinearOperator< VECTOR >

Abstract base class for linear operators.

Template Parameters
VECTORType of vector this operator can be applied to

Definition at line 33 of file LinearOperator.hpp.

Member Function Documentation

◆ apply()

template<typename VECTOR >
virtual void geos::LinearOperator< VECTOR >::apply ( Vector const &  src,
Vector dst 
) const
pure virtual

◆ comm()

template<typename VECTOR >
virtual MPI_Comm geos::LinearOperator< VECTOR >::comm ( ) const
pure virtual

Get the MPI communicator the matrix was created with.

Returns
MPI communicator passed in create...()
Note
when build without MPI, may return anything (MPI_Comm will be a mock type defined in MpiWrapper)

Implemented in geos::KrylovSolver< VECTOR >, geos::BlockOperatorView< Vector, Matrix >, geos::BlockOperatorView< VECTOR, LinearOperator< VECTOR > >, geos::PreconditionerBase< PetscInterface >, geos::PreconditionerBase< HypreInterface >, and geos::PreconditionerBase< TrilinosInterface >.

◆ numGlobalCols()

template<typename VECTOR >
virtual globalIndex geos::LinearOperator< VECTOR >::numGlobalCols ( ) const
pure virtual

◆ numGlobalRows()

template<typename VECTOR >
virtual globalIndex geos::LinearOperator< VECTOR >::numGlobalRows ( ) const
pure virtual

◆ numLocalCols()

template<typename VECTOR >
virtual localIndex geos::LinearOperator< VECTOR >::numLocalCols ( ) const
pure virtual

Get the number of local columns.

Returns
Number of local columns in the operator.
Note
The use of term "local columns" refers not to physical partitioning of columns across ranks (as e.g. matrices are partitioned by rows and typically physically store all column entries), but to the partitioning of a compatible vector object that this operator can be applied to.

Implemented in geos::KrylovSolver< VECTOR >, geos::BlockOperatorView< Vector, Matrix >, geos::BlockOperatorView< VECTOR, LinearOperator< VECTOR > >, geos::PreconditionerBase< PetscInterface >, geos::PreconditionerBase< HypreInterface >, geos::PreconditionerBase< TrilinosInterface >, geos::MatrixBase< HypreMatrix, HypreVector >, geos::MatrixBase< PetscMatrix, PetscVector >, and geos::MatrixBase< EpetraMatrix, EpetraVector >.

◆ numLocalRows()

template<typename VECTOR >
virtual localIndex geos::LinearOperator< VECTOR >::numLocalRows ( ) const
pure virtual

◆ residual()

template<typename VECTOR >
virtual void geos::LinearOperator< VECTOR >::residual ( Vector const &  x,
Vector const &  b,
Vector r 
) const
inlinevirtual

Compute residual r = b - this(x).

Parameters
xInput solution.
bInput right hand side.
rOutput residual.
Warning
b and x may alias the same vector. r cannot alias any of the other two vectors (some implementations may allow this).

Reimplemented in geos::MatrixBase< MATRIX, VECTOR >, geos::MatrixBase< HypreMatrix, HypreVector >, geos::MatrixBase< PetscMatrix, PetscVector >, and geos::MatrixBase< EpetraMatrix, EpetraVector >.

Definition at line 69 of file LinearOperator.hpp.


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