LifeV
|
PreconditionerComposition - Class to manage preconditioners composed by matrices multiplication. More...
#include <PreconditionerComposition.hpp>
Protected Attributes | |
std::shared_ptr< Epetra_Comm > | M_comm |
Protected Attributes inherited from Preconditioner | |
std::string | M_precType |
Displayer | M_displayer |
list_Type | M_list |
bool | M_preconditionerCreated |
Private Attributes | |
precPtr_Type | M_prec |
std::vector< matrixPtr_Type > | M_precBaseOperators |
Public Types | |
typedef Preconditioner | super_Type |
typedef std::shared_ptr< super_Type > | superPtr_Type |
typedef Epetra_Operator | operator_Type |
typedef std::shared_ptr< operator_Type > | operatorPtr_Type |
typedef ComposedOperator< operator_Type > | prec_Type |
typedef std::shared_ptr< prec_Type > | precPtr_Type |
typedef MatrixEpetra< Real > | matrix_Type |
typedef std::shared_ptr< matrix_Type > | matrixPtr_Type |
typedef Teuchos::ParameterList | list_Type |
Constructor & Destructor | |
PreconditionerComposition (std::shared_ptr< Epetra_Comm > comm=std::shared_ptr< Epetra_Comm >(new Epetra_MpiComm(MPI_COMM_WORLD))) | |
Constructor. More... | |
~PreconditionerComposition () | |
Destructor. More... | |
PreconditionerComposition (const PreconditionerComposition &precComp) | |
Copy constructor. More... | |
Methods | |
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. More... | |
virtual int | buildPreconditioner (matrixPtr_Type &A)=0 |
Build the preconditioner. More... | |
void | resetPreconditioner () |
Reset the preconditioner. More... | |
Real | condest () |
Return an estimation of the conditionement number of the preconditioner. More... | |
Epetra Operator Interface Methods | |
Int | SetUseTranspose (const bool useTranspose=false) |
Set the matrix to be used transposed (or not) More... | |
Int | Apply (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const |
Apply the inverse of the preconditioner on vector1 and store the result in vector2. More... | |
Int | ApplyInverse (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const |
Apply the inverse of the preconditioner on vector1 and store the result in vector2. More... | |
bool | UseTranspose () |
Return true if the preconditioner is transposed. More... | |
const Epetra_Map & | OperatorRangeMap () const |
Return the Range map of the operator. More... | |
const Epetra_Map & | OperatorDomainMap () const |
Return the Domain map of the operator. More... | |
Set Methods | |
virtual void | setDataFromGetPot (const GetPot &dataFile, const std::string §ion)=0 |
Setter using GetPot. More... | |
virtual void | setParameters (Teuchos::ParameterList &list)=0 |
Method to setup the solver using Teuchos::ParameterList. More... | |
void | setComm (std::shared_ptr< Epetra_Comm > comm) |
Get Methods | |
bool | isPreconditionerSet () const |
Preconditioner is set? More... | |
operator_Type * | preconditioner () |
Get a standard pointer to the preconditioner. More... | |
operatorPtr_Type | preconditionerPtr () |
get a std::shared_ptr to the preconditioner. More... | |
virtual std::string | preconditionerType () |
Return the type name of the preconditioner. More... | |
UInt | numOperators () const |
Return the number of operators in the composition. More... | |
Private Methods | |
int | pushBack (matrixPtr_Type A, const bool useInverse=false, const bool useTranspose=false) |
Add A to the right of the composition. More... | |
int | pushBack (operatorPtr_Type oper, const bool useInverse=false, const bool useTranspose=false, matrixPtr_Type baseMatrix=matrixPtr_Type()) |
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. More... | |
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. More... | |
int | pushBack (operatorPtr_Type embeddedOperator, const VectorBlockStructure &blockStructure, const UInt &blockIndex, const MapEpetra &fullMap, const bool useInverse, const bool useTranspose) |
Additional Inherited Members | |
Public Types inherited from Preconditioner | |
typedef Epetra_Operator | prec_raw_type |
typedef std::shared_ptr< prec_raw_type > | prec_type |
typedef MatrixEpetra< Real > | operator_raw_type |
typedef std::shared_ptr< operator_raw_type > | operator_type |
typedef Displayer::comm_Type | comm_Type |
typedef Displayer::commPtr_Type | commPtr_Type |
typedef Teuchos::ParameterList | list_Type |
Public Member Functions inherited from Preconditioner | |
Preconditioner (const commPtr_Type &comm=commPtr_Type()) | |
Constructor. More... | |
Preconditioner (const Preconditioner &preconditioner, const commPtr_Type &comm=commPtr_Type()) | |
Copy constructor. More... | |
virtual | ~Preconditioner () |
Destructor. More... | |
virtual Int | buildPreconditioner (operator_type &matrix)=0 |
Build a preconditioner based on the given matrix. More... | |
virtual void | showMe (std::ostream &output=std::cout) const |
Show informations about the preconditioner. More... | |
void | setParametersList (const list_Type &list) |
The the internal list. More... | |
virtual void | setSolver (SolverAztecOO &) |
Set the internal solver. More... | |
const bool & | preconditionerCreated () |
Return true if the preconditioner has been created. More... | |
const list_Type & | parametersList () const |
Return the parameters list. More... | |
list_Type & | parametersList () |
Return the parameters list. More... | |
PreconditionerComposition - Class to manage preconditioners composed by matrices multiplication.
This class makes use of ComposedOperator to handle matrices composition.
Definition at line 61 of file PreconditionerComposition.hpp.
typedef Preconditioner super_Type |
Definition at line 68 of file PreconditionerComposition.hpp.
typedef std::shared_ptr<super_Type> superPtr_Type |
Definition at line 69 of file PreconditionerComposition.hpp.
typedef Epetra_Operator operator_Type |
Definition at line 70 of file PreconditionerComposition.hpp.
typedef std::shared_ptr<operator_Type> operatorPtr_Type |
Definition at line 71 of file PreconditionerComposition.hpp.
typedef ComposedOperator<operator_Type> prec_Type |
Definition at line 72 of file PreconditionerComposition.hpp.
typedef std::shared_ptr<prec_Type> precPtr_Type |
Definition at line 73 of file PreconditionerComposition.hpp.
typedef MatrixEpetra<Real> matrix_Type |
Definition at line 75 of file PreconditionerComposition.hpp.
typedef std::shared_ptr<matrix_Type> matrixPtr_Type |
Definition at line 76 of file PreconditionerComposition.hpp.
typedef Teuchos::ParameterList list_Type |
Definition at line 78 of file PreconditionerComposition.hpp.
PreconditionerComposition | ( | std::shared_ptr< Epetra_Comm > | comm = std::shared_ptr<Epetra_Comm> ( new Epetra_MpiComm ( MPI_COMM_WORLD ) ) | ) |
Constructor.
comm | Communicator (std::shared_ptr<Epetra_Comm>() by default) |
Definition at line 57 of file PreconditionerComposition.cpp.
|
private |
Copy constructor.
precComp | PreconditionerComposition |
Definition at line 65 of file PreconditionerComposition.cpp.
Destructor.
Definition at line 73 of file PreconditionerComposition.cpp.
|
pure virtual |
Create the list of parameters of the preconditioner.
list | A Parameter list to be filled |
dataFile | A GetPot object containing the data about the preconditioner |
section | The section in "dataFile" where to find data about the preconditioner |
subSection | The subsection in "dataFile" where to find data about the preconditioner |
Implements Preconditioner.
Implemented in PreconditionerPCD, PreconditionerSIMPLE, and PreconditionerYosida.
|
pure virtual |
Build the preconditioner.
A | the base matrix for computing the preconditioner |
Implemented in PreconditionerPCD, PreconditionerSIMPLE, and PreconditionerYosida.
|
virtual |
Reset the preconditioner.
Implements Preconditioner.
Definition at line 84 of file PreconditionerComposition.cpp.
|
virtual |
Return an estimation of the conditionement number of the preconditioner.
Implements Preconditioner.
Reimplemented in PreconditionerPCD, PreconditionerSIMPLE, and PreconditionerYosida.
Definition at line 92 of file PreconditionerComposition.cpp.
|
virtual |
Set the matrix to be used transposed (or not)
useTranspose | If true the preconditioner is transposed |
Reimplemented from Preconditioner.
Definition at line 103 of file PreconditionerComposition.cpp.
|
virtual |
Apply the inverse of the preconditioner on vector1 and store the result in vector2.
vector1 | Vector to which we apply the preconditioner |
vector2 | Vector to the store the result |
Reimplemented from Preconditioner.
Definition at line 109 of file PreconditionerComposition.cpp.
|
virtual |
Apply the inverse of the preconditioner on vector1 and store the result in vector2.
vector1 | Vector to which we apply the preconditioner |
vector2 | Vector to the store the result |
Reimplemented from Preconditioner.
Definition at line 115 of file PreconditionerComposition.cpp.
|
virtual |
Return true if the preconditioner is transposed.
Reimplemented from Preconditioner.
Definition at line 121 of file PreconditionerComposition.cpp.
|
virtual |
Return the Range map of the operator.
Reimplemented from Preconditioner.
Definition at line 127 of file PreconditionerComposition.cpp.
|
virtual |
Return the Domain map of the operator.
Reimplemented from Preconditioner.
Definition at line 133 of file PreconditionerComposition.cpp.
|
pure virtual |
Setter using GetPot.
This method use GetPot to load data from a file and then set the preconditioner.
dataFile | is a GetPot dataFile |
section | is the section containing the data |
Implements Preconditioner.
Implemented in PreconditionerPCD, PreconditionerSIMPLE, and PreconditionerYosida.
|
pure virtual |
Method to setup the solver using Teuchos::ParameterList.
list | Teuchos::ParameterList object |
Implemented in PreconditionerPCD, PreconditionerSIMPLE, and PreconditionerYosida.
void setComm | ( | std::shared_ptr< Epetra_Comm > | comm | ) |
copies the shared_ptr to the communicator in the member M_comm and builds a new instance
Definition at line 142 of file PreconditionerComposition.cpp.
bool isPreconditionerSet | ( | ) | const |
|
virtual |
Get a standard pointer to the preconditioner.
In most of the cases is more safe to use getPrecPtr(), which returns a std::shared_ptr
Implements Preconditioner.
Definition at line 158 of file PreconditionerComposition.cpp.
|
virtual |
get a std::shared_ptr to the preconditioner.
The only requirement on the preconditioner is that it must derive from the Epetra_Operator object
Implements Preconditioner.
Definition at line 164 of file PreconditionerComposition.cpp.
|
virtual |
Return the type name of the preconditioner.
Implements Preconditioner.
Definition at line 170 of file PreconditionerComposition.cpp.
UInt numOperators | ( | ) | const |
Return the number of operators in the composition.
Definition at line 176 of file PreconditionerComposition.cpp.
|
protected |
Add A to the right of the composition.
Definition at line 185 of file PreconditionerComposition.cpp.
|
protected |
Definition at line 196 of file PreconditionerComposition.cpp.
|
protected |
Use a preconditioner to build the inverse of A and add it to the right of the composition.
Definition at line 211 of file PreconditionerComposition.cpp.
|
protected |
Use a preconditioner to build the inverse of A and add it to the right of the composition.
Definition at line 226 of file PreconditionerComposition.cpp.
|
protected |
Definition at line 260 of file PreconditionerComposition.cpp.
|
protected |
Definition at line 242 of file PreconditionerComposition.hpp.
|
private |
Definition at line 245 of file PreconditionerComposition.hpp.
|
private |
Definition at line 246 of file PreconditionerComposition.hpp.