LifeV
SolverOperatorAlgo Class Referenceabstract

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

#include <SolverOperatorAlgo.hpp>

+ Inheritance diagram for SolverOperatorAlgo:
+ Collaboration diagram for SolverOperatorAlgo:

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

 SolverOperatorAlgo (boost::shared_ptr< Epetra_Comm > comm=boost::shared_ptr< Epetra_Comm >(new Epetra_MpiComm(MPI_COMM_WORLD)))
 
virtual ~SolverOperatorAlgo ()
 
- 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...
 
boost::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 SolverOperatorAlgo.hpp.

Member Enumeration Documentation

◆ SolverOperatorStatusType

Enumerator
undefined 
yes 
no 

Definition at line 62 of file SolverOperatorAlgo.hpp.

Constructor & Destructor Documentation

◆ SolverOperatorAlgo()

SolverOperatorAlgo ( boost::shared_ptr< Epetra_Comm >  comm = boost::shared_ptr<Epetra_Comm> ( new Epetra_MpiComm ( MPI_COMM_WORLD ) ))

Definition at line 47 of file SolverOperatorAlgo.cpp.

◆ ~SolverOperatorAlgo()

~SolverOperatorAlgo ( )
virtual

Definition at line 59 of file SolverOperatorAlgo.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 SolverOperatorAlgo.cpp.

◆ setOperator()

void setOperator ( operatorPtr_Type  _oper)

Definition at line 78 of file SolverOperatorAlgo.cpp.

◆ setPreconditioner()

void setPreconditioner ( operatorPtr_Type  _prec)

Definition at line 86 of file SolverOperatorAlgo.cpp.

◆ setParameters()

void setParameters ( const Teuchos::ParameterList &  _pList)

Definition at line 94 of file SolverOperatorAlgo.cpp.

◆ setTolerance()

void setTolerance ( const Real tolerance)

Definition at line 100 of file SolverOperatorAlgo.cpp.

◆ setUsedForPreconditioning()

void setUsedForPreconditioning ( const bool &  enable)

Definition at line 105 of file SolverOperatorAlgo.cpp.

◆ resetCumulIterations()

void resetCumulIterations ( )
inline

Definition at line 87 of file SolverOperatorAlgo.hpp.

◆ resetSolver()

void resetSolver ( )

Definition at line 110 of file SolverOperatorAlgo.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 SolverOperatorAlgo.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 SolverOperatorAlgo.cpp.

◆ NormInf()

double NormInf ( ) const
inlinevirtual

Returns the infinity norm of the global matrix.

Implements LinearOperator.

Definition at line 106 of file SolverOperatorAlgo.hpp.

◆ resetStatus()

void resetStatus ( )
inline

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

Definition at line 112 of file SolverOperatorAlgo.hpp.

◆ Label()

virtual const char* Label ( ) const
inlinevirtual

Returns a character string describing the operator.

Implements LinearOperator.

Definition at line 125 of file SolverOperatorAlgo.hpp.

◆ UseTranspose()

virtual bool UseTranspose ( ) const
inlinevirtual

Returns the current UseTranspose setting.

Implements LinearOperator.

Definition at line 131 of file SolverOperatorAlgo.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 SolverOperatorAlgo.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 SolverOperatorAlgo.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 SolverOperatorAlgo.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 SolverOperatorAlgo.hpp.

◆ isLossOfAccuracyDetected()

SolverOperatorStatusType isLossOfAccuracyDetected ( ) const
inline

Returns if a loss of precision has been detected.

Definition at line 161 of file SolverOperatorAlgo.hpp.

◆ hasConverged()

SolverOperatorStatusType hasConverged ( ) const
inline

Returns if the convergence has been achieved.

Definition at line 167 of file SolverOperatorAlgo.hpp.

◆ numIterations()

int numIterations ( ) const
inline

Returns the number of iterations.

Definition at line 176 of file SolverOperatorAlgo.hpp.

◆ numCumulIterations()

int numCumulIterations ( ) const
inline

Returns the cumul of iterations.

Definition at line 182 of file SolverOperatorAlgo.hpp.

◆ doApplyInverse()

virtual int doApplyInverse ( const vector_Type X,
vector_Type Y 
) const
protectedpure virtual
+ Here is the caller graph for this function:

◆ doSetOperator()

virtual void doSetOperator ( )
protectedpure virtual
+ Here is the caller graph for this function:

◆ doSetPreconditioner()

virtual void doSetPreconditioner ( )
protectedpure virtual
+ Here is the caller graph for this function:

◆ doSetParameterList()

virtual void doSetParameterList ( )
protectedpure virtual
+ Here is the caller graph for this function:

◆ doResetSolver()

virtual void doResetSolver ( )
protectedpure virtual
+ 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 SolverOperatorAlgo.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 SolverOperatorAlgo.hpp.

◆ M_prec

operatorPtr_Type M_prec
protected

The preconditioner operator.

Definition at line 204 of file SolverOperatorAlgo.hpp.

◆ M_oper

operatorPtr_Type M_oper
protected

The operator to be solved.

Definition at line 207 of file SolverOperatorAlgo.hpp.

◆ M_useTranspose

bool M_useTranspose
protected

Whenever to use the transpose.

Definition at line 210 of file SolverOperatorAlgo.hpp.

◆ M_lossOfAccuracy

SolverOperatorStatusType M_lossOfAccuracy
mutableprotected

Status to see if there is a loss of accuracy.

Definition at line 213 of file SolverOperatorAlgo.hpp.

◆ M_converged

SolverOperatorStatusType M_converged
mutableprotected

Status to see if the solver has converged.

Definition at line 216 of file SolverOperatorAlgo.hpp.

◆ M_numIterations

int M_numIterations
mutableprotected

Number of iterations performed by the solver.

Definition at line 219 of file SolverOperatorAlgo.hpp.

◆ M_numCumulIterations

int M_numCumulIterations
mutableprotected

Number of cumulated iterations performed by the solver.

Definition at line 222 of file SolverOperatorAlgo.hpp.

◆ M_tolerance

Real M_tolerance
protected

Solver tolerance.

Definition at line 225 of file SolverOperatorAlgo.hpp.

◆ M_printSubiterationCount

bool M_printSubiterationCount
protected

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

Definition at line 228 of file SolverOperatorAlgo.hpp.

◆ M_comm

boost::shared_ptr<Epetra_Comm> M_comm
protected

Communicator.

Definition at line 231 of file SolverOperatorAlgo.hpp.


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