38 #ifndef PRECONDITIONERCOMPOSITION_HPP 39 #define PRECONDITIONERCOMPOSITION_HPP 1
42 #include <boost/shared_ptr.hpp> 44 #include <Teuchos_ParameterList.hpp> 46 #include <lifev/core/LifeV.hpp> 47 #include <lifev/core/algorithm/Preconditioner.hpp> 48 #include <lifev/core/algorithm/ComposedOperator.hpp> 49 #include <lifev/core/array/MapEpetra.hpp> 50 #include <lifev/core/array/VectorBlockStructure.hpp> 92 PreconditionerComposition ( std::shared_ptr<Epetra_Comm> comm = std::shared_ptr<Epetra_Comm> (
new Epetra_SerialComm ) );
114 const std::string& section,
115 const std::string& subSection ) = 0;
136 Int Apply (
const Epetra_MultiVector& X, Epetra_MultiVector& Y )
const;
138 Int ApplyInverse (
const Epetra_MultiVector& X, Epetra_MultiVector& Y )
const;
159 const std::string& section ) = 0;
165 virtual void setParameters ( Teuchos::ParameterList& list ) = 0;
170 void setComm ( std::shared_ptr<Epetra_Comm> comm );
209 const bool useInverse =
false,
210 const bool useTranspose =
false );
213 const bool useInverse =
false,
214 const bool useTranspose =
false,
220 const bool useInverse =
false,
221 const bool useTranspose =
false );
227 const UInt& blockIndex,
229 const bool useInverse =
false,
230 const bool useTranspose =
false,
231 const bool buildPreconditioner =
true );
235 const UInt& blockIndex,
237 const bool useInverse,
238 const bool useTranspose );
std::shared_ptr< super_Type > superPtr_Type
std::shared_ptr< Epetra_Comm > M_comm
int pushBack(matrixPtr_Type A, const bool useInverse=false, const bool useTranspose=false)
Add A to the right of the composition.
bool isPreconditionerSet() const
Preconditioner is set?
std::shared_ptr< prec_Type > precPtr_Type
std::shared_ptr< operator_Type > operatorPtr_Type
Teuchos::ParameterList list_Type
MatrixEpetra< Real > matrix_Type
operator_Type * preconditioner()
Get a standard pointer to the preconditioner.
~PreconditionerComposition()
Destructor.
void importFromHDF5(std::string const &fileName, std::string const &matrixName="matrix")
Read a matrix from a HDF5 (.h5) file.
VectorBlockStructure - class representing the structure of a vector.
virtual std::string preconditionerType()
Return the type name of the preconditioner.
Int SetUseTranspose(const bool useTranspose=false)
Set the matrix to be used transposed (or not)
void resetPreconditioner()
Reset the preconditioner.
int32_type Int
Generic integer data.
Int ApplyInverse(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Apply the inverse of the preconditioner on vector1 and store the result in vector2.
int pushBack(operatorPtr_Type embeddedOperator, const VectorBlockStructure &blockStructure, const UInt &blockIndex, const MapEpetra &fullMap, const bool useInverse, const bool useTranspose)
void updateInverseJacobian(const UInt &iQuadPt)
virtual void setParameters(Teuchos::ParameterList &list)=0
Method to setup the solver using Teuchos::ParameterList.
const Epetra_Map & OperatorRangeMap() const
Return the Range map of the operator.
int pushBack(matrixPtr_Type A, superPtr_Type preconditioner, const bool useInverse=false, const bool useTranspose=false)
Use a preconditioner to build the inverse of A and add it to the right of the composition.
Real condest()
Return an estimation of the conditionement number of the preconditioner.
PreconditionerComposition(std::shared_ptr< Epetra_Comm > comm=std::shared_ptr< Epetra_Comm >(new Epetra_MpiComm(MPI_COMM_WORLD)))
Constructor.
int pushBack(operatorPtr_Type oper, const bool useInverse=false, const bool useTranspose=false, matrixPtr_Type baseMatrix=matrixPtr_Type())
Epetra_Import const & importer()
Getter for the Epetra_Import.
Preconditioner super_Type
bool UseTranspose()
Return true if the preconditioner is transposed.
ComposedOperator< operator_Type > prec_Type
Epetra_Operator operator_Type
virtual void createParametersList(list_Type &list, const GetPot &dataFile, const std::string §ion, const std::string &subSection)=0
Create the list of parameters of the preconditioner.
double Real
Generic real data.
UInt numOperators() const
Return the number of operators in the composition.
Preconditioner - Abstract preconditioner class.
virtual void setDataFromGetPot(const GetPot &dataFile, const std::string §ion)=0
Setter using GetPot.
const Epetra_Map & OperatorDomainMap() const
Return the Domain map of the operator.
void setComm(std::shared_ptr< Epetra_Comm > comm)
std::shared_ptr< matrix_Type > matrixPtr_Type
operatorPtr_Type preconditionerPtr()
get a std::shared_ptr to the preconditioner.
PreconditionerComposition(const PreconditionerComposition &precComp)
Copy constructor.
virtual int buildPreconditioner(matrixPtr_Type &A)=0
Build the preconditioner.
Int Apply(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Apply the inverse of the preconditioner on vector1 and store the result in vector2.
uint32_type UInt
generic unsigned integer (used mainly for addressing)
std::vector< matrixPtr_Type > M_precBaseOperators
int pushBack(matrixPtr_Type embeddedA, superPtr_Type preconditioner, const VectorBlockStructure &blockStructure, const UInt &blockIndex, const MapEpetra &fullMap, const bool useInverse=false, const bool useTranspose=false, const bool buildPreconditioner=true)
Use a preconditioner to build the inverse of A and add it to the right of the composition.