LifeV
BelosOperator Class Reference

Class which defines the interface of an Invertible Linear Operator through belos. More...

#include <BelosOperator.hpp>

+ Inheritance diagram for BelosOperator:
+ Collaboration diagram for BelosOperator:

Protected Types

typedef Epetra_MultiVector MV
 
typedef Epetra_Operator OP
 
typedef Belos::LinearProblem< double, MV, OPLinearProblem
 
typedef Belos::SolverManager< double, MV, OPSolverType
 
typedef Teuchos::RCP< LinearProblemLinearProblem_ptr
 
typedef Teuchos::RCP< SolverTypeSolverType_ptr
 

Protected Member Functions

virtual int doApplyInverse (const vector_Type &X, vector_Type &Y) const
 
virtual void doSetOperator ()
 
virtual void doSetPreconditioner ()
 
virtual void doSetParameterList ()
 
virtual void doResetSolver ()
 
void allocateSolver (const SolverManagerType &solverManagerType)
 

Static Protected Member Functions

static SolverManagerType getSolverManagerTypeFromString (const std::string &str)
 
static PreconditionerSide getPreconditionerSideFromString (const std::string &str)
 

Protected Attributes

LinearProblem_ptr M_linProblem
 The linearProblem. More...
 
SolverType_ptr M_solverManager
 The linearSolver. More...
 
Teuchos::RCP< Belos::EpetraPrecOp > M_belosPrec
 Cast to a Belos Preconditioner. More...
 
- Protected Attributes inherited from SolverOperator
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...
 

Public Typedefs and Enumerators

enum  PreconditionerSide { None, Left, Right }
 
enum  SolverManagerType {
  NotAValidSolverManager, BlockCG, PseudoBlockCG, RCG,
  BlockGmres, PseudoBlockGmres, GmresPoly, GCRODR,
  PCPG, TFQMR, MINRES
}
 
 BelosOperator ()
 null constructor and destructor More...
 
 ~BelosOperator ()
 

Additional Inherited Members

- Public Types inherited from SolverOperator
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 inherited from SolverOperator
 SolverOperator (std::shared_ptr< Epetra_Comm > comm=std::shared_ptr< Epetra_Comm >(new Epetra_MpiComm(MPI_COMM_WORLD)))
 
virtual ~SolverOperator ()
 
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 ()
 
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...
 
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...
 
- 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...
 

Detailed Description

Class which defines the interface of an Invertible Linear Operator through belos.

Definition at line 55 of file BelosOperator.hpp.

Member Typedef Documentation

◆ MV

typedef Epetra_MultiVector MV
protected

Definition at line 79 of file BelosOperator.hpp.

◆ OP

typedef Epetra_Operator OP
protected

Definition at line 80 of file BelosOperator.hpp.

◆ LinearProblem

typedef Belos::LinearProblem<double, MV, OP> LinearProblem
protected

Definition at line 81 of file BelosOperator.hpp.

◆ SolverType

typedef Belos::SolverManager<double, MV, OP> SolverType
protected

Definition at line 82 of file BelosOperator.hpp.

◆ LinearProblem_ptr

typedef Teuchos::RCP<LinearProblem> LinearProblem_ptr
protected

Definition at line 83 of file BelosOperator.hpp.

◆ SolverType_ptr

typedef Teuchos::RCP<SolverType> SolverType_ptr
protected

Definition at line 84 of file BelosOperator.hpp.

Member Enumeration Documentation

◆ PreconditionerSide

Enumerator
None 
Left 
Right 

Definition at line 62 of file BelosOperator.hpp.

◆ SolverManagerType

Enumerator
NotAValidSolverManager 
BlockCG 
PseudoBlockCG 
RCG 
BlockGmres 
PseudoBlockGmres 
GmresPoly 
GCRODR 
PCPG 
TFQMR 
MINRES 

Definition at line 64 of file BelosOperator.hpp.

Constructor & Destructor Documentation

◆ BelosOperator()

null constructor and destructor

Definition at line 57 of file BelosOperator.cpp.

+ Here is the caller graph for this function:

◆ ~BelosOperator()

Definition at line 64 of file BelosOperator.cpp.

Member Function Documentation

◆ doApplyInverse()

int doApplyInverse ( const vector_Type X,
vector_Type Y 
) const
protectedvirtual

Implements SolverOperator.

Definition at line 71 of file BelosOperator.cpp.

◆ doSetOperator()

void doSetOperator ( )
protectedvirtual

Implements SolverOperator.

Definition at line 115 of file BelosOperator.cpp.

◆ doSetPreconditioner()

void doSetPreconditioner ( )
protectedvirtual

Implements SolverOperator.

Definition at line 121 of file BelosOperator.cpp.

◆ doSetParameterList()

void doSetParameterList ( )
protectedvirtual

Implements SolverOperator.

Definition at line 131 of file BelosOperator.cpp.

◆ doResetSolver()

void doResetSolver ( )
protectedvirtual

Implements SolverOperator.

Definition at line 291 of file BelosOperator.cpp.

◆ allocateSolver()

void allocateSolver ( const SolverManagerType solverManagerType)
protected

Definition at line 168 of file BelosOperator.cpp.

+ Here is the caller graph for this function:

◆ getSolverManagerTypeFromString()

BelosOperator::SolverManagerType getSolverManagerTypeFromString ( const std::string &  str)
staticprotected

Definition at line 225 of file BelosOperator.cpp.

+ Here is the caller graph for this function:

◆ getPreconditionerSideFromString()

BelosOperator::PreconditionerSide getPreconditionerSideFromString ( const std::string &  str)
staticprotected

Definition at line 274 of file BelosOperator.cpp.

+ Here is the caller graph for this function:

Field Documentation

◆ M_linProblem

LinearProblem_ptr M_linProblem
protected

The linearProblem.

Definition at line 94 of file BelosOperator.hpp.

◆ M_solverManager

SolverType_ptr M_solverManager
protected

The linearSolver.

Definition at line 96 of file BelosOperator.hpp.

◆ M_belosPrec

Teuchos::RCP<Belos::EpetraPrecOp> M_belosPrec
protected

Cast to a Belos Preconditioner.

Definition at line 98 of file BelosOperator.hpp.


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