35 #ifndef PRECONDITIONERLSC_HPP 36 #define PRECONDITIONERLSC_HPP 1
38 #include <lifev/core/LifeV.hpp> 40 #ifdef LIFEV_HAVE_TEKO 42 #include <boost/shared_ptr.hpp> 44 #include <lifev/core/filter/GetPot.hpp> 45 #include <lifev/core/array/MatrixEpetra.hpp> 46 #include <lifev/core/fem/FESpace.hpp> 47 #include <lifev/core/algorithm/PreconditionerTeko.hpp> 48 #include <lifev/core/mesh/RegionMesh.hpp> 51 #include <Teuchos_RCP.hpp> 52 #include <Teuchos_ParameterList.hpp> 55 #include <Teko_Utilities.hpp> 56 #include <Teko_InverseFactory.hpp> 57 #include <Teko_InverseLibrary.hpp> 58 #include <Teko_BlockPreconditionerFactory.hpp> 59 #include <Teko_InvLSCStrategy.hpp> 60 #include <Teko_LSCPreconditionerFactory.hpp> 76 class PreconditionerLSC:
77 public PreconditionerTeko
84 typedef Preconditioner super_Type;
86 typedef Teko::Epetra::EpetraBlockPreconditioner preconditioner_Type;
87 typedef std::shared_ptr<preconditioner_Type> preconditionerPtr_Type;
88 typedef RegionMesh<LinearTetra> mesh_Type;
89 typedef MapEpetra map_Type;
90 typedef std::shared_ptr<FESpace<mesh_Type, map_Type> > FESpacePtr_Type;
91 typedef MatrixEpetra<Real> matrix_Type;
92 typedef std::shared_ptr<matrix_Type> matrixPtr_Type;
94 typedef Teuchos::ParameterList list_Type;
103 PreconditionerLSC ( std::shared_ptr<Epetra_Comm> comm = std::shared_ptr<Epetra_Comm> (
new Epetra_MpiComm ( MPI_COMM_WORLD ) ) );
105 PreconditionerLSC ( std::shared_ptr<Epetra_Comm> comm = std::shared_ptr<Epetra_Comm> (
new Epetra_SerialComm ) );
113 virtual ~PreconditionerLSC();
127 void setDataFromGetPot (
const GetPot& dataFile,
128 const std::string& section );
134 virtual void setParameters ( Teuchos::ParameterList& list );
136 void setFESpace ( FESpacePtr_Type uFESpace,
137 FESpacePtr_Type pFESpace );
139 void createParametersList ( list_Type& list,
140 const GetPot& dataFile,
141 const std::string& section,
142 const std::string& subSection =
"LSC" );
148 std::string preconditionerType()
154 int buildPreconditioner ( matrixPtr_Type& A );
156 int numBlocksRows()
const;
157 int numBlocksCols()
const;
161 std::string M_precType;
162 int M_velocityBlockSize;
163 int M_pressureBlockSize;
164 std::shared_ptr<Epetra_Comm> M_comm;
168 inline Preconditioner* createLSC()
170 return new PreconditionerLSC();
174 static bool registerLSC = PRECFactory::instance().registerProduct (
"LSC", &createLSC );