IFPACK Development
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
Ifpack_Chebyshev Class Reference

Ifpack_Chebyshev: class for preconditioning with Chebyshev polynomials in Ifpack. More...

#include <Ifpack_Chebyshev.h>

Inheritance diagram for Ifpack_Chebyshev:
Inheritance graph
[legend]
Collaboration diagram for Ifpack_Chebyshev:
Collaboration graph
[legend]

Public Member Functions

 Ifpack_Chebyshev (const Epetra_Operator *Matrix)
 Ifpack_Chebyshev constructor with given Epetra_Operator/Epetra_RowMatrix.
 
 Ifpack_Chebyshev (const Epetra_RowMatrix *Matrix)
 Ifpack_Chebyshev constructor with given Epetra_Operator/Epetra_RowMatrix.
 
virtual ~Ifpack_Chebyshev ()
 Destructor.
 
virtual int SetUseTranspose (bool UseTranspose_in)
 
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 preconditioner to X, returns the result in Y.
 
virtual double NormInf () const
 Returns the infinity norm of the global matrix (not implemented)
 
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.
 
virtual int Initialize ()
 Computes all it is necessary to initialize the preconditioner.
 
virtual bool IsInitialized () const
 Returns true if the preconditioner has been successfully initialized, false otherwise.
 
virtual bool IsComputed () const
 Returns true if the preconditioner has been successfully computed.
 
virtual int Compute ()
 Computes the preconditioners.
 
virtual double GetLambdaMax ()
 Returns an approximation to the largest eigenvalue.
 
virtual double GetLambdaMin ()
 Contains an approximation to the smallest eigenvalue.
 
virtual const Epetra_RowMatrixMatrix () 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 estimates and returns the value.
 
virtual double Condest () const
 Returns the condition number estimate, or -1.0 if not computed.
 
virtual int SetParameters (Teuchos::ParameterList &List)
 Sets all the parameters for the preconditioner.
 
virtual std::ostream & Print (std::ostream &os) const
 Prints object to an output stream.
 
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 for the application of the preconditioner.
 

Static Public Member Functions

static int PowerMethod (const Epetra_Operator &Operator, const Epetra_Vector &InvPointDiagonal, const int MaximumIterations, double &LambdaMax, const unsigned int *RngSeed=0)
 Simple power method to compute lambda_max.
 
static int CG (const Epetra_Operator &Operator, const Epetra_Vector &InvPointDiagonal, const int MaximumIterations, double &lambda_min, double &lambda_max, const unsigned int *RngSeed=0)
 Uses AztecOO's CG to estimate lambda_min and lambda_max.
 

Detailed Description

Ifpack_Chebyshev: class for preconditioning with Chebyshev polynomials in Ifpack.

The Ifpack_Chebyshev class enables the construction of preconditioners based on Chebyshev polynomials for an Epetra_RowMatrix. Ifpack_Chebyshev is derived from the Ifpack_Preconditioner class, which is itself derived from Epetra_Operator. Therefore this object can be used as preconditioner everywhere an ApplyInverse() method is required in the preconditioning step.

The class is an adaptation of the routine ML_Cheby in Smoother/ml_smoother.h

(04/04/06) Flops are not counted in the routine ApplyInverse()

(04/04/06) The switch to use the transpose matrix is not used in ApplyInverse()

The list of parameters is

Author
Ulrich Hetmaniuk. SNL 1414.
Date
Last modified on 04-Apr-06.

Definition at line 104 of file Ifpack_Chebyshev.h.

Constructor & Destructor Documentation

◆ Ifpack_Chebyshev() [1/2]

Ifpack_Chebyshev::Ifpack_Chebyshev ( const Epetra_Operator * Matrix)

Ifpack_Chebyshev constructor with given Epetra_Operator/Epetra_RowMatrix.

Creates an instance of Ifpack_Chebyshev class.

Parameters
Matrix- (In) Pointer to the operator to precondition.

Definition at line 82 of file Ifpack_Chebyshev.cpp.

◆ Ifpack_Chebyshev() [2/2]

Ifpack_Chebyshev::Ifpack_Chebyshev ( const Epetra_RowMatrix * Matrix)

Ifpack_Chebyshev constructor with given Epetra_Operator/Epetra_RowMatrix.

Creates an instance of Ifpack_Chebyshev class.

Parameters
Matrix- (In) Pointer to the matrix to precondition.

Definition at line 124 of file Ifpack_Chebyshev.cpp.

◆ ~Ifpack_Chebyshev()

virtual Ifpack_Chebyshev::~Ifpack_Chebyshev ( )
inlinevirtual

Destructor.

Definition at line 126 of file Ifpack_Chebyshev.h.

Member Function Documentation

◆ Apply()

int Ifpack_Chebyshev::Apply ( const Epetra_MultiVector & X,
Epetra_MultiVector & Y ) const
virtual

Applies the matrix to an Epetra_MultiVector.

