LifeV
TwoLevelOperator.hpp
Go to the documentation of this file.
1 /*
2  * TwoLevelOperator.hpp
3  *
4  * Created on: Oct 9, 2011
5  * Author: uvilla
6  */
7 //@HEADER
8 
9 /*!
10  * \file TwoLevelOperator.hpp
11  * \author Umberto Villa
12  * \date 2011-10-09
13  * This file contains the definition of the class \c TwoLevelOperator.
14  * \c TwoLevelOperator defines a two level method, and requires the fine level operator and smoother,
15  * the restriction and prolongation operators, and a coarse solver operator.
16  */
17 
18 #ifndef TWOLEVELOPERATOR_HPP_
19 #define TWOLEVELOPERATOR_HPP_
20 
21 #include <lifev/core/linear_algebra/LinearOperatorAlgebra.hpp>
22 
23 namespace LifeV
24 {
25 
26 namespace Operators
27 {
28 //! @class
29 /*!
30  * @brief It defines a two level methods to approximately apply the inverse of a fine level operator.
31  *
32  * It implements the public interface of \c LinearOperatorAlgebra and it defines the public methods to set information
33  * the fine level operator and smoother, the coarse level solver, the extension and restriction operators.
34  */
36 {
37 public:
39  virtual ~TwoLevelOperator();
40 
41  //! @name Setters
42  //@{
43  //! Set the fine level operator
44  void SetFineLevelOperator(const operatorPtr_Type & fineLevelOper);
45  //! Set the fine level smoother (smootherOper should have a \c ApplyInverse method)
46  void SetSmootherOperator(const operatorPtr_Type & smootherOper);
47  //! Set the coarse level solver (coarseLevelOper should have a \c ApplyInverse method)
48  void SetCoarseLevelOperator(const operatorPtr_Type & coarseLevelOper );
49  //! Set the restriction operator from the fine to coarse level
50  void SetRestrictionOperator(const operatorPtr_Type & restrictionOper );
51  //! Set the extension operatoe from the coarse to fine level.
52  void SetEstensionOperator(const operatorPtr_Type & estensionOper);
53  //@}
54 
55  //! Check that the range and domains of all operators are compatible
56  int checkConsistency();
57 
58  //! \warning not fully supported!
59  virtual int SetUseTranspose(bool UseTranspose);
60  //@}
61 
62  //! @name Mathematical functions
63  //@{
64  virtual int Apply(const vector_Type& X, vector_Type& Y) const;
65 
66  virtual int ApplyInverse(const vector_Type& X, vector_Type& Y) const;
67 
68  virtual double NormInf() const;
69  //@}
70 
71  //! @name Attribute access functions
72  //@{
73 
74  //! Returns a character string describing the operator
75  virtual const char * Label() const;
76 
77  //! Returns the current UseTranspose setting.
78  virtual bool UseTranspose() const;
79 
80  //! Returns true if the \e this object can provide an approximate Inf-norm, false otherwise.
81  virtual bool HasNormInf() const;
82 
83  //! Returns a pointer to the Epetra_Comm communicator associated with this operator.
84  virtual const comm_Type & Comm() const;
85 
86  //! Returns the raw_map object associated with the domain of this operator.
87  virtual const map_Type & OperatorDomainMap() const;
88 
89  //! Returns the raw_map object associated with the range of this operator.
90  virtual const map_Type & OperatorRangeMap() const;
91  //@}
92 
93 private:
99 
100 };
101 
102 } /* end namespace Operators */
103 
104 } /* end namespace LifeV */
105 
106 #endif /* TWOLEVELOPERATOR_HPP_ */
virtual int ApplyInverse(const vector_Type &X, vector_Type &Y) const
Returns the result of a raw_operator inverse applied to an raw_vector X in Y.
virtual const map_Type & OperatorRangeMap() const
Returns the raw_map object associated with the range of this operator.
virtual int Apply(const vector_Type &X, vector_Type &Y) const
Returns the result of a raw_operator applied to a raw_vector X in Y.
void SetSmootherOperator(const operatorPtr_Type &smootherOper)
Set the fine level smoother (smootherOper should have a ApplyInverse method)
virtual bool UseTranspose() const
Returns the current UseTranspose setting.
virtual const char * Label() const
Returns a character string describing the operator.
void SetRestrictionOperator(const operatorPtr_Type &restrictionOper)
Set the restriction operator from the fine to coarse level.
virtual const map_Type & OperatorDomainMap() const
Returns the raw_map object associated with the domain of this operator.
Abstract class which defines the interface of a Linear Operator.
void updateInverseJacobian(const UInt &iQuadPt)
virtual double NormInf() const
Returns the infinity norm of the global matrix.
It defines a two level methods to approximately apply the inverse of a fine level operator...
int checkConsistency()
Check that the range and domains of all operators are compatible.
void SetFineLevelOperator(const operatorPtr_Type &fineLevelOper)
Set the fine level operator.
virtual int SetUseTranspose(bool UseTranspose)
void SetCoarseLevelOperator(const operatorPtr_Type &coarseLevelOper)
Set the coarse level solver (coarseLevelOper should have a ApplyInverse method)
virtual bool HasNormInf() const
Returns true if the this object can provide an approximate Inf-norm, false otherwise.
void SetEstensionOperator(const operatorPtr_Type &estensionOper)
Set the extension operatoe from the coarse to fine level.
virtual const comm_Type & Comm() const
Returns a pointer to the Epetra_Comm communicator associated with this operator.
std::shared_ptr< operator_Type > operatorPtr_Type