38 #ifndef NSOPERATOR_HPP_ 39 #define NSOPERATOR_HPP_ 41 #include <Epetra_Import.h> 42 #include <boost/numeric/ublas/matrix.hpp> 44 #include <lifev/core/linear_algebra/BlockEpetra_Map.hpp> 45 #include <lifev/core/linear_algebra/BlockEpetra_MultiVector.hpp> 46 #include <lifev/core/linear_algebra/LinearOperatorAlgebra.hpp> 76 typedef boost::numeric::ublas::matrix<operatorPtr_Type> operatorPtrContainer_Type;
77 typedef std::vector<vectorPtr_Type> vectorPtrContainer_Type;
78 typedef std::vector<mapPtr_Type > mapPtrContainer_Type;
83 NavierStokesOperator();
95 void setUp (
const std::shared_ptr<BlockEpetra_Map> & map,
const commPtr_Type & comm);
107 void setUp (
const std::shared_ptr<BlockEpetra_Map> & domainMap,
108 const std::shared_ptr<BlockEpetra_Map> & rangeMap,
109 const commPtr_Type & comm);
116 void setUp (
const operatorPtrContainer_Type & blockOper,
const commPtr_Type & comm);
123 void setBlock (
UInt iblock,
UInt jblock,
const operatorPtr_Type & operBlock);
126 void fillComplete ();
132 int SetUseTranspose(
bool useTranspose);
135 virtual int Apply(
const vector_Type & X, vector_Type & Y)
const;
140 virtual int ApplyInverse(
const vector_Type & X, vector_Type & Y)
const;
146 double NormInf()
const {
return -1;}
149 virtual const char * Label()
const {
return M_name.c_str();}
152 bool UseTranspose()
const {
return M_useTranspose;}
155 bool HasNormInf()
const {
return false;}
158 const comm_Type & Comm()
const {
return *M_comm;}
161 const operatorPtr_Type& block (
UInt iblock,
UInt jblock)
const;
164 const map_Type & OperatorDomainMap()
const {
return *(M_domainMap->monolithicMap());}
166 const mapPtr_Type & OperatorDomainMap_ptr()
const {
return M_domainMap->monolithicMap();}
167 const std::shared_ptr<BlockEpetra_Map> & OperatorDomainBlockMapPtr()
const {
return M_domainMap;}
170 const map_Type & OperatorRangeMap()
const {
return *(M_rangeMap->monolithicMap());}
172 const mapPtr_Type & OperatorRangeMap_ptr()
const {
return M_rangeMap->monolithicMap();}
173 const std::shared_ptr<BlockEpetra_Map> & OperatorRangeBlockMapPtr()
const {
return M_rangeMap;}
177 int applyNoTranspose(
const vector_Type & X, vector_Type & Y)
const;
179 int applyTranspose(
const vector_Type & X, vector_Type & Y)
const;
181 int blockJacobi(
const vector_Type & X, vector_Type & Y)
const;
183 int blockUpperTriangularSolve(
const vector_Type & X, vector_Type & Y)
const;
185 int blockLowerTriangularSolve(
const vector_Type & X, vector_Type & Y)
const;
187 void setName(
const std::string & name){M_name =name;}
203 std::shared_ptr<BlockEpetra_Map> M_domainMap;
205 std::shared_ptr<BlockEpetra_Map> M_rangeMap;
209 operatorPtrContainer_Type M_oper;
Epetra_Operator operator_Type
std::shared_ptr< map_Type > mapPtr_Type
Abstract class which defines the interface of a Linear Operator.
void updateInverseJacobian(const UInt &iQuadPt)
Epetra_MultiVector vector_Type
std::shared_ptr< comm_Type > commPtr_Type
std::shared_ptr< vector_Type > vectorPtr_Type
uint32_type UInt
generic unsigned integer (used mainly for addressing)
std::shared_ptr< operator_Type > operatorPtr_Type