LifeV
LinearOperator Class Referenceabstract

Abstract class which defines the interface of a Linear Operator. More...

#include <LinearOperator.hpp>

+ Inheritance diagram for LinearOperator:
+ Collaboration diagram for LinearOperator:

Public Types

typedef Epetra_Comm comm_Type
 
typedef std::shared_ptr< comm_TypecommPtr_Type
 
typedef Epetra_Map map_Type
 
typedef std::shared_ptr< map_TypemapPtr_Type
 
typedef std::shared_ptr< const map_TypeconstMapPtr_Type
 
typedef Epetra_Operator operator_Type
 
typedef std::shared_ptr< operator_TypeoperatorPtr_Type
 
typedef Epetra_MultiVector vector_Type
 
typedef std::shared_ptr< vector_TypevectorPtr_Type
 

Destructor

virtual ~LinearOperator ()
 Destructor. More...
 

Attribute set methods

virtual int SetUseTranspose (bool UseTranspose)=0
 If set true, transpose of this operator will be applied. More...
 

Mathematical functions

virtual int Apply (const vector_Type &X, vector_Type &Y) const =0
 Returns the result of a raw_operator applied to a raw_vector X in Y. More...
 
int apply (const VectorEpetra &X, VectorEpetra &Y) const
 Returns the result of a LinearOperator applied to a VectorEpetra X in Y. More...
 
virtual int ApplyInverse (const vector_Type &X, vector_Type &Y) const =0
 Returns the result of a raw_operator inverse applied to an raw_vector X in Y. More...
 
int applyInverse (const VectorEpetra &X, VectorEpetra &Y)
 Returns the result of a LinearOperator inverse applied to an VectorEpetra X in Y. More...
 
virtual double NormInf () const =0
 Returns the infinity norm of the global matrix. More...
 

Attribute access functions

virtual const char * Label () const =0
 Returns a character string describing the operator. More...
 
virtual bool UseTranspose () const =0
 Returns the current UseTranspose setting. More...
 
virtual bool HasNormInf () const =0
 Returns true if the this object can provide an approximate Inf-norm, false otherwise. More...
 
virtual const comm_TypeComm () const =0
 Returns a pointer to the Epetra_Comm communicator associated with this operator. More...
 
virtual const map_TypeOperatorDomainMap () const =0
 Returns the raw_map object associated with the domain of this operator. More...
 
virtual const map_TypeOperatorRangeMap () const =0
 Returns the raw_map object associated with the range of this operator. More...
 

Detailed Description

Abstract class which defines the interface of a Linear Operator.

LinearOperator is an abstract which inherits from Epetra_Operator. LinearOperator should be the base class for all the LifeV class which implements a linear operator.

LinearOperator ensures perfect compatibility with all the Trilinos solvers, plus it supports directly the LifeV::VectorEpetra data.

Two concrete methods are implemented in LinearOperator int apply(const VectorEpetra &X, VectorEpetra & Y) const ; int applyInverse(const VectorEpetra &X, VectorEpetra &Y) const.

Such methods extract a raw Epetra_MultiVector from the VectorEpetra and then call the virtual methods Int Apply(const Epetra_MultiVector & X, Epetra_MultiVector & Y) const or Int ApplyInverse(const Epetra_MultiVector & X, Epetra_MultiVector & Y) const respectively.

Definition at line 75 of file LinearOperator.hpp.

Member Typedef Documentation

◆ comm_Type

typedef Epetra_Comm comm_Type

Definition at line 81 of file LinearOperator.hpp.

◆ commPtr_Type

typedef std::shared_ptr<comm_Type> commPtr_Type

Definition at line 82 of file LinearOperator.hpp.

◆ map_Type

typedef Epetra_Map map_Type

Definition at line 83 of file LinearOperator.hpp.

◆ mapPtr_Type

typedef std::shared_ptr<map_Type> mapPtr_Type

Definition at line 84 of file LinearOperator.hpp.

◆ constMapPtr_Type

typedef std::shared_ptr<const map_Type> constMapPtr_Type

Definition at line 85 of file LinearOperator.hpp.

◆ operator_Type

Definition at line 86 of file LinearOperator.hpp.

◆ operatorPtr_Type

typedef std::shared_ptr<operator_Type> operatorPtr_Type

Definition at line 87 of file LinearOperator.hpp.

◆ vector_Type

Definition at line 88 of file LinearOperator.hpp.

◆ vectorPtr_Type

typedef std::shared_ptr<vector_Type> vectorPtr_Type

