IFPACK Development
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Ifpack_BlockRelaxation< T > Class Template Reference

Ifpack_BlockRelaxation: a class to define block relaxation preconditioners of Epetra_RowMatrix's. More...

#include <Ifpack_BlockRelaxation.h>

Inheritance diagram for Ifpack_BlockRelaxation< T >:
Inheritance graph
[legend]
Collaboration diagram for Ifpack_BlockRelaxation< T >:
Collaboration graph
[legend]

Public Member Functions

 Ifpack_BlockRelaxation (const Epetra_RowMatrix *Matrix)
 Ifpack_BlockRelaxation constructor with given Epetra_RowMatrix.
 
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_CommComm () const
 Returns a pointer to the Epetra_Comm communicator associated with this operator.
 
virtual const Epetra_MapOperatorDomainMap () const
 Returns the Epetra_Map object associated with the domain of this operator.
 
virtual const Epetra_MapOperatorRangeMap () const
 Returns the Epetra_Map object associated with the range of this operator.
 
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_RowMatrixMatrix () const
 Returns a pointer to the matrix to be preconditioned.
 
virtual double Condest (const Ifpack_CondestType=Ifpack_Cheap, const int=1550, const double=1e-9, Epetra_RowMatrix *=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.
 
virtual int SetParameters (Teuchos::ParameterList &List)=0
 Sets all parameters for the preconditioner.
 
virtual int Initialize ()=0
 Computes all it is necessary to initialize the preconditioner.
 
virtual bool IsInitialized () const =0
 Returns true if the preconditioner has been successfully initialized, false otherwise.
 
virtual int Compute ()=0
 Computes all it is necessary to apply the preconditioner.
 
virtual bool IsComputed () const =0
 Returns true if the preconditioner has been successfully computed, false otherwise.
 
virtual double Condest (const Ifpack_CondestType CT=Ifpack_Cheap, const int MaxIters=1550, const double Tol=1e-9, Epetra_RowMatrix *Matrix=0)=0
 Computes the condition number estimate, returns its value.
 
virtual double Condest () const =0
 Returns the computed condition number estimate, or -1.0 if not computed.
 
virtual int ApplyInverse (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const =0
 Applies the preconditioner to vector X, returns the result in Y.
 
virtual const Epetra_RowMatrixMatrix () const =0
 Returns a pointer to the matrix to be preconditioned.
 
virtual int NumInitialize () const =0
 Returns the number of calls to Initialize().
 
virtual int NumCompute () const =0
 Returns the number of calls to Compute().
 
virtual int NumApplyInverse () const =0
 Returns the number of calls to ApplyInverse().
 
virtual double InitializeTime () const =0
 Returns the time spent in Initialize().
 
virtual double ComputeTime () const =0
 Returns the time spent in Compute().
 
virtual double ApplyInverseTime () const =0
 Returns the time spent in ApplyInverse().
 
virtual double InitializeFlops () const =0
 Returns the number of flops in the initialization phase.
 
virtual double ComputeFlops () const =0
 Returns the number of flops in the computation phase.
 
virtual double ApplyInverseFlops () const =0
 Returns the number of flops in the application of the preconditioner.
 
virtual std::ostream & Print (std::ostream &os) const =0
 Prints basic information on iostream. This function is used by operator<<.
 
virtual int SetUseTranspose (bool UseTranspose)=0
 
virtual int Apply (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const=0
 
virtual int ApplyInverse (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const=0
 
virtual double NormInf () const=0
 
virtual const char * Label () const=0
 
virtual bool UseTranspose () const=0
 
virtual bool HasNormInf () const=0
 
virtual const Epetra_CommComm () const=0
 
virtual const Epetra_MapOperatorDomainMap () const=0
 
virtual const Epetra_MapOperatorRangeMap () const=0
 
virtual int SetUseTranspose (bool UseTranspose)=0
 
virtual int Apply (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const=0
 
virtual int ApplyInverse (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const=0
 
virtual double NormInf () const=0
 
virtual const char * Label () const=0
 
virtual bool UseTranspose () const=0
 
virtual bool HasNormInf () const=0
 
virtual const Epetra_CommComm () const=0
 
virtual const Epetra_MapOperatorDomainMap () const=0
 
virtual const Epetra_MapOperatorRangeMap () const=0
 

Detailed Description

template<typename T>
class Ifpack_BlockRelaxation< T >

Ifpack_BlockRelaxation: a class to define block relaxation preconditioners of Epetra_RowMatrix's.

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_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);
Ifpack_AdditiveSchwarz: a class to define Additive Schwarz preconditioners of Epetra_RowMatrix's.

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.

Author
Marzio Sala, SNL 9214.
Date
Last modified on 25-Jan-05.

Definition at line 139 of file Ifpack_BlockRelaxation.h.

Constructor & Destructor Documentation

◆ Ifpack_BlockRelaxation()

template<typename T >
Ifpack_BlockRelaxation< T >::Ifpack_BlockRelaxation ( const Epetra_RowMatrix Matrix)

Ifpack_BlockRelaxation constructor with given Epetra_RowMatrix.

Creates an Ifpack_Preconditioner preconditioner.

Parameters
InMatrix - Pointer to matrix to be preconditioned.

Definition at line 454 of file Ifpack_BlockRelaxation.h.

References Epetra_Operator::Comm(), and Epetra_Comm::NumProc().

◆ ~Ifpack_BlockRelaxation()

template<typename T >
Ifpack_BlockRelaxation< T >::~Ifpack_BlockRelaxation
virtual

Definition at line 485 of file Ifpack_BlockRelaxation.h.

Member Function Documentation

◆ Apply()

template<typename T >
int Ifpack_BlockRelaxation< T >::Apply ( const Epetra_MultiVector X,
Epetra_MultiVector Y 
) const
virtual

Applies the matrix to an Epetra_MultiVector.

Parameters
InX - A Epetra_MultiVector of dimension NumVectors to multiply with matrix.
OutY -A Epetra_MultiVector of dimension NumVectors containing the result.
Returns
Integer error code, set to 0 if successful.

Implements Epetra_Operator.

Definition at line 498 of file Ifpack_BlockRelaxation.h.

References Epetra_Operator::Apply().

◆ ApplyInverse()

template<typename T >
int Ifpack_BlockRelaxation< T >::ApplyInverse ( const Epetra_MultiVector X,
Epetra_MultiVector Y 
) const
virtual

Applies the block Jacobi preconditioner to X, returns the result in Y.

Parameters
InX - A Epetra_MultiVector of dimension NumVectors to be preconditioned.
OutY -A Epetra_MultiVector of dimension NumVectors containing result.
Returns
Integer error code, set to 0 if successful.

Implements Ifpack_Preconditioner.

Definition at line 613 of file Ifpack_BlockRelaxation.h.

References Epetra_MultiVector::NumVectors(), and Epetra_MultiVector::Pointers().

◆ ApplyInverseFlops()

template<typename T >
virtual double Ifpack_BlockRelaxation< T >::ApplyInverseFlops ( ) const
inlinevirtual

Returns the number of flops in the application of the preconditioner.

Implements Ifpack_Preconditioner.

Definition at line 340 of file Ifpack_BlockRelaxation.h.

◆ ApplyInverseTime()

template<typename T >
virtual double Ifpack_BlockRelaxation< T >::ApplyInverseTime ( ) const
inlinevirtual

Returns the time spent in ApplyInverse().

Implements Ifpack_Preconditioner.

Definition at line 301 of file Ifpack_BlockRelaxation.h.

◆ Comm()

template<typename T >
const Epetra_Comm & Ifpack_BlockRelaxation< T >::Comm
virtual

Returns a pointer to the Epetra_Comm communicator associated with this operator.

Implements Epetra_Operator.

Definition at line 507 of file Ifpack_BlockRelaxation.h.

◆ Compute()

template<typename T >
int Ifpack_BlockRelaxation< T >::Compute
virtual

Computes the preconditioner.

Implements Ifpack_Preconditioner.

Definition at line 581 of file Ifpack_BlockRelaxation.h.

◆ ComputeFlops()

template<typename T >
virtual double Ifpack_BlockRelaxation< T >::ComputeFlops ( ) const
inlinevirtual

Returns the number of flops in the computation phase.

Implements Ifpack_Preconditioner.

Definition at line 325 of file Ifpack_BlockRelaxation.h.

◆ ComputeTime()

template<typename T >
virtual double Ifpack_BlockRelaxation< T >::ComputeTime ( ) const
inlinevirtual

Returns the time spent in Compute().

Implements Ifpack_Preconditioner.

Definition at line 295 of file Ifpack_BlockRelaxation.h.

◆ Condest() [1/2]

template<typename T >
virtual double Ifpack_BlockRelaxation< T >::Condest ( ) const
inlinevirtual

Returns the computed condition number estimate, or -1.0 if not computed.

Implements Ifpack_Preconditioner.

Definition at line 263 of file Ifpack_BlockRelaxation.h.

◆ Condest() [2/2]

template<typename T >
virtual double Ifpack_BlockRelaxation< T >::Condest ( const  CT = Ifpack_Cheap,
const int  MaxIters = 1550,
const double  Tol = 1e-9,
Epetra_RowMatrix Matrix = 0 
)
inlinevirtual

Computes the condition number estimate, returns its value.

Implements Ifpack_Preconditioner.

Definition at line 255 of file Ifpack_BlockRelaxation.h.

◆ HasNormInf()

template<typename T >
virtual bool Ifpack_BlockRelaxation< T >::HasNormInf ( ) const
inlinevirtual

Returns true if the this object can provide an approximate Inf-norm, false otherwise.

Implements Epetra_Operator.

Definition at line 208 of file Ifpack_BlockRelaxation.h.

◆ Initialize()

template<typename T >
int Ifpack_BlockRelaxation< T >::Initialize
virtual

Initializes the preconditioner.

Implements Ifpack_Preconditioner.

Definition at line 1238 of file Ifpack_BlockRelaxation.h.

◆ InitializeFlops()

template<typename T >
virtual double Ifpack_BlockRelaxation< T >::InitializeFlops ( ) const
inlinevirtual

Returns the number of flops in the initialization phase.

Implements Ifpack_Preconditioner.

Definition at line 307 of file Ifpack_BlockRelaxation.h.

◆ InitializeTime()

template<typename T >
virtual double Ifpack_BlockRelaxation< T >::InitializeTime ( ) const
inlinevirtual

Returns the time spent in Initialize().

Implements Ifpack_Preconditioner.

Definition at line 289 of file Ifpack_BlockRelaxation.h.

◆ IsComputed()

template<typename T >
virtual bool Ifpack_BlockRelaxation< T >::IsComputed ( ) const
inlinevirtual

Returns true if the preconditioner has been successfully computed.

Implements Ifpack_Preconditioner.

Definition at line 236 of file Ifpack_BlockRelaxation.h.

◆ IsInitialized()

template<typename T >
virtual bool Ifpack_BlockRelaxation< T >::IsInitialized ( ) const
inlinevirtual

Returns true if the preconditioner has been successfully computed.

Implements Ifpack_Preconditioner.

Definition at line 230 of file Ifpack_BlockRelaxation.h.

◆ Label()

template<typename T >
const char * Ifpack_BlockRelaxation< T >::Label
virtual

Implements Epetra_Operator.

Definition at line 491 of file Ifpack_BlockRelaxation.h.

◆ Matrix()

template<typename T >
virtual const Epetra_RowMatrix & Ifpack_BlockRelaxation< T >::Matrix ( ) const
inlinevirtual

Returns a pointer to the matrix to be preconditioned.

Implements Ifpack_Preconditioner.

Definition at line 250 of file Ifpack_BlockRelaxation.h.

◆ NormInf()

template<typename T >
virtual double Ifpack_BlockRelaxation< T >::NormInf ( ) const
inlinevirtual

Returns the infinity norm of the global matrix (not implemented)

Implements Epetra_Operator.

Definition at line 184 of file Ifpack_BlockRelaxation.h.

◆ NumApplyInverse()

template<typename T >
virtual int Ifpack_BlockRelaxation< T >::NumApplyInverse ( ) const
inlinevirtual

Returns the number of calls to ApplyInverse().

Implements Ifpack_Preconditioner.

Definition at line 283 of file Ifpack_BlockRelaxation.h.

◆ NumCompute()

template<typename T >
virtual int Ifpack_BlockRelaxation< T >::NumCompute ( ) const
inlinevirtual

Returns the number of calls to Compute().

Implements Ifpack_Preconditioner.

Definition at line 277 of file Ifpack_BlockRelaxation.h.

◆ NumInitialize()

template<typename T >
virtual int Ifpack_BlockRelaxation< T >::NumInitialize ( ) const
inlinevirtual

Returns the number of calls to Initialize().

Implements Ifpack_Preconditioner.

Definition at line 271 of file Ifpack_BlockRelaxation.h.

◆ NumLocalBlocks()

template<typename T >
int Ifpack_BlockRelaxation< T >::NumLocalBlocks ( ) const
inline

Returns the number local blocks.

Definition at line 224 of file Ifpack_BlockRelaxation.h.

◆ OperatorDomainMap()

template<typename T >
const Epetra_Map & Ifpack_BlockRelaxation< T >::OperatorDomainMap
virtual

Returns the Epetra_Map object associated with the domain of this operator.

Implements Epetra_Operator.

Definition at line 515 of file Ifpack_BlockRelaxation.h.

◆ OperatorRangeMap()

template<typename T >
const Epetra_Map & Ifpack_BlockRelaxation< T >::OperatorRangeMap
virtual

Returns the Epetra_Map object associated with the range of this operator.

Implements Epetra_Operator.

Definition at line 523 of file Ifpack_BlockRelaxation.h.

◆ Print()

template<typename T >
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.

Definition at line 1108 of file Ifpack_BlockRelaxation.h.

◆ SetParameters()

template<typename T >
int Ifpack_BlockRelaxation< T >::SetParameters ( Teuchos::ParameterList &  List)
virtual

Sets all the parameters for the preconditioner.

Implements Ifpack_Preconditioner.

Definition at line 1166 of file Ifpack_BlockRelaxation.h.

References Epetra_RowMatrix::NumMyRows().

◆ SetUseTranspose()

template<typename T >
virtual int Ifpack_BlockRelaxation< T >::SetUseTranspose ( bool  UseTranspose_in)
inlinevirtual

Implements Epetra_Operator.

Definition at line 192 of file Ifpack_BlockRelaxation.h.

◆ UseTranspose()

template<typename T >
virtual bool Ifpack_BlockRelaxation< T >::UseTranspose ( ) const
inlinevirtual

Returns the current UseTranspose setting.

Implements Epetra_Operator.

Definition at line 202 of file Ifpack_BlockRelaxation.h.


The documentation for this class was generated from the following file: