37 #ifndef _SOLVEROPERATOR_HPP_ 38 #define _SOLVEROPERATOR_HPP_ 41 #include <lifev/core/operator
/LinearOperator.hpp> 42 #include <lifev/core/util/FactorySingleton.hpp> 43 #include <lifev/core/util/Factory.hpp> 44 #include <lifev/core/array/VectorEpetra.hpp> 46 #include <Teuchos_ParameterList.hpp> 47 #include <Teuchos_RCPDecl.hpp> 48 #include <Epetra_MpiComm.h> 67 SolverOperator ( std::shared_ptr<Epetra_Comm> comm = std::shared_ptr<Epetra_Comm> (
new Epetra_SerialComm ) );
108 return M_oper->NormInf();
127 return M_name.c_str();
139 return M_oper->HasNormInf();
145 return M_oper->Comm();
151 return M_oper->OperatorDomainMap();
157 return M_oper->OperatorRangeMap();
int numCumulIterations() const
Returns the cumul of iterations.
virtual bool HasNormInf() const
Returns true if the this object can provide an approximate Inf-norm, false otherwise.
Abstract class which defines the interface of a Linear Operator.
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. ...
int numIterations() const
Returns the number of iterations.
virtual ~SolverOperator()
void setTolerance(const Real &tolerance)
SolverOperatorStatusType M_lossOfAccuracy
Status to see if there is a loss of accuracy.
SolverOperatorStatusType hasConverged() const
Returns if the convergence has been achieved.
virtual void doSetParameterList()=0
void resetCumulIterations()
SolverOperator(std::shared_ptr< Epetra_Comm > comm=std::shared_ptr< Epetra_Comm >(new Epetra_MpiComm(MPI_COMM_WORLD)))
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.
void updateInverseJacobian(const UInt &iQuadPt)
SolverOperatorStatusType M_converged
Status to see if the solver has converged.
virtual const char * Label() const
Returns a character string describing the operator.
virtual bool UseTranspose() const
Returns the current UseTranspose setting.
void setPreconditioner(operatorPtr_Type _prec)
operatorPtr_Type M_oper
The operator to be solved.
virtual void doResetSolver()=0
virtual void doSetOperator()=0
void setUsedForPreconditioning(const bool &enable)
double NormInf() const
Returns the infinity norm of the global matrix.
bool M_printSubiterationCount
Print the number of iteration (used only for preconditioner LinearSolver)
void setOperator(operatorPtr_Type _oper)
double Real
Generic real data.
virtual const map_Type & OperatorRangeMap() const
Returns the Epetra_Map object associated with the range of this operator.
Epetra_MultiVector vector_Type
virtual void doSetPreconditioner()=0
FactorySingleton< Factory< SolverOperator, std::string > > SolverOperatorFactory
operatorPtr_Type M_prec
The preconditioner operator.
std::shared_ptr< Epetra_Comm > M_comm
Communicator.
std::shared_ptr< operator_Type > operatorPtr_Type
virtual int SetUseTranspose(bool useTranspose)
If set true, transpose of this operator will be applied.
SolverOperatorStatusType isLossOfAccuracyDetected() const
Returns if a loss of precision has been detected.
bool M_useTranspose
Whenever to use the transpose.
void resetStatus()
Reset the status for the state of convergence and loss of accuracy.
Real M_tolerance
Solver tolerance.
int M_numCumulIterations
Number of cumulated iterations performed by the solver.
virtual const map_Type & OperatorDomainMap() const
Returns the Epetra_Map object associated with the domain of this operator.
virtual int doApplyInverse(const vector_Type &X, vector_Type &Y) const =0
std::string M_name
The name of the Operator.
virtual const comm_Type & Comm() const
Returns a pointer to the Epetra_Comm communicator associated with this operator.
void setParameters(const Teuchos::ParameterList &_pList)
int M_numIterations
Number of iterations performed by the solver.
Teuchos::RCP< Teuchos::ParameterList > M_pList
The list of Parameter to feed the linear solver.