LifeV
BelosOperatorAlgebra.hpp
Go to the documentation of this file.
1 /*
2  * BelosOperator.hpp
3  *
4  * Created on: Sep 28, 2010
5  * Author: uvilla
6  */
7 
8 //@HEADER
9 
10 /*!
11  * \file BelosOperator.hpp
12  * \author Umberto Villa
13  * \date 2010-09-28
14  * Interface to the Belos linear solver in Trilinos. This interface requires the user to provide
15  * the preconditioner in the form of a LinearOperator.
16  */
17 
18 #ifndef BELOS_OPERATOR_ALGEBRA_HPP_
19 #define BELOS_OPERATOR_ALGEBRA_HPP_
20 
21 #include <BelosEpetraAdapter.hpp>
22 #include <BelosSolverManager.hpp>
23 #include <Teuchos_ParameterList.hpp>
24 
25 #include <lifev/core/linear_algebra/InvertibleOperator.hpp>
26 #include <lifev/core/util/LifeChrono.hpp>
27 
28 namespace LifeV
29 {
30 namespace Operators
31 {
32 //! @class
33 /*! @brief InvertibleOperator interface to Belos in Trilinos.
34  * BelosOperator requires the operator to be solved and the preconditioner in the form of LinearOperator.
35  *
36  * For a description of the class functionality, please refer to the parent class InvertibleOperator.
37  *
38  */
39 
41 {
42 public:
43 
44  //! @name Public Typedefs and Enumerators
45  //@{
46 
48 
52 
58  typedef Belos::SolverManager<double,MV,OP> SolverType;
61 
62  //@}
63 
64  //! null constructor and destructor
65  //@{
68  //@}
71 
72 protected:
73 
74  virtual int doApplyInverse(const vector_Type& X, vector_Type& Y) const;
75  virtual void doSetOperator();
76  virtual void doSetPreconditioner();
77  virtual void doSetParameterList();
78  void allocateSolver(const SolverManagerType & solverManagerType);
79  //! The linearProblem
81  //! The linearSolver
83  //! Cast to a Belos Preconditioner
87 };
88 
89 inline InvertibleOperator* createBelosOperatorAlgebra() { return new BelosOperatorAlgebra(); }
90 namespace
91 {
93 }
94 
95 
96 } /*end namespace Operators */
97 } /*end namespace */
98 #endif /* BELOS_OPERATOR_HPP_ */
std::map< std::string, PreconditionerSide > precSideMap_Type
virtual int doApplyInverse(const vector_Type &X, vector_Type &Y) const
static precSideMap_Type * singletonPrecSideMap()
InvertibleOperator * createBelosOperatorAlgebra()
LinearProblem_ptr M_linProblem
The linearProblem.
Teuchos::RCP< LinearProblem > LinearProblem_ptr
Belos::SolverManager< double, MV, OP > SolverType
static solverManagerMap_Type * singletonSolverManagerMap()
std::map< std::string, SolverManagerType > solverManagerMap_Type
void updateInverseJacobian(const UInt &iQuadPt)
InvertibleOperator interface to Belos in Trilinos. BelosOperator requires the operator to be solved a...
Teuchos::RCP< Belos::EpetraPrecOp > M_belosPrec
Cast to a Belos Preconditioner.
Abstract class which defines the interface of an Invertible Linear Operator Algebra.
static std::unique_ptr< precSideMap_Type > S_precSideMap
static std::unique_ptr< solverManagerMap_Type > S_solverManagerMap
void allocateSolver(const SolverManagerType &solverManagerType)
BelosOperatorAlgebra()
null constructor and destructor
Belos::LinearProblem< double, MV, OP > LinearProblem
SolverType_ptr M_solverManager
The linearSolver.