LifeV
ConfinedOperator.hpp
Go to the documentation of this file.
1 //@HEADER
2 /*
3 *******************************************************************************
4 
5  Copyright (C) 2004, 2005, 2007 EPFL, Politecnico di Milano, INRIA
6  Copyright (C) 2010 EPFL, Politecnico di Milano, Emory University
7 
8  This file is part of LifeV.
9 
10  LifeV is free software; you can redistribute it and/or modify
11  it under the terms of the GNU Lesser General Public License as published by
12  the Free Software Foundation, either version 3 of the License, or
13  (at your option) any later version.
14 
15  LifeV is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public License
21  along with LifeV. If not, see <http://www.gnu.org/licenses/>.
22 
23 *******************************************************************************
24 */
25 //@HEADER
26 
27 /*!
28  @file
29  @brief ConfinedOperator
30 
31  @author Gwenol Grandperrin <gwenol.grandperrin@gmail.com>
32 
33  @date 21-08-2012
34  */
35 
36 #ifndef _CONFINEDOPERATOR_HPP_
37 #define _CONFINEDOPERATOR_HPP_
38 
39 #include <Epetra_Comm.h>
40 #include <Epetra_MpiComm.h>
41 #include <Epetra_Map.h>
42 #include <Epetra_MultiVector.h>
43 #include <Epetra_Operator.h>
44 
45 #include <lifev/core/array/VectorBlockStructure.hpp>
46 #include <lifev/core/array/MapEpetra.hpp>
47 #include <lifev/core/operator/LinearOperator.hpp>
48 
49 namespace LifeV
50 {
51 namespace Operators
52 {
53 
54 //! @class ConfinedOperator
55 /*! @brief Class which wrap an operator to apply it only on a restriction.
56  *
57  */
59 {
60 public:
61 
62  //! @name Public Typedefs and Enumerators
63  //@{
71  //@}
72 
73  //! null constructor and destructor
74  //@{
75 #ifdef HAVE_MPI
77 #else
78  ConfinedOperator ( std::shared_ptr<Epetra_Comm> comm = std::shared_ptr<Epetra_Comm> ( new Epetra_SerialComm ) );
79 #endif
81  //@}
82 
83  //! @name Attribute set methods
84  //@{
85 
86  //! If set true, transpose of this operator will be applied.
87  virtual int SetUseTranspose ( bool useTranspose );
88 
89  void setOperator ( operatorPtr_Type oper );
90 
91  void setFullMap ( const MapEpetra& map );
92 
93  void setBlockStructure ( const blockStructure_Type& blockStructure );
94 
95  void setBlockIndex ( UInt index );
96 
97  //@}
98 
99  //! @name Mathematical methods
100  //@{
101 
102  //! Returns the result of a Epetra_Operator applied to a vector_Type X in Y.
103  virtual int Apply ( const vector_Type& X, vector_Type& Y ) const;
104 
105  //! Returns the result of a Epetra_Operator inverse applied to an vector_Type X in Y.
106  virtual int ApplyInverse ( const vector_Type& X, vector_Type& Y ) const;
107 
108  //! Returns the infinity norm of the global matrix.
109  double NormInf() const;
110 
111  //@}
112 
113  //! @name Attribute access methods
114  //@{
115 
116  //! Returns a character string describing the operator
117  virtual const char* Label() const;
118 
119  //! Returns the current UseTranspose setting.
120  virtual bool UseTranspose() const;
121 
122  //! Returns true if the \e this object can provide an approximate Inf-norm, false otherwise.
123  virtual bool HasNormInf() const;
124 
125  //! Returns a pointer to the Epetra_Comm communicator associated with this operator.
126  virtual const comm_Type& Comm() const;
127 
128  //! Returns the Epetra_Map object associated with the domain of this operator.
129  virtual const map_Type& OperatorDomainMap() const;
130 
131  //! Returns the Epetra_Map object associated with the range of this operator.
132  virtual const map_Type& OperatorRangeMap() const;
133 
134  //@}
135 
136 protected:
137 
143 
144 };
145 
146 } /*end namespace Operators */
147 } /*end namespace LifeV */
148 #endif /* _CONFINEDOPERATOR_HPP_ */
std::shared_ptr< Epetra_Comm > M_comm
Abstract class which defines the interface of a Linear Operator.
void setBlockStructure(const blockStructure_Type &blockStructure)
std::shared_ptr< map_Type > M_map
double NormInf() const
Returns the infinity norm of the global matrix.
VectorBlockStructure - class representing the structure of a vector.
virtual const map_Type & OperatorRangeMap() const
Returns the Epetra_Map object associated with the range of this operator.
void updateInverseJacobian(const UInt &iQuadPt)
virtual bool HasNormInf() const
Returns true if the this object can provide an approximate Inf-norm, false otherwise.
VectorBlockStructure blockStructure_Type
void setOperator(operatorPtr_Type oper)
Epetra_Import const & importer()
Getter for the Epetra_Import.
Definition: MapEpetra.cpp:394
std::shared_ptr< operator_Type > operatorPtr_Type
void setFullMap(const MapEpetra &map)
virtual bool UseTranspose() const
Returns the current UseTranspose setting.
virtual const comm_Type & Comm() const
Returns a pointer to the Epetra_Comm communicator associated with this operator.
virtual const map_Type & OperatorDomainMap() const
Returns the Epetra_Map object associated with the domain of this operator.
virtual const char * Label() const
Returns a character string describing the operator.
ConfinedOperator(std::shared_ptr< Epetra_Comm > comm=std::shared_ptr< Epetra_Comm >(new Epetra_MpiComm(MPI_COMM_WORLD)))
null constructor and destructor
std::shared_ptr< vector_Type > vectorPtr_Type
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.
virtual int SetUseTranspose(bool useTranspose)
If set true, transpose of this operator will be applied.
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. ...
uint32_type UInt
generic unsigned integer (used mainly for addressing)
Definition: LifeV.hpp:191