37 #include <lifev/core/operator
/SolverOperator.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 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. ...
virtual ~SolverOperator()
void setTolerance(const Real &tolerance)
SolverOperatorStatusType M_lossOfAccuracy
Status to see if there is a loss of accuracy.
virtual void doSetParameterList()=0
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.
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)
bool M_printSubiterationCount
Print the number of iteration (used only for preconditioner LinearSolver)
void setOperator(operatorPtr_Type _oper)
double Real
Generic real data.
Epetra_MultiVector vector_Type
virtual void doSetPreconditioner()=0
operatorPtr_Type M_prec
The preconditioner operator.
std::shared_ptr< operator_Type > operatorPtr_Type
virtual int SetUseTranspose(bool useTranspose)
If set true, transpose of this operator will be applied.
bool M_useTranspose
Whenever to use the transpose.
Real M_tolerance
Solver tolerance.
int M_numCumulIterations
Number of cumulated iterations performed by the solver.
virtual int doApplyInverse(const vector_Type &X, vector_Type &Y) const =0
void setParameters(const Teuchos::ParameterList &_pList)
int M_numIterations
Number of iterations performed by the solver.