Parameters
X- (In) A Epetra_MultiVector of dimension NumVectors to multiply with matrix.
Y- (Out) A Epetra_MultiVector of dimension NumVectors containing the result.
Returns
Integer error code, set to 0 if successful.

Implements Epetra_Operator.

Definition at line 227 of file Ifpack_Chebyshev.cpp.

References IsComputed(), Epetra_MultiVector::NumVectors(), and UseTranspose().

◆ ApplyInverse()

int Ifpack_Chebyshev::ApplyInverse ( const Epetra_MultiVector & X,
Epetra_MultiVector & Y ) const
virtual

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

Parameters
X- (In) A Epetra_MultiVector of dimension NumVectors to be preconditioned.
Y- (InOut) A Epetra_MultiVector of dimension NumVectors containing result.
Returns
Integer error code, set to 0 if successful.
Warning
This routine is NOT AztecOO complaint.

Implements Ifpack_Preconditioner.

Definition at line 466 of file Ifpack_Chebyshev.cpp.

References Epetra_MultiVector::ExtractView(), IsComputed(), Epetra_DistObject::Map(), Epetra_MultiVector::MyLength(), Epetra_MultiVector::NumVectors(), Epetra_MultiVector::Pointers(), Epetra_MultiVector::Scale(), Epetra_MultiVector::Update(), and Epetra_MultiVector::Values().

◆ ApplyInverseFlops()

virtual double Ifpack_Chebyshev::ApplyInverseFlops ( ) const
inlinevirtual

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

Implements Ifpack_Preconditioner.

Definition at line 307 of file Ifpack_Chebyshev.h.

◆ ApplyInverseTime()

virtual double Ifpack_Chebyshev::ApplyInverseTime ( ) const
inlinevirtual

Returns the time spent in ApplyInverse().

Implements Ifpack_Preconditioner.

Definition at line 289 of file Ifpack_Chebyshev.h.

◆ CG()

int Ifpack_Chebyshev::CG ( const Epetra_Operator & Operator,
const Epetra_Vector & InvPointDiagonal,
const int MaximumIterations,
double & lambda_min,
double & lambda_max,
const unsigned int * RngSeed = 0 )
static

◆ Comm()

const Epetra_Comm & Ifpack_Chebyshev::Comm ( ) const
virtual

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

Implements Epetra_Operator.

Definition at line 209 of file Ifpack_Chebyshev.cpp.

Referenced by Initialize(), and Print().

◆ Compute()

int Ifpack_Chebyshev::Compute ( )
virtual

Computes the preconditioners.

Implements Ifpack_Preconditioner.

Definition at line 283 of file Ifpack_Chebyshev.cpp.

References Initialize(), IsInitialized(), Matrix(), and PowerMethod().

◆ ComputeFlops()

virtual double Ifpack_Chebyshev::ComputeFlops ( ) const
inlinevirtual

Returns the number of flops in the computation phase.

Implements Ifpack_Preconditioner.

Definition at line 301 of file Ifpack_Chebyshev.h.

◆ ComputeTime()

virtual double Ifpack_Chebyshev::ComputeTime ( ) const
inlinevirtual

Returns the time spent in Compute().

Implements Ifpack_Preconditioner.

Definition at line 283 of file Ifpack_Chebyshev.h.

◆ Condest() [1/2]

virtual double Ifpack_Chebyshev::Condest ( ) const
inlinevirtual

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

Implements Ifpack_Preconditioner.

Definition at line 243 of file Ifpack_Chebyshev.h.

Referenced by Print().

◆ Condest() [2/2]

double Ifpack_Chebyshev::Condest ( const Ifpack_CondestType CT = Ifpack_Cheap,
const int MaxIters = 1550,
const double Tol = 1e-9,
Epetra_RowMatrix * Matrix_in = 0 )
virtual

Computes the condition number estimates and returns the value.

Implements Ifpack_Preconditioner.

Definition at line 435 of file Ifpack_Chebyshev.cpp.

References IsComputed().

◆ GetLambdaMax()

virtual double Ifpack_Chebyshev::GetLambdaMax ( )
inlinevirtual

Returns an approximation to the largest eigenvalue.

Definition at line 222 of file Ifpack_Chebyshev.h.

◆ GetLambdaMin()

virtual double Ifpack_Chebyshev::GetLambdaMin ( )
inlinevirtual

Contains an approximation to the smallest eigenvalue.

Definition at line 225 of file Ifpack_Chebyshev.h.

◆ HasNormInf()

virtual bool Ifpack_Chebyshev::HasNormInf ( ) const
inlinevirtual

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

Implements Epetra_Operator.

Definition at line 191 of file Ifpack_Chebyshev.h.

◆ Initialize()

int Ifpack_Chebyshev::Initialize ( )
virtual

Computes all it is necessary to initialize the preconditioner.

Implements Ifpack_Preconditioner.

Definition at line 249 of file Ifpack_Chebyshev.cpp.

