LifeV
SolverOperator Class Referenceabstract

Abstract class which defines the interface of an Invertible Linear Operator. More...

#include <SolverOperator.hpp>

+ Inheritance diagram for SolverOperator:
+ Collaboration diagram for SolverOperator:

Public Types

enum  SolverOperatorStatusType { undefined, yes, no }
 
- Public Types inherited from LinearOperator
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
 

Public Member Functions

 SolverOperator (std::shared_ptr< Epetra_Comm > comm=std::shared_ptr< Epetra_Comm >(new Epetra_MpiComm(MPI_COMM_WORLD)))
 
virtual ~SolverOperator ()
 
- Public Member Functions inherited from LinearOperator
virtual ~LinearOperator ()
 Destructor. More...
 
int apply (const VectorEpetra &X, VectorEpetra &Y) const
 Returns the result of a LinearOperator applied to a VectorEpetra 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...
 

Protected Member Functions

virtual int doApplyInverse (const vector_Type &X, vector_Type &Y) const =0
 
virtual void doSetOperator ()=0
 
virtual void doSetPreconditioner ()=0
 
virtual void doSetParameterList ()=0
 
virtual void doResetSolver ()=0
 

Protected Attributes

std::string M_name
 The name of the Operator. More...
 
Teuchos::RCP< Teuchos::ParameterList > M_pList
 The list of Parameter to feed the linear solver. More...
 
operatorPtr_Type M_prec
 The preconditioner operator. More...
 
operatorPtr_Type M_oper
 The operator to be solved. More...
 
bool M_useTranspose
 Whenever to use the transpose. More...
 
SolverOperatorStatusType M_lossOfAccuracy
 Status to see if there is a loss of accuracy. More...
 
SolverOperatorStatusType M_converged
 Status to see if the solver has converged. More...
 
int M_numIterations
 Number of iterations performed by the solver. More...
 
int M_numCumulIterations
 Number of cumulated iterations performed by the solver. More...
 
Real M_tolerance
 Solver tolerance. More...
 
bool M_printSubiterationCount
 Print the number of iteration (used only for preconditioner LinearSolver) More...
 
std::shared_ptr< Epetra_Comm > M_comm
 Communicator. More...
 

Attribute set methods

virtual int SetUseTranspose (bool useTranspose)
 If set true, transpose of this operator will be applied. More...
 
void setOperator (operatorPtr_Type _oper)
 
void setPreconditioner (operatorPtr_Type _prec)
 
void setParameters (const Teuchos::ParameterList &_pList)
 
void setTolerance (const Real &tolerance)
 
void setUsedForPreconditioning (const bool &enable)
 
void resetCumulIterations ()
 
void resetSolver ()
 

Mathematical methods

virtual int Apply (const vector_Type &X, vector_Type &Y) const
 Returns the result of a Epetra_Operator applied to a vector_Type X in Y. More...
 
virtual int ApplyInverse (const vector_Type &X, vector_Type &Y) const
 Returns the result of a Epetra_Operator inverse applied to an vector_Type X in Y. More...
 
double NormInf () const
 Returns the infinity norm of the global matrix. More...
 
void resetStatus ()
 Reset the status for the state of convergence and loss of accuracy. More...
 

Attribute access methods

virtual const char * Label () const
 Returns a character string describing the operator. More...
 
virtual bool UseTranspose () const
 Returns the current UseTranspose setting. More...
 
virtual bool HasNormInf () const
 Returns true if the this object can provide an approximate Inf-norm, false otherwise. More...
 
virtual const comm_TypeComm () const
 Returns a pointer to the Epetra_Comm communicator associated with this operator. More...
 
virtual const map_TypeOperatorDomainMap () const
 Returns the Epetra_Map object associated with the domain of this operator. More...
 
virtual const map_TypeOperatorRangeMap () const
 Returns the Epetra_Map object associated with the range of this operator. More...
 
