38 #include <Epetra_CrsMatrix.h> 39 #include <Epetra_Vector.h> 41 #include <lifev/core/linear_algebra/BlockEpetra_Map.hpp> 42 #include <lifev/navier_stokes_blocks/solver/NavierStokesPreconditionerOperator.hpp> 44 #include <lifev/core/array/MatrixEpetra.hpp> 45 #include <lifev/core/linear_algebra/ApproximatedInvertibleRowMatrix.hpp> 46 #include <Teuchos_ParameterList.hpp> 47 #include <Teuchos_XMLParameterListHelpers.hpp> 49 #include <lifev/core/array/VectorEpetra.hpp> 50 #include <lifev/core/array/MapEpetra.hpp> 54 #ifndef _aSIMPLEOPERATOR_H_ 55 #define _aSIMPLEOPERATOR_H_ 1
62 class aSIMPLEOperator:
public NavierStokesPreconditionerOperator
68 typedef Epetra_MultiVector vector_Type;
69 typedef std::shared_ptr<vector_Type> vectorPtr_Type;
70 typedef Epetra_Map map_Type;
71 typedef std::shared_ptr<map_Type> mapPtr_Type;
73 typedef Epetra_CrsMatrix matrix_Type;
74 typedef std::shared_ptr<matrix_Type> matrixPtr_Type;
76 typedef std::shared_ptr<matrixEpetra_Type> matrixEpetraPtr_Type;
77 typedef Epetra_Vector lumpedMatrix_Type;
78 typedef std::shared_ptr<lumpedMatrix_Type> lumpedMatrixPtr_Type;
81 typedef std::shared_ptr<Teuchos::ParameterList> parameterListPtr_Type;
83 typedef std::shared_ptr<mapEpetra_Type> mapEpetraPtr_Type;
85 typedef std::shared_ptr<VectorEpetra_Type> VectorEpetraPtr_Type;
95 virtual ~aSIMPLEOperator();
108 void setUp(
const matrixEpetraPtr_Type & F,
109 const matrixEpetraPtr_Type & B,
110 const matrixEpetraPtr_Type & Btranspose);
119 void setUp (
const matrixEpetraPtr_Type & F,
120 const matrixEpetraPtr_Type & B,
121 const matrixEpetraPtr_Type & Btranspose,
122 const matrixEpetraPtr_Type & D );
129 int SetUseTranspose(
bool UseTranspose){M_useTranspose = UseTranspose;
return 0;}
132 void setDomainMap(
const std::shared_ptr<BlockEpetra_Map> & domainMap){M_operatorDomainMap = domainMap;}
135 void setRangeMap(
const std::shared_ptr<BlockEpetra_Map> & rangeMap){M_operatorRangeMap = rangeMap;}
138 void setMomentumOptions(
const parameterListPtr_Type & _oList);
141 void setSchurOptions(
const parameterListPtr_Type & _oList);
150 int Apply(
const vector_Type &, vector_Type &)
const {
return -1;};
153 int ApplyInverse( VectorEpetra_Type
const& X_velocity,
154 VectorEpetra_Type
const& X_pressure,
155 VectorEpetra_Type & Y_velocity,
156 VectorEpetra_Type & Y_pressure)
const;
159 int ApplyInverse(
const vector_Type &X, vector_Type &Y)
const;
162 double NormInf()
const {
return -1.0;}
165 void updateApproximatedMomentumOperator();
168 void updateApproximatedSchurComplementOperator();
175 const char * Label()
const {
return M_label.c_str();}
177 bool UseTranspose()
const {
return M_useTranspose;}
179 bool HasNormInf()
const {
return false;}
181 const comm_Type & Comm()
const {
return *M_comm;}
183 const map_Type & OperatorDomainMap()
const {
return *(M_operatorDomainMap->monolithicMap());}
185 const map_Type & OperatorRangeMap()
const {
return *(M_operatorRangeMap->monolithicMap());}
195 void setOptions(
const Teuchos::ParameterList& solversOptions);
198 matrixEpetraPtr_Type
const& F()
const {
return M_F; }
201 matrixEpetraPtr_Type
const& B()
const {
return M_B; }
204 matrixEpetraPtr_Type
const& Btranspose()
const {
return M_Btranspose; }
214 void buildShurComplement();
216 std::shared_ptr<BlockEpetra_Map> M_operatorDomainMap;
218 std::shared_ptr<BlockEpetra_Map> M_operatorRangeMap;
220 matrixEpetraPtr_Type M_F;
222 matrixEpetraPtr_Type M_B;
224 matrixEpetraPtr_Type M_Btranspose;
226 matrixEpetraPtr_Type M_D;
228 matrixEpetraPtr_Type M_schurComplement;
235 std::shared_ptr<Operators::ApproximatedInvertibleRowMatrix> M_approximatedMomentumOperator;
237 std::shared_ptr<Operators::ApproximatedInvertibleRowMatrix> M_approximatedSchurComplementOperator;
239 parameterListPtr_Type M_momentumOptions;
241 parameterListPtr_Type M_schurOptions;
243 mapEpetraPtr_Type M_monolithicMap;
245 std::shared_ptr<Epetra_Vector> M_invD;
247 matrixEpetraPtr_Type M_DBT;
250 const std::string M_label;
253 std::shared_ptr<VectorEpetra_Type> M_Z;
255 std::shared_ptr<VectorEpetra_Type> M_X_velocity;
256 std::shared_ptr<VectorEpetra_Type> M_X_pressure;
257 std::shared_ptr<VectorEpetra_Type> M_Y_velocity;
258 std::shared_ptr<VectorEpetra_Type> M_Y_pressure;
260 std::shared_ptr<mapEpetra_Type> M_domainDBT;
261 std::shared_ptr<mapEpetra_Type> M_rangeDBT;
263 bool M_useStabilization;
268 inline NavierStokesPreconditionerOperator * create_aSIMPLE()
270 return new aSIMPLEOperator ();
VectorEpetra - The Epetra Vector format Wrapper.
static bool S_register_aSimple
void importFromHDF5(std::string const &fileName, std::string const &matrixName="matrix")
Read a matrix from a HDF5 (.h5) file.
Abstract class which defines the interface of a Linear Operator.
void updateInverseJacobian(const UInt &iQuadPt)
static const LifeV::UInt elm_nodes_num[]
Epetra_Import const & importer()
Getter for the Epetra_Import.
double Real
Generic real data.
std::shared_ptr< comm_Type > commPtr_Type