41 #ifndef PreconditionerComposed_HPP 42 #define PreconditionerComposed_HPP 44 #include <lifev/core/filter/GetPot.hpp> 45 #include <lifev/core/array/MatrixEpetra.hpp> 46 #include <lifev/core/algorithm/Preconditioner.hpp> 47 #include <lifev/core/algorithm/ComposedOperator.hpp> 65 class PreconditionerComposed:
74 typedef Preconditioner super_Type;
75 typedef ComposedOperator<Preconditioner> prec_Type;
76 typedef std::shared_ptr<prec_Type> precPtr_Type;
77 typedef std::shared_ptr<Preconditioner> epetraPrecPtr_Type;
78 typedef super_Type::operator_raw_type operator_Type;
79 typedef std::shared_ptr<operator_Type> operatorPtr_Type;
80 typedef super_Type::list_Type list_Type;
88 PreconditionerComposed ( std::shared_ptr<Epetra_Comm> comm = std::shared_ptr<Epetra_Comm>() );
95 PreconditionerComposed ( PreconditionerComposed& P );
104 virtual ~PreconditionerComposed();
112 void setDataFromGetPot (
const GetPot& dataFile,
113 const std::string& section);
115 void createParametersList ( list_Type& ,
const GetPot& dataFile,
const std::string& section,
const std::string& subSection );
121 int buildPreconditioner (operatorPtr_Type& A);
124 int buildPreconditioner (operatorPtr_Type& A,
125 const bool useInverse,
126 const bool useTranspose =
false);
128 int push_back (operatorPtr_Type& A,
129 const bool useInverse =
false,
130 const bool useTranspose =
false 134 int replace (operatorPtr_Type& A,
136 const bool useInverse =
false,
137 const bool useTranspose =
false);
140 void resetPreconditioner();
143 const std::vector<operatorPtr_Type>& operVector()
const 152 const Epetra_Comm& Comm()
154 return preconditioner()->Comm();
158 int SetUseTranspose (
bool useTranspose =
false )
160 return M_prec->SetUseTranspose (useTranspose);
165 return M_prec->UseTranspose();
173 virtual int ApplyInverse (
const Epetra_MultiVector& X, Epetra_MultiVector& Y)
const 175 return M_prec->ApplyInverse (X, Y);
183 virtual int Apply (
const Epetra_MultiVector& X, Epetra_MultiVector& Y)
const 185 return M_prec->Apply (X, Y);
189 const Epetra_Map& OperatorRangeMap()
const 191 return M_prec->OperatorRangeMap();
195 const Epetra_Map& OperatorDomainMap()
const 197 return M_prec->OperatorDomainMap();
204 super_Type::prec_raw_type* preconditioner ();
209 return M_prec->number();
213 super_Type::prec_type preconditionerPtr()
219 const precPtr_Type composedPreconditionerPtr()
225 std::string preconditionerType()
227 return "PreconditionerComposed";
235 static Preconditioner* createComposedPreconditioner()
237 return new PreconditionerComposed();
245 void myCreateParametersList (
const GetPot& dataFile,
const std::string& section,
const std::string& subSection);
247 Int createPrec (operatorPtr_Type& oper,
248 std::shared_ptr<Preconditioner>& prec);
254 std::vector<operatorPtr_Type> M_operVector;
256 static bool registerComposed;
void assignFunction(bcBase_Type &base)
Assign the function to the base of the BCHandler.
int32_type Int
Generic integer data.
uint32_type UInt
generic unsigned integer (used mainly for addressing)