SolverOperatorStatusType isLossOfAccuracyDetected () const
 Returns if a loss of precision has been detected. More...
 
SolverOperatorStatusType hasConverged () const
 Returns if the convergence has been achieved. More...
 
int numIterations () const
 Returns the number of iterations. More...
 
int numCumulIterations () const
 Returns the cumul of iterations. More...
 

Detailed Description

Abstract class which defines the interface of an Invertible Linear Operator.

Definition at line 59 of file SolverOperator.hpp.

Member Enumeration Documentation

◆ SolverOperatorStatusType

Enumerator
undefined 
yes 
no 

Definition at line 62 of file SolverOperator.hpp.

Constructor & Destructor Documentation

◆ SolverOperator()

SolverOperator ( std::shared_ptr< Epetra_Comm >  comm = std::shared_ptr<Epetra_Comm> ( new Epetra_MpiComm ( MPI_COMM_WORLD ) ))

Definition at line 47 of file SolverOperator.cpp.

+ Here is the caller graph for this function:

◆ ~SolverOperator()

~SolverOperator ( )
virtual

Definition at line 59 of file SolverOperator.cpp.

Member Function Documentation

◆ SetUseTranspose()

int SetUseTranspose ( bool  useTranspose)
virtual

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

Implements LinearOperator.

Definition at line 65 of file SolverOperator.cpp.

◆ setOperator()

void setOperator ( operatorPtr_Type  _oper)

Definition at line 78 of file SolverOperator.cpp.

◆ setPreconditioner()

void setPreconditioner ( operatorPtr_Type  _prec)

Definition at line 86 of file SolverOperator.cpp.

◆ setParameters()

void setParameters ( const Teuchos::ParameterList &  _pList)

Definition at line 94 of file SolverOperator.cpp.

◆ setTolerance()

void setTolerance ( const Real tolerance)

Definition at line 100 of file SolverOperator.cpp.

◆ setUsedForPreconditioning()

void setUsedForPreconditioning ( const bool &  enable)

Definition at line 105 of file SolverOperator.cpp.

◆ resetCumulIterations()

void resetCumulIterations ( )
inline

Definition at line 87 of file SolverOperator.hpp.

◆ resetSolver()

void resetSolver ( )

Definition at line 110 of file SolverOperator.cpp.

◆ Apply()

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

Returns the result of a Epetra_Operator applied to a vector_Type X in Y.

Implements LinearOperator.

Definition at line 117 of file SolverOperator.cpp.

◆ ApplyInverse()

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

Returns the result of a Epetra_Operator inverse applied to an vector_Type X in Y.

Implements LinearOperator.

Definition at line 125 of file SolverOperator.cpp.

◆ NormInf()

double NormInf ( ) const
inlinevirtual

Returns the infinity norm of the global matrix.

Implements LinearOperator.

Definition at line 106 of file SolverOperator.hpp.

◆ resetStatus()

void resetStatus ( )
inline

Reset the status for the state of convergence and loss of accuracy.

Definition at line 112 of file SolverOperator.hpp.

◆ Label()

virtual const char* Label ( ) const
inlinevirtual

Returns a character string describing the operator.

Implements LinearOperator.

Definition at line 125 of file SolverOperator.hpp.

◆ UseTranspose()

virtual bool UseTranspose ( ) const
inlinevirtual

Returns the current UseTranspose setting.

Implements LinearOperator.

Definition at line 131 of file SolverOperator.hpp.

◆ HasNormInf()

virtual bool HasNormInf ( ) const
inlinevirtual

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

Implements LinearOperator.

Definition at line 137 of file SolverOperator.hpp.

◆ Comm()

virtual const comm_Type& Comm ( ) const
inlinevirtual

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

Implements LinearOperator.

Definition at line 143 of file SolverOperator.hpp.

◆ OperatorDomainMap()

virtual const map_Type& OperatorDomainMap ( ) const
inlinevirtual

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

Implements LinearOperator.

