#include <Ifpack_BlockRelaxation.h>
Public Member Functions | |
int | NumLocalBlocks () const |
Returns the number local blocks. | |
virtual bool | IsInitialized () const |
Returns true if the preconditioner has been successfully computed. | |
virtual bool | IsComputed () const |
Returns true if the preconditioner has been successfully computed. | |
virtual int | SetParameters (Teuchos::ParameterList &List) |
Sets all the parameters for the preconditioner. | |
virtual int | Initialize () |
Initializes the preconditioner. | |
virtual int | Compute () |
Computes the preconditioner. | |
virtual const Epetra_RowMatrix & | Matrix () const |
Returns a pointer to the matrix to be preconditioned. | |
virtual double | Condest (const Ifpack_CondestType CT=Ifpack_Cheap, const int MaxIters=1550, const double Tol=1e-9, Epetra_RowMatrix *Matrix_in=0) |
Computes the condition number estimate, returns its value. | |
virtual double | Condest () const |
Returns the computed condition number estimate, or -1.0 if not computed. | |
std::ostream & | Print (std::ostream &os) const |
Prints basic information on iostream. This function is used by operator<<. | |
virtual int | NumInitialize () const |
Returns the number of calls to Initialize(). | |
virtual int | NumCompute () const |
Returns the number of calls to Compute(). | |
virtual int | NumApplyInverse () const |
Returns the number of calls to ApplyInverse(). | |
virtual double | InitializeTime () const |
Returns the time spent in Initialize(). | |
virtual double | ComputeTime () const |
Returns the time spent in Compute(). | |
virtual double | ApplyInverseTime () const |
Returns the time spent in ApplyInverse(). | |
virtual double | InitializeFlops () const |
Returns the number of flops in the initialization phase. | |
virtual double | ComputeFlops () const |
Returns the number of flops in the computation phase. | |
virtual double | ApplyInverseFlops () const |
Returns the number of flops in the application of the preconditioner. | |
Ifpack_BlockRelaxation (const Epetra_RowMatrix *Matrix) | |
Ifpack_BlockRelaxation constructor with given Epetra_RowMatrix. | |
virtual | ~Ifpack_BlockRelaxation () |
virtual int | Apply (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const |
Applies the matrix to an Epetra_MultiVector. | |
virtual int | ApplyInverse (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const |
Applies the block Jacobi preconditioner to X, returns the result in Y. | |
virtual double | NormInf () const |
Returns the infinity norm of the global matrix (not implemented). | |
virtual int | SetUseTranspose (bool UseTranspose_in) |
virtual const char * | Label () const |
virtual bool | UseTranspose () const |
Returns the current UseTranspose setting. | |
virtual bool | HasNormInf () const |
Returns true if the this object can provide an approximate Inf-norm, false otherwise. | |
virtual const Epetra_Comm & | Comm () const |
Returns a pointer to the Epetra_Comm communicator associated with this operator. | |
virtual const Epetra_Map & | OperatorDomainMap () const |
Returns the Epetra_Map object associated with the domain of this operator. | |
virtual const Epetra_Map & | OperatorRangeMap () const |
Returns the Epetra_Map object associated with the range of this operator. |
The Ifpack_BlockRelaxation class enables the construction of block relaxation preconditioners of an Epetra_RowMatrix. Ifpack_PointRelaxation is derived from the Ifpack_Preconditioner class, which is derived from Epetra_Operator. Therefore this object can be used as preconditioner everywhere an ApplyInverse() method is required in the preconditioning step.
The class currently support:
The idea of block relaxation method is to extend their point relaxation counterpart (implemented in Ifpack_PointRelaxation), by working on a group of equation simulteneously. Generally, larger blocks result in better convergence and increased robusteness.
The user can decide:
The following is an example of usage of this preconditioner with dense containers. First, we include the header files:
#include "Ifpack_AdditiveSchwarz.h" #include "Ifpack_BlockPreconditioner.h" #include "Ifpack_DenseContainer.h"
Then, we declare the preconditioner. Note that this is done through the class Ifpack_AdditiveSchwarz (see note below in this section).
// A is an Epetra_RowMatrix // List is a Teuchos::ParameterList Ifpack_AdditiveSchwarz<Ifpack_BlockRelaxation<Ifpack_DenseContainer> > > Prec(A); IFPACK_CHK_ERR(Prec.SetParameters(List)); IFPACK_CHK_ERR(Prec.Initialize()); IFPACK_CHK_ERR(Prec.Compute()); // action of the preconditioner is given by ApplyInverse() // Now use it in AztecOO, solver is an AztecOO object solver.SetPrecOperator(&Prec);
The complete list of supported parameters is reported in page List of Supported Parameters. For a presentation of basic relaxation schemes, please refer to page Ifpack_PointRelaxation.
Ifpack_BlockRelaxation< T >::Ifpack_BlockRelaxation | ( | const Epetra_RowMatrix * | Matrix | ) | [inline] |
Ifpack_BlockRelaxation constructor with given Epetra_RowMatrix.
Creates an Ifpack_Preconditioner preconditioner.
In | Matrix - Pointer to matrix to be preconditioned. |
Ifpack_BlockRelaxation< T >::~Ifpack_BlockRelaxation | ( | ) | [inline, virtual] |
int Ifpack_BlockRelaxation< T >::Apply | ( | const Epetra_MultiVector & | X, | |
Epetra_MultiVector & | Y | |||
) | const [inline, virtual] |
Applies the matrix to an Epetra_MultiVector.
In | X - A Epetra_MultiVector of dimension NumVectors to multiply with matrix. | |
Out | Y -A Epetra_MultiVector of dimension NumVectors containing the result. |
int Ifpack_BlockRelaxation< T >::ApplyInverse | ( | const Epetra_MultiVector & | X, | |
Epetra_MultiVector & | Y | |||
) | const [inline, virtual] |
Applies the block Jacobi preconditioner to X, returns the result in Y.
In | X - A Epetra_MultiVector of dimension NumVectors to be preconditioned. | |
Out | Y -A Epetra_MultiVector of dimension NumVectors containing result. |
Implements Ifpack_Preconditioner.
virtual double Ifpack_BlockRelaxation< T >::ApplyInverseFlops | ( | ) | const [inline, virtual] |
Returns the number of flops in the application of the preconditioner.
Implements Ifpack_Preconditioner.
virtual double Ifpack_BlockRelaxation< T >::ApplyInverseTime | ( | ) | const [inline, virtual] |
const Epetra_Comm & Ifpack_BlockRelaxation< T >::Comm | ( | ) | const [inline, virtual] |
Returns a pointer to the Epetra_Comm communicator associated with this operator.
int Ifpack_BlockRelaxation< T >::Compute | ( | ) | [inline, virtual] |
virtual double Ifpack_BlockRelaxation< T >::ComputeFlops | ( | ) | const [inline, virtual] |
virtual double Ifpack_BlockRelaxation< T >::ComputeTime | ( | ) | const [inline, virtual] |
virtual double Ifpack_BlockRelaxation< T >::Condest | ( | ) | const [inline, virtual] |
Returns the computed condition number estimate, or -1.0 if not computed.
Implements Ifpack_Preconditioner.
virtual double Ifpack_BlockRelaxation< T >::Condest | ( | const Ifpack_CondestType | CT = Ifpack_Cheap , |
|
const int | MaxIters = 1550 , |
|||
const double | Tol = 1e-9 , |
|||
Epetra_RowMatrix * | Matrix = 0 | |||
) | [inline, virtual] |
virtual bool Ifpack_BlockRelaxation< T >::HasNormInf | ( | ) | const [inline, virtual] |
Returns true if the this object can provide an approximate Inf-norm, false otherwise.
int Ifpack_BlockRelaxation< T >::Initialize | ( | ) | [inline, virtual] |
virtual double Ifpack_BlockRelaxation< T >::InitializeFlops | ( | ) | const [inline, virtual] |
virtual double Ifpack_BlockRelaxation< T >::InitializeTime | ( | ) | const [inline, virtual] |
virtual bool Ifpack_BlockRelaxation< T >::IsComputed | ( | ) | const [inline, virtual] |
Returns true
if the preconditioner has been successfully computed.
Implements Ifpack_Preconditioner.
virtual bool Ifpack_BlockRelaxation< T >::IsInitialized | ( | ) | const [inline, virtual] |
Returns true
if the preconditioner has been successfully computed.
Implements Ifpack_Preconditioner.
const char * Ifpack_BlockRelaxation< T >::Label | ( | ) | const [inline, virtual] |
virtual const Epetra_RowMatrix& Ifpack_BlockRelaxation< T >::Matrix | ( | ) | const [inline, virtual] |
virtual double Ifpack_BlockRelaxation< T >::NormInf | ( | ) | const [inline, virtual] |
Returns the infinity norm of the global matrix (not implemented).
virtual int Ifpack_BlockRelaxation< T >::NumApplyInverse | ( | ) | const [inline, virtual] |
virtual int Ifpack_BlockRelaxation< T >::NumCompute | ( | ) | const [inline, virtual] |
virtual int Ifpack_BlockRelaxation< T >::NumInitialize | ( | ) | const [inline, virtual] |
int Ifpack_BlockRelaxation< T >::NumLocalBlocks | ( | ) | const [inline] |
Returns the number local blocks.
const Epetra_Map & Ifpack_BlockRelaxation< T >::OperatorDomainMap | ( | ) | const [inline, virtual] |
Returns the Epetra_Map object associated with the domain of this operator.
const Epetra_Map & Ifpack_BlockRelaxation< T >::OperatorRangeMap | ( | ) | const [inline, virtual] |
Returns the Epetra_Map object associated with the range of this operator.
std::ostream& Ifpack_BlockRelaxation< T >::Print | ( | std::ostream & | os | ) | const [virtual] |
Prints basic information on iostream. This function is used by operator<<.
Implements Ifpack_Preconditioner.
int Ifpack_BlockRelaxation< T >::SetParameters | ( | Teuchos::ParameterList & | List | ) | [inline, virtual] |
virtual int Ifpack_BlockRelaxation< T >::SetUseTranspose | ( | bool | UseTranspose_in | ) | [inline, virtual] |
virtual bool Ifpack_BlockRelaxation< T >::UseTranspose | ( | ) | const [inline, virtual] |
Returns the current UseTranspose setting.