References Comm(), and Matrix().

Referenced by Compute().

◆ InitializeFlops()

virtual double Ifpack_Chebyshev::InitializeFlops ( ) const
inlinevirtual

Returns the number of flops in the initialization phase.

Implements Ifpack_Preconditioner.

Definition at line 295 of file Ifpack_Chebyshev.h.

◆ InitializeTime()

virtual double Ifpack_Chebyshev::InitializeTime ( ) const
inlinevirtual

Returns the time spent in Initialize().

Implements Ifpack_Preconditioner.

Definition at line 277 of file Ifpack_Chebyshev.h.

◆ IsComputed()

virtual bool Ifpack_Chebyshev::IsComputed ( ) const
inlinevirtual

Returns true if the preconditioner has been successfully computed.

Implements Ifpack_Preconditioner.

Definition at line 213 of file Ifpack_Chebyshev.h.

Referenced by Apply(), ApplyInverse(), and Condest().

◆ IsInitialized()

virtual bool Ifpack_Chebyshev::IsInitialized ( ) const
inlinevirtual

Returns true if the preconditioner has been successfully initialized, false otherwise.

Implements Ifpack_Preconditioner.

Definition at line 207 of file Ifpack_Chebyshev.h.

Referenced by Compute().

◆ Label()

virtual const char * Ifpack_Chebyshev::Label ( ) const
inlinevirtual

Implements Epetra_Operator.

Definition at line 179 of file Ifpack_Chebyshev.h.

◆ Matrix()

virtual const Epetra_RowMatrix & Ifpack_Chebyshev::Matrix ( ) const
inlinevirtual

Returns a pointer to the matrix to be preconditioned.

Implements Ifpack_Preconditioner.

Definition at line 231 of file Ifpack_Chebyshev.h.

Referenced by Compute(), and Initialize().

◆ NormInf()

virtual double Ifpack_Chebyshev::NormInf ( ) const
inlinevirtual

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

Implements Epetra_Operator.

Definition at line 171 of file Ifpack_Chebyshev.h.

◆ NumApplyInverse()

virtual int Ifpack_Chebyshev::NumApplyInverse ( ) const
inlinevirtual

Returns the number of calls to ApplyInverse().

Implements Ifpack_Preconditioner.

Definition at line 271 of file Ifpack_Chebyshev.h.

◆ NumCompute()

virtual int Ifpack_Chebyshev::NumCompute ( ) const
inlinevirtual

Returns the number of calls to Compute().

Implements Ifpack_Preconditioner.

Definition at line 265 of file Ifpack_Chebyshev.h.

◆ NumInitialize()

virtual int Ifpack_Chebyshev::NumInitialize ( ) const
inlinevirtual

Returns the number of calls to Initialize().

Implements Ifpack_Preconditioner.

Definition at line 259 of file Ifpack_Chebyshev.h.

◆ OperatorDomainMap()

const Epetra_Map & Ifpack_Chebyshev::OperatorDomainMap ( ) const
virtual

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

Implements Epetra_Operator.

Definition at line 215 of file Ifpack_Chebyshev.cpp.

◆ OperatorRangeMap()

const Epetra_Map & Ifpack_Chebyshev::OperatorRangeMap ( ) const
virtual

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

Implements Epetra_Operator.

Definition at line 221 of file Ifpack_Chebyshev.cpp.

◆ PowerMethod()

int Ifpack_Chebyshev::PowerMethod ( const Epetra_Operator & Operator,
const Epetra_Vector & InvPointDiagonal,
const int MaximumIterations,
double & LambdaMax,
const unsigned int * RngSeed = 0 )
static

◆ Print()

std::ostream & Ifpack_Chebyshev::Print ( std::ostream & os) const
virtual

Prints object to an output stream.

Implements Ifpack_Preconditioner.

Definition at line 378 of file Ifpack_Chebyshev.cpp.

References Comm(), Condest(), and Epetra_Comm::MinAll().

◆ SetParameters()

int Ifpack_Chebyshev::SetParameters ( Teuchos::ParameterList & List)
virtual

Sets all the parameters for the preconditioner.

Implements Ifpack_Preconditioner.

Definition at line 160 of file Ifpack_Chebyshev.cpp.

◆ SetUseTranspose()

virtual int Ifpack_Chebyshev::SetUseTranspose ( bool UseTranspose_in)
inlinevirtual

This flag can be used to apply the preconditioner to the transpose of the input operator.

Returns
Integer error code, set to 0 if successful. Set to -1 if this implementation does not support transpose.

Implements Epetra_Operator.

Definition at line 136 of file Ifpack_Chebyshev.h.

◆ UseTranspose()

virtual bool Ifpack_Chebyshev::UseTranspose ( ) const
inlinevirtual

Returns the current UseTranspose setting.

Implements Epetra_Operator.

Definition at line 185 of file Ifpack_Chebyshev.h.

Referenced by Apply().


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