Definition at line 89 of file LinearOperator.hpp.

Constructor & Destructor Documentation

◆ ~LinearOperator()

virtual ~LinearOperator ( )
inlinevirtual

Destructor.

Definition at line 95 of file LinearOperator.hpp.

Member Function Documentation

◆ SetUseTranspose()

virtual int SetUseTranspose ( bool  UseTranspose)
pure virtual

If set true, transpose of this operator will be applied.

This flag allows the transpose of the given operator to be used implicitly. Setting this flag affects only the Apply() and ApplyInverse() methods. If the implementation of this interface does not support transpose use, this method should return a value of -1.

Parameters
InUseTranspose -If true, multiply by the transpose of operator, otherwise just use operator.
Returns
Integer error code, set to 0 if successful. Set to -1 if this implementation does not support transpose.

Implemented in ConfinedOperator, SolverOperator, and SolverOperatorAlgo.

◆ Apply()

virtual int Apply ( const vector_Type X,
vector_Type Y 
) const
pure virtual

Returns the result of a raw_operator applied to a raw_vector X in Y.

Parameters
InX - A raw_vector of dimension NumVectors to multiply with matrix.
OutY -A raw_vector of dimension NumVectors containing result.
Returns
Integer error code, set to 0 if successful.

Implemented in ConfinedOperator, SolverOperator, and SolverOperatorAlgo.

+ Here is the caller graph for this function:

◆ apply()

int apply ( const VectorEpetra X,
VectorEpetra Y 
) const
inline

Returns the result of a LinearOperator applied to a VectorEpetra X in Y.

Parameters
InX - A VectorEpetra to multiply with matrix.
OutY -A VectorEpetra containing result.
Returns
Integer error code, set to 0 if successful.

Definition at line 137 of file LinearOperator.hpp.

◆ ApplyInverse()

virtual int ApplyInverse ( const vector_Type X,
vector_Type Y 
) const
pure virtual

Returns the result of a raw_operator inverse applied to an raw_vector X in Y.

Parameters
InX - A raw_vector of dimension NumVectors to solve for.
OutY -A raw_vector of dimension NumVectors containing result.
Returns
Integer error code, set to 0 if successful.
Warning
In order to work with AztecOO, any implementation of this method must support the case where X and Y are the same object.

Implemented in ConfinedOperator, SolverOperator, and SolverOperatorAlgo.

+ Here is the caller graph for this function:

◆ applyInverse()

int applyInverse ( const VectorEpetra X,
VectorEpetra Y 
)
inline

Returns the result of a LinearOperator inverse applied to an VectorEpetra X in Y.

Parameters
InX - A VectorEpetra to solve for.
OutY -A VectorEpetra containing result.
Returns
Integer error code, set to 0 if successful.
Warning
In order to work with AztecOO, any implementation of this method must support the case where X and Y are the same object.

Definition at line 169 of file LinearOperator.hpp.

◆ NormInf()

virtual double NormInf ( ) const
pure virtual

Returns the infinity norm of the global matrix.

Implemented in ConfinedOperator, SolverOperator, and SolverOperatorAlgo.

◆ Label()

virtual const char* Label ( ) const
pure virtual

Returns a character string describing the operator.

Implemented in SolverOperator, SolverOperatorAlgo, and ConfinedOperator.

◆ UseTranspose()

virtual bool UseTranspose ( ) const
pure virtual

Returns the current UseTranspose setting.

Implemented in SolverOperator, SolverOperatorAlgo, and ConfinedOperator.

◆ HasNormInf()

virtual bool HasNormInf ( ) const
pure virtual

Returns true if the this object can provide an approximate Inf-norm, false otherwise.

Implemented in SolverOperator, SolverOperatorAlgo, and ConfinedOperator.

◆ Comm()

virtual const comm_Type& Comm ( ) const
pure virtual

Returns a pointer to the Epetra_Comm communicator associated with this operator.

Implemented in SolverOperator, SolverOperatorAlgo, and ConfinedOperator.

◆ OperatorDomainMap()

virtual const map_Type& OperatorDomainMap ( ) const
pure virtual

Returns the raw_map object associated with the domain of this operator.

Implemented in SolverOperator, SolverOperatorAlgo, and ConfinedOperator.

◆ OperatorRangeMap()

virtual const map_Type& OperatorRangeMap ( ) const
pure virtual

Returns the raw_map object associated with the range of this operator.

Implemented in SolverOperator, SolverOperatorAlgo, and ConfinedOperator.


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