Ifpack Package Browser (Single Doxygen Collection)  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Types | List of all members
Ifpack_Krylov Class Reference

Ifpack_Krylov: class for smoothing with Krylov solvers in Ifpack. More...

#include <Ifpack_Krylov.h>

Inheritance diagram for Ifpack_Krylov:
Inheritance graph
[legend]

Public Member Functions

virtual int SetUseTranspose (bool UseTranspose_in)
 

Private Types

typedef double SC
 
typedef Epetra_MultiVector MV
 
typedef Epetra_Operator OP
 
typedef Epetra_RowMatrix RM
 
 Ifpack_Krylov (Epetra_Operator *Matrix)
 
 Ifpack_Krylov (Epetra_RowMatrix *Matrix)
 Ifpack_Krylov constructor with given Epetra_Operator/Epetra_RowMatrix. More...
 
virtual ~Ifpack_Krylov ()
 Destructor. More...
 
virtual int Apply (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
 Applies the matrix to an Epetra_MultiVector. More...
 
virtual int ApplyInverse (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
 Applies the preconditioner to X, returns the result in Y. More...
 
virtual double NormInf () const
 Returns the infinity norm of the global matrix (not implemented) More...
 
virtual const char * Label () const
 
virtual bool UseTranspose () const
 Returns the current UseTranspose setting. More...
 
virtual bool HasNormInf () const
 Returns true if the this object can provide an approximate Inf-norm, false otherwise. More...
 
virtual const Epetra_CommComm () const
 Returns a pointer to the Epetra_Comm communicator associated with this operator. More...
 
virtual const Epetra_MapOperatorDomainMap () const
 Returns the Epetra_Map object associated with the domain of this operator. More...
 
virtual const Epetra_MapOperatorRangeMap () const
 Returns the Epetra_Map object associated with the range of this operator. More...
 
virtual int Initialize ()
 Computes all it is necessary to initialize the preconditioner. More...
 
virtual bool IsInitialized () const
 Returns true if the preconditioner has been successfully initialized, false otherwise. More...
 
virtual bool IsComputed () const
 Returns true if the preconditioner has been successfully computed. More...
 
virtual int Compute ()
 Computes the preconditioners. More...
 
virtual const Epetra_RowMatrixMatrix () const
 Returns a pointer to the matrix to be preconditioned. More...
 
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. More...
 
virtual double Condest () const
 Returns the condition number estimate, or -1.0 if not computed. More...
 
virtual int SetParameters (Teuchos::ParameterList &List)
 Sets all the parameters for the preconditioner. More...
 
virtual std::ostream & Print (std::ostream &os) const
 Prints object to an output stream. More...
 
virtual int NumInitialize () const
 Returns the number of calls to Initialize(). More...
 
virtual int NumCompute () const
 Returns the number of calls to Compute(). More...
 
virtual int NumApplyInverse () const
 Returns the number of calls to ApplyInverse(). More...
 
virtual double InitializeTime () const
 Returns the time spent in Initialize(). More...
 
virtual double ComputeTime () const
 Returns the time spent in Compute(). More...
 
virtual double ApplyInverseTime () const
 Returns the time spent in ApplyInverse(). More...
 
virtual double InitializeFlops () const
 Returns the number of flops in the initialization phase. More...
 
virtual double ComputeFlops () const
 Returns the number of flops in the computation phase. More...
 
virtual double ApplyInverseFlops () const
 Returns the number of flops for the application of the preconditioner. More...
 
bool IsInitialized_
 If true, the preconditioner has been computed successfully. More...
 
bool IsComputed_
 If true, the preconditioner has been computed successfully. More...
 
int NumInitialize_
 Contains the number of successful calls to Initialize(). More...
 
int NumCompute_
 Contains the number of successful call to Compute(). More...
 
int NumApplyInverse_
 Contains the number of successful call to ApplyInverse(). More...
 
double InitializeTime_
 Contains the time for all successful calls to Initialize(). More...
 
double ComputeTime_
 Contains the time for all successful calls to Compute(). More...
 
double ApplyInverseTime_
 Contains the time for all successful calls to ApplyInverse(). More...
 
double ComputeFlops_
 Contains the number of flops for Compute(). More...
 
double ApplyInverseFlops_
 Contain sthe number of flops for ApplyInverse(). More...
 
virtual void SetLabel ()
 Sets the label. More...
 
 Ifpack_Krylov (const Ifpack_Krylov &)
 Copy constructor (PRIVATE, should not be used) More...
 
Ifpack_Krylovoperator= (const Ifpack_Krylov &)
 operator = (PRIVATE, should not be used) More...
 
int Iterations_
 Max number of iterations. More...
 
double Tolerance_
 Residual Tolerance. More...
 
int SolverType_
 Solver - 0 for CG, 1 for GMRES. More...
 
int PreconditionerType_
 Preconditioner - 0 for none, 1 for Jacobi, 2 for GS, 3 for SGS. More...
 
int NumSweeps_
 Number of GS or Jacobi sweeps. More...
 
int BlockSize_
 Block Size (for block relaxation) More...
 
double DampingParameter_
 Damping parameter for inner preconditioner. More...
 
bool UseTranspose_
 If true, use the tranpose of Matrix_. More...
 
double Condest_
 Contains the estimated condition number. More...
 
std::string Label_
 Contains the label of this object. More...
 
int NumMyRows_
 Number of local rows. More...
 
int NumMyNonzeros_
 Number of local nonzeros. More...
 
long long NumGlobalRows_
 Number of global rows. More...
 
long long NumGlobalNonzeros_
 Number of global nonzeros. More...
 
Teuchos::RefCountPtr
< Epetra_Operator
Operator_
 Pointers to the matrix as an Epetra_Operator. More...
 
Teuchos::RefCountPtr
< Epetra_RowMatrix
Matrix_
 Pointers to the matrix as an Epetra_RowMatrix. More...
 
bool IsRowMatrix_
 If true, the Operator_ is an Epetra_RowMatrix. More...
 
Teuchos::RefCountPtr< Epetra_TimeTime_
 Time object to track timing. More...
 
bool ZeroStartingSolution_
 If true, the starting solution is always the zero vector. More...
 
Teuchos::RCP
< Ifpack_Preconditioner
IfpackPrec_
 

Detailed Description

Ifpack_Krylov: class for smoothing with Krylov solvers in Ifpack.

Definition at line 81 of file Ifpack_Krylov.h.

Member Typedef Documentation

typedef double Ifpack_Krylov::SC
private

Definition at line 83 of file Ifpack_Krylov.h.

Definition at line 84 of file Ifpack_Krylov.h.

Definition at line 85 of file Ifpack_Krylov.h.

Definition at line 86 of file Ifpack_Krylov.h.

Constructor & Destructor Documentation

Ifpack_Krylov::Ifpack_Krylov ( Epetra_Operator Matrix)

Definition at line 68 of file Ifpack_Krylov.cpp.

Ifpack_Krylov::Ifpack_Krylov ( Epetra_RowMatrix Matrix)

Ifpack_Krylov constructor with given Epetra_Operator/Epetra_RowMatrix.

Definition at line 110 of file Ifpack_Krylov.cpp.

virtual Ifpack_Krylov::~Ifpack_Krylov ( )
inlinevirtual

Destructor.

Definition at line 97 of file Ifpack_Krylov.h.

Ifpack_Krylov::Ifpack_Krylov ( const Ifpack_Krylov )
inlineprivate

Copy constructor (PRIVATE, should not be used)

Definition at line 282 of file Ifpack_Krylov.h.

Member Function Documentation

virtual int Ifpack_Krylov::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 107 of file Ifpack_Krylov.h.

int Ifpack_Krylov::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 178 of file Ifpack_Krylov.cpp.

int Ifpack_Krylov::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 380 of file Ifpack_Krylov.cpp.

virtual double Ifpack_Krylov::NormInf ( ) const
inlinevirtual

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

Implements Epetra_Operator.

Definition at line 142 of file Ifpack_Krylov.h.

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

Implements Epetra_Operator.

Definition at line 150 of file Ifpack_Krylov.h.

virtual bool Ifpack_Krylov::UseTranspose ( ) const
inlinevirtual

Returns the current UseTranspose setting.

Implements Epetra_Operator.

Definition at line 156 of file Ifpack_Krylov.h.

virtual bool Ifpack_Krylov::HasNormInf ( ) const
inlinevirtual

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

Implements Epetra_Operator.

Definition at line 162 of file Ifpack_Krylov.h.

const Epetra_Comm & Ifpack_Krylov::Comm ( ) const
virtual

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

Implements Epetra_Operator.

Definition at line 159 of file Ifpack_Krylov.cpp.

const Epetra_Map & Ifpack_Krylov::OperatorDomainMap ( ) const
virtual

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

Implements Epetra_Operator.

Definition at line 165 of file Ifpack_Krylov.cpp.

const Epetra_Map & Ifpack_Krylov::OperatorRangeMap ( ) const
virtual

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

Implements Epetra_Operator.

Definition at line 171 of file Ifpack_Krylov.cpp.

int Ifpack_Krylov::Initialize ( )
virtual

Computes all it is necessary to initialize the preconditioner.

Implements Ifpack_Preconditioner.

Definition at line 199 of file Ifpack_Krylov.cpp.

virtual bool Ifpack_Krylov::IsInitialized ( ) const
inlinevirtual

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

Implements Ifpack_Preconditioner.

Definition at line 178 of file Ifpack_Krylov.h.

virtual bool Ifpack_Krylov::IsComputed ( ) const
inlinevirtual

Returns true if the preconditioner has been successfully computed.

Implements Ifpack_Preconditioner.

Definition at line 184 of file Ifpack_Krylov.h.

int Ifpack_Krylov::Compute ( )
virtual

Computes the preconditioners.

Implements Ifpack_Preconditioner.

Definition at line 233 of file Ifpack_Krylov.cpp.

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

Returns a pointer to the matrix to be preconditioned.

Implements Ifpack_Preconditioner.

Definition at line 192 of file Ifpack_Krylov.h.

double Ifpack_Krylov::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 358 of file Ifpack_Krylov.cpp.

virtual double Ifpack_Krylov::Condest ( ) const
inlinevirtual

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

Implements Ifpack_Preconditioner.

Definition at line 204 of file Ifpack_Krylov.h.

int Ifpack_Krylov::SetParameters ( Teuchos::ParameterList List)
virtual

Sets all the parameters for the preconditioner.

Implements Ifpack_Preconditioner.

Definition at line 144 of file Ifpack_Krylov.cpp.

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

Prints object to an output stream.

Implements Ifpack_Preconditioner.

Definition at line 310 of file Ifpack_Krylov.cpp.

virtual int Ifpack_Krylov::NumInitialize ( ) const
inlinevirtual

Returns the number of calls to Initialize().

Implements Ifpack_Preconditioner.

Definition at line 220 of file Ifpack_Krylov.h.

virtual int Ifpack_Krylov::NumCompute ( ) const
inlinevirtual

Returns the number of calls to Compute().

Implements Ifpack_Preconditioner.

Definition at line 226 of file Ifpack_Krylov.h.

virtual int Ifpack_Krylov::NumApplyInverse ( ) const
inlinevirtual

Returns the number of calls to ApplyInverse().

Implements Ifpack_Preconditioner.

Definition at line 232 of file Ifpack_Krylov.h.

virtual double Ifpack_Krylov::InitializeTime ( ) const
inlinevirtual

Returns the time spent in Initialize().

Implements Ifpack_Preconditioner.

Definition at line 238 of file Ifpack_Krylov.h.

virtual double Ifpack_Krylov::ComputeTime ( ) const
inlinevirtual

Returns the time spent in Compute().

Implements Ifpack_Preconditioner.

Definition at line 244 of file Ifpack_Krylov.h.

virtual double Ifpack_Krylov::ApplyInverseTime ( ) const
inlinevirtual

Returns the time spent in ApplyInverse().

Implements Ifpack_Preconditioner.

Definition at line 250 of file Ifpack_Krylov.h.

virtual double Ifpack_Krylov::InitializeFlops ( ) const
inlinevirtual

Returns the number of flops in the initialization phase.

Implements Ifpack_Preconditioner.

Definition at line 256 of file Ifpack_Krylov.h.

virtual double Ifpack_Krylov::ComputeFlops ( ) const
inlinevirtual

Returns the number of flops in the computation phase.

Implements Ifpack_Preconditioner.

Definition at line 262 of file Ifpack_Krylov.h.

virtual double Ifpack_Krylov::ApplyInverseFlops ( ) const
inlinevirtual

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

Implements Ifpack_Preconditioner.

Definition at line 268 of file Ifpack_Krylov.h.

void Ifpack_Krylov::SetLabel ( )
privatevirtual

Sets the label.

Definition at line 373 of file Ifpack_Krylov.cpp.

Ifpack_Krylov& Ifpack_Krylov::operator= ( const Ifpack_Krylov )
inlineprivate

operator = (PRIVATE, should not be used)

Definition at line 286 of file Ifpack_Krylov.h.

Member Data Documentation

bool Ifpack_Krylov::IsInitialized_
private

If true, the preconditioner has been computed successfully.

Definition at line 293 of file Ifpack_Krylov.h.

bool Ifpack_Krylov::IsComputed_
private

If true, the preconditioner has been computed successfully.

Definition at line 295 of file Ifpack_Krylov.h.

int Ifpack_Krylov::NumInitialize_
private

Contains the number of successful calls to Initialize().

Definition at line 297 of file Ifpack_Krylov.h.

int Ifpack_Krylov::NumCompute_
private

Contains the number of successful call to Compute().

Definition at line 299 of file Ifpack_Krylov.h.

int Ifpack_Krylov::NumApplyInverse_
mutableprivate

Contains the number of successful call to ApplyInverse().

Definition at line 301 of file Ifpack_Krylov.h.

double Ifpack_Krylov::InitializeTime_
private

Contains the time for all successful calls to Initialize().

Definition at line 303 of file Ifpack_Krylov.h.

double Ifpack_Krylov::ComputeTime_
private

Contains the time for all successful calls to Compute().

Definition at line 305 of file Ifpack_Krylov.h.

double Ifpack_Krylov::ApplyInverseTime_
mutableprivate

Contains the time for all successful calls to ApplyInverse().

Definition at line 307 of file Ifpack_Krylov.h.

double Ifpack_Krylov::ComputeFlops_
private

Contains the number of flops for Compute().

Definition at line 309 of file Ifpack_Krylov.h.

double Ifpack_Krylov::ApplyInverseFlops_
mutableprivate

Contain sthe number of flops for ApplyInverse().

Definition at line 311 of file Ifpack_Krylov.h.

int Ifpack_Krylov::Iterations_
private

Max number of iterations.

Definition at line 316 of file Ifpack_Krylov.h.

double Ifpack_Krylov::Tolerance_
private

Residual Tolerance.

Definition at line 318 of file Ifpack_Krylov.h.

int Ifpack_Krylov::SolverType_
private

Solver - 0 for CG, 1 for GMRES.

Definition at line 320 of file Ifpack_Krylov.h.

int Ifpack_Krylov::PreconditionerType_
private

Preconditioner - 0 for none, 1 for Jacobi, 2 for GS, 3 for SGS.

Definition at line 322 of file Ifpack_Krylov.h.

int Ifpack_Krylov::NumSweeps_
private

Number of GS or Jacobi sweeps.

Definition at line 324 of file Ifpack_Krylov.h.

int Ifpack_Krylov::BlockSize_
private

Block Size (for block relaxation)

Definition at line 326 of file Ifpack_Krylov.h.

double Ifpack_Krylov::DampingParameter_
private

Damping parameter for inner preconditioner.

Definition at line 328 of file Ifpack_Krylov.h.

bool Ifpack_Krylov::UseTranspose_
private

If true, use the tranpose of Matrix_.

Definition at line 330 of file Ifpack_Krylov.h.

double Ifpack_Krylov::Condest_
private

Contains the estimated condition number.

Definition at line 332 of file Ifpack_Krylov.h.

std::string Ifpack_Krylov::Label_
private

Contains the label of this object.

Definition at line 340 of file Ifpack_Krylov.h.

int Ifpack_Krylov::NumMyRows_
private

Number of local rows.

Definition at line 344 of file Ifpack_Krylov.h.

int Ifpack_Krylov::NumMyNonzeros_
private

Number of local nonzeros.

Definition at line 346 of file Ifpack_Krylov.h.

long long Ifpack_Krylov::NumGlobalRows_
private

Number of global rows.

Definition at line 348 of file Ifpack_Krylov.h.

long long Ifpack_Krylov::NumGlobalNonzeros_
private

Number of global nonzeros.

Definition at line 350 of file Ifpack_Krylov.h.

Teuchos::RefCountPtr<Epetra_Operator> Ifpack_Krylov::Operator_
private

Pointers to the matrix as an Epetra_Operator.

Definition at line 352 of file Ifpack_Krylov.h.

Teuchos::RefCountPtr<Epetra_RowMatrix> Ifpack_Krylov::Matrix_
private

Pointers to the matrix as an Epetra_RowMatrix.

Definition at line 354 of file Ifpack_Krylov.h.

bool Ifpack_Krylov::IsRowMatrix_
private

If true, the Operator_ is an Epetra_RowMatrix.

Definition at line 357 of file Ifpack_Krylov.h.

Teuchos::RefCountPtr<Epetra_Time> Ifpack_Krylov::Time_
private

Time object to track timing.

Definition at line 359 of file Ifpack_Krylov.h.

bool Ifpack_Krylov::ZeroStartingSolution_
private

If true, the starting solution is always the zero vector.

Definition at line 361 of file Ifpack_Krylov.h.

Teuchos::RCP<Ifpack_Preconditioner> Ifpack_Krylov::IfpackPrec_
private

Definition at line 369 of file Ifpack_Krylov.h.


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