37 #ifndef PRECONDITIONERTEKO_HPP 38 #define PRECONDITIONERTEKO_HPP 1
40 #include <lifev/core/LifeV.hpp> 42 #ifdef LIFEV_HAVE_TEKO 45 #include <lifev/core/array/MapEpetra.hpp> 46 #include <lifev/core/algorithm/Preconditioner.hpp> 47 #include <lifev/core/algorithm/PreconditionerBlock.hpp> 50 #include "Teuchos_RCP.hpp" 53 #include "Teko_Utilities.hpp" 54 #include "Teko_InverseFactory.hpp" 55 #include "Teko_InverseLibrary.hpp" 56 #include "Teko_BlockedEpetraOperator.hpp" 57 #include "Teko_EpetraBlockPreconditioner.hpp" 58 #include "Teko_BlockPreconditionerFactory.hpp" 59 #include "Teuchos_RCPBoostSharedPtrConversions.hpp" 75 class PreconditionerTeko:
76 public PreconditionerBlock
83 typedef Preconditioner super_Type;
85 typedef Epetra_Operator operator_Type;
86 typedef std::shared_ptr<Epetra_Operator> operatorPtr_Type;
88 typedef Teko::Epetra::EpetraBlockPreconditioner preconditioner_Type;
89 typedef std::shared_ptr<preconditioner_Type> preconditionerPtr_Type;
91 typedef MatrixEpetra<Real> matrix_Type;
92 typedef std::shared_ptr<matrix_Type> matrixPtr_Type;
100 PreconditionerTeko (
const std::shared_ptr<Epetra_Comm>& comm = std::shared_ptr<Epetra_Comm>() );
103 PreconditionerTeko ( PreconditionerTeko& P,
const std::shared_ptr<Epetra_Comm>& comm = std::shared_ptr<Epetra_Comm>() );
106 virtual ~PreconditionerTeko();
115 operator_Type* preconditioner();
118 operatorPtr_Type preconditionerPtr();
121 void resetPreconditioner();
124 bool isPreconditionerSet()
const;
126 virtual int SetUseTranspose (
const bool useTranspose =
false );
127 virtual bool UseTranspose();
128 virtual int ApplyInverse (
const Epetra_MultiVector& X, Epetra_MultiVector& Y )
const;
129 virtual int Apply (
const Epetra_MultiVector& X, Epetra_MultiVector& Y )
const;
130 virtual const Epetra_Map& OperatorRangeMap()
const;
131 virtual const Epetra_Map& OperatorDomainMap()
const;
135 void buildBlockGIDs ( std::vector<std::vector<
int> >& gids,
136 const MapEpetra& map,
137 const std::vector<
int>& blockSizes);
138 void buildPreconditionerTeko ( RCP<Teko::BlockPreconditionerFactory> precFact,
139 matrixPtr_Type& oper,
140 const std::vector<
int>& blockSizes );
142 preconditionerPtr_Type M_prec;
145 matrix_Type::matrix_ptrtype M_oper;