Definition at line 149 of file SolverOperator.hpp.

◆ OperatorRangeMap()

virtual const map_Type& OperatorRangeMap ( ) const
inlinevirtual

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

Implements LinearOperator.

Definition at line 155 of file SolverOperator.hpp.

◆ isLossOfAccuracyDetected()

SolverOperatorStatusType isLossOfAccuracyDetected ( ) const
inline

Returns if a loss of precision has been detected.

Definition at line 161 of file SolverOperator.hpp.

◆ hasConverged()

SolverOperatorStatusType hasConverged ( ) const
inline

Returns if the convergence has been achieved.

Definition at line 167 of file SolverOperator.hpp.

◆ numIterations()

int numIterations ( ) const
inline

Returns the number of iterations.

Definition at line 176 of file SolverOperator.hpp.

◆ numCumulIterations()

int numCumulIterations ( ) const
inline

Returns the cumul of iterations.

Definition at line 182 of file SolverOperator.hpp.

◆ doApplyInverse()

virtual int doApplyInverse ( const vector_Type X,
vector_Type Y 
) const
protectedpure virtual

Implemented in BelosOperator, and AztecooOperator.

+ Here is the caller graph for this function:

◆ doSetOperator()

virtual void doSetOperator ( )
protectedpure virtual

Implemented in BelosOperator, and AztecooOperator.

+ Here is the caller graph for this function:

◆ doSetPreconditioner()

virtual void doSetPreconditioner ( )
protectedpure virtual

Implemented in BelosOperator, and AztecooOperator.

+ Here is the caller graph for this function:

◆ doSetParameterList()

virtual void doSetParameterList ( )
protectedpure virtual

Implemented in BelosOperator, and AztecooOperator.

+ Here is the caller graph for this function:

◆ doResetSolver()

virtual void doResetSolver ( )
protectedpure virtual

Implemented in BelosOperator, and AztecooOperator.

+ Here is the caller graph for this function:

Field Documentation

◆ M_name

std::string M_name
protected

The name of the Operator.

Definition at line 198 of file SolverOperator.hpp.

◆ M_pList

Teuchos::RCP<Teuchos::ParameterList> M_pList
protected

The list of Parameter to feed the linear solver.

Definition at line 201 of file SolverOperator.hpp.

◆ M_prec

operatorPtr_Type M_prec
protected

The preconditioner operator.

Definition at line 204 of file SolverOperator.hpp.

◆ M_oper

operatorPtr_Type M_oper
protected

The operator to be solved.

Definition at line 207 of file SolverOperator.hpp.

◆ M_useTranspose

bool M_useTranspose
protected

Whenever to use the transpose.

Definition at line 210 of file SolverOperator.hpp.

◆ M_lossOfAccuracy

SolverOperatorStatusType M_lossOfAccuracy
mutableprotected

Status to see if there is a loss of accuracy.

Definition at line 213 of file SolverOperator.hpp.

◆ M_converged

SolverOperatorStatusType M_converged
mutableprotected

Status to see if the solver has converged.

Definition at line 216 of file SolverOperator.hpp.

◆ M_numIterations

int M_numIterations
mutableprotected

Number of iterations performed by the solver.

Definition at line 219 of file SolverOperator.hpp.

◆ M_numCumulIterations

int M_numCumulIterations
mutableprotected

Number of cumulated iterations performed by the solver.

Definition at line 222 of file SolverOperator.hpp.

◆ M_tolerance

Real M_tolerance
protected

Solver tolerance.

Definition at line 225 of file SolverOperator.hpp.

◆ M_printSubiterationCount

bool M_printSubiterationCount
protected

Print the number of iteration (used only for preconditioner LinearSolver)

Definition at line 228 of file SolverOperator.hpp.

◆ M_comm

std::shared_ptr<Epetra_Comm> M_comm
protected

Communicator.

Definition at line 231 of file SolverOperator.hpp.


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