37 #include <lifev/core/operator
/SolverOperatorAlgo.hpp> 39 #include <Teuchos_RCPBoostSharedPtrConversions.hpp> 48 M_name (
"SolverOperator" ),
80 ASSERT_PRE ( _oper.get() !=
this,
"Can't self assign" );
81 ASSERT_PRE ( _oper.get() != 0,
"Can't assign a null pointer" );
88 ASSERT_PRE ( _prec.get() !=
this,
"Self Assignment is forbidden" );
89 ASSERT_PRE ( _prec.get() != 0,
"Can't assign a null pointer" );
96 M_pList = Teuchos::rcp (
new Teuchos::ParameterList ( _pList ),
true );
119 ASSERT_PRE ( X.Map().SameAs ( M_oper->OperatorDomainMap() ),
"X and domain map do no coincide \n" );
120 ASSERT_PRE ( Y.Map().SameAs ( M_oper->OperatorRangeMap() ) ,
"Y and range map do no coincide \n" );
122 return M_oper->Apply ( X, Y );
127 ASSERT_PRE ( Y.Map().SameAs ( M_oper->OperatorDomainMap() ),
"Y and domain map do no coincide \n" );
128 ASSERT_PRE ( X.Map().SameAs ( M_oper->OperatorRangeMap() ) ,
"X and range map do no coincide \n" );
138 if ( M_comm->MyPID() == 0 && M_printSubiterationCount )
140 std::cout <<
"> " << numIterations() <<
" subiterations" << std::endl;
virtual int SetUseTranspose(bool useTranspose)
If set true, transpose of this operator will be applied.
virtual void doSetParameterList()=0
operatorPtr_Type M_prec
The preconditioner operator.
void setOperator(operatorPtr_Type _oper)
bool M_printSubiterationCount
Print the number of iteration (used only for preconditioner LinearSolver)
virtual ~SolverOperatorAlgo()
void updateInverseJacobian(const UInt &iQuadPt)
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. ...
bool M_useTranspose
Whenever to use the transpose.
void setTolerance(const Real &tolerance)
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.
int M_numIterations
Number of iterations performed by the solver.
void setUsedForPreconditioning(const bool &enable)
double Real
Generic real data.
Real M_tolerance
Solver tolerance.
Epetra_MultiVector vector_Type
virtual void doSetOperator()=0
SolverOperatorAlgo(boost::shared_ptr< Epetra_Comm > comm=boost::shared_ptr< Epetra_Comm >(new Epetra_MpiComm(MPI_COMM_WORLD)))
virtual void doResetSolver()=0
virtual void doSetPreconditioner()=0
std::shared_ptr< operator_Type > operatorPtr_Type
void setPreconditioner(operatorPtr_Type _prec)
operatorPtr_Type M_oper
The operator to be solved.
SolverOperatorStatusType M_converged
Status to see if the solver has converged.
SolverOperatorStatusType M_lossOfAccuracy
Status to see if there is a loss of accuracy.
void setParameters(const Teuchos::ParameterList &_pList)
virtual int doApplyInverse(const vector_Type &X, vector_Type &Y) const =0
int M_numCumulIterations
Number of cumulated iterations performed by the solver.