36 #ifndef _BELOSOPERATOR_HPP_ 37 #define _BELOSOPERATOR_HPP_ 39 #include <BelosEpetraAdapter.hpp> 40 #include <BelosSolverManager.hpp> 41 #include <Teuchos_ParameterList.hpp> 42 #include <Teuchos_RefCountPtr.hpp> 44 #include <lifev/core/operator
/SolverOperator.hpp> 55 class BelosOperator :
public SolverOperator
62 enum PreconditionerSide { None, Left, Right };
64 enum SolverManagerType { NotAValidSolverManager, BlockCG, PseudoBlockCG, RCG,
65 BlockGmres, PseudoBlockGmres, GmresPoly,
66 GCRODR, PCPG, TFQMR, MINRES
79 typedef Epetra_MultiVector MV;
80 typedef Epetra_Operator OP;
81 typedef Belos::LinearProblem<
double, MV, OP> LinearProblem;
82 typedef Belos::SolverManager<
double, MV, OP> SolverType;
83 typedef Teuchos::RCP<LinearProblem> LinearProblem_ptr;
84 typedef Teuchos::RCP<SolverType> SolverType_ptr;
87 virtual int doApplyInverse (
const vector_Type& X, vector_Type& Y )
const;
88 virtual void doSetOperator();
89 virtual void doSetPreconditioner();
90 virtual void doSetParameterList();
91 virtual void doResetSolver();
92 void allocateSolver (
const SolverManagerType& solverManagerType );
94 LinearProblem_ptr M_linProblem;
96 SolverType_ptr M_solverManager;
98 Teuchos::RCP<Belos::EpetraPrecOp> M_belosPrec;
100 static SolverManagerType getSolverManagerTypeFromString (
const std::string& str );
101 static PreconditionerSide getPreconditionerSideFromString (
const std::string& str );
105 inline SolverOperator* createBelosOperator()
107 return new BelosOperator();
static bool registerBelos
static const LifeV::UInt elm_nodes_num[]