Tifpack::Chebyshev< MatrixType > Class Template Reference

A class for preconditioning with Chebyshev polynomials. More...

#include <Tifpack_Chebyshev_decl.hpp>

Inheritance diagram for Tifpack::Chebyshev< MatrixType >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 Chebyshev (const Teuchos::RCP< const Tpetra::RowMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &A)
 Chebyshev constructor with given Tpetra::RowMatrix input.
virtual ~Chebyshev ()
 Chebyshev destructor.

void setParameters (const Teuchos::ParameterList &params)
 Sets all the parameters for the preconditioner.
void initialize ()
 Initialize.
bool isInitialized () const
 Returns true if the preconditioner has been successfully initialized.
void compute ()
 Computes the preconditioner.
bool isComputed () const
 If preconditioner is computed, this query returns true, otherwise it returns false.
Methods implementing a Tpetra::Operator interface.

void apply (const Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X, Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, Scalar alpha=Teuchos::ScalarTraits< Scalar >::one(), Scalar beta=Teuchos::ScalarTraits< Scalar >::zero()) const
 Applies the preconditioner to X, returns the result in Y.
const Teuchos::RCP< const
Tpetra::Map< LocalOrdinal,
GlobalOrdinal, Node > > & 
getDomainMap () const
 Returns the Tpetra::Map object associated with the domain of this operator.
const Teuchos::RCP< const
Tpetra::Map< LocalOrdinal,
GlobalOrdinal, Node > > & 
getRangeMap () const
 Returns the Tpetra::Map object associated with the range of this operator.
bool hasTransposeApply () const
void applyMat (const Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X, Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS) const
 Applies the matrix to a Tpetra::MultiVector.
Mathematical functions.

magnitudeType computeCondEst (CondestType CT=Cheap, LocalOrdinal MaxIters=1550, magnitudeType Tol=1e-9, const Teuchos::Ptr< const Tpetra::RowMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &matrix=Teuchos::null)
 Computes the estimated condition number and returns the value.
Attribute accessor methods

magnitudeType getCondEst () const
 Returns the computed estimated condition number, or -1.0 if no computed.
const Teuchos::RCP< const
Teuchos::Comm< int > > & 
getComm () const
 Returns the Tpetra::BlockMap object associated with the range of this matrix operator.
Teuchos::RCP< const
Tpetra::RowMatrix< Scalar,
LocalOrdinal, GlobalOrdinal,
Node > > 
getMatrix () const
 Returns a reference to the matrix to be preconditioned.
double getComputeFlops () const
 Returns the number of flops in the computation phase.
double getApplyFlops () const
 Returns the number of flops for the application of the preconditioner.
int getNumInitialize () const
 Returns the number of calls to initialize().
int getNumCompute () const
 Returns the number of calls to compute().
int getNumApply () const
 Returns the number of calls to apply().
double getInitializeTime () const
 Returns the time spent in initialize().
double getComputeTime () const
 Returns the time spent in compute().
double getApplyTime () const
 Returns the time spent in apply().
Overridden from Teuchos::Describable

std::string description () const
 Return a simple one-line description of this object.
void describe (Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
 Print the object with some verbosity level to an FancyOStream object.

Static Public Member Functions

static void PowerMethod (const Tpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Operator, const Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &InvPointDiagonal, const int MaximumIterations, Scalar &LambdaMax)
 Simple power method to compute lambda_max.
static void CG (const Tpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Operator, const Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &InvPointDiagonal, const int MaximumIterations, Scalar &lambda_min, Scalar &lambda_max)
 Not currently implemented: Use CG to estimate lambda_min and lambda_max.

Detailed Description

template<class MatrixType>
class Tifpack::Chebyshev< MatrixType >

A class for preconditioning with Chebyshev polynomials.

Tifpack::Chebyshev enables the construction of preconditioners based on Chebyshev polynomials for a Tpetra::RowMatrix. Tifpack::Chebyshev is derived from the Tifpack::Preconditioner class, which is itself derived from Tpetra::Operator. Therefore this object can be used as preconditioner everywhere an apply() method is required in the preconditioning step.

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

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

For the list of parameters, see the Chebyshev::setParameters method.

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

Constructor & Destructor Documentation

template<class MatrixType >
Tifpack::Chebyshev< MatrixType >::Chebyshev ( const Teuchos::RCP< const Tpetra::RowMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &  A  )  [inline, explicit]

Chebyshev constructor with given Tpetra::RowMatrix input.

template<class MatrixType >
Tifpack::Chebyshev< MatrixType >::~Chebyshev (  )  [inline, virtual]

Chebyshev destructor.


Member Function Documentation

template<class MatrixType >
void Tifpack::Chebyshev< MatrixType >::setParameters ( const Teuchos::ParameterList params  )  [inline, virtual]

Sets all the parameters for the preconditioner.

Valid parameters include the following:

  • "chebyshev: ratio eigenvalue" (Scalar)
    this is the ratio to define the lower bound on the spectrum; lambda^* = LambdaMax / EigRatio; a typical value used in ML is 30.0 (30.0 is the default value).
  • "chebyshev: min eigenvalue" (Scalar)
    this is the smallest eigenvalue; this parameter is optional and is only accessed to check whether the input matrix is equal to identity.
  • "chebyshev: max eigenvalue" (Scalar)
    this is the largest eigenvalue of the matrix.
  • "chebyshev: degree" (int)
    this is the polynomial degree.
  • "chebyshev: min diagonal value" (Scalar)
    this defines the threshold for diagonal values under which they are not inverted
  • "chebyshev: zero starting solution" (bool)
    Determines whether the 'x' vector is zero'd on entry to Chebyshev::apply.

Implements Tifpack::Preconditioner< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type >.

template<class MatrixType >
void Tifpack::Chebyshev< MatrixType >::initialize (  )  [inline, virtual]
template<class MatrixType>
bool Tifpack::Chebyshev< MatrixType >::isInitialized (  )  const [inline, virtual]
template<class MatrixType >
void Tifpack::Chebyshev< MatrixType >::compute (  )  [inline, virtual]
template<class MatrixType>
bool Tifpack::Chebyshev< MatrixType >::isComputed (  )  const [inline, virtual]

If preconditioner is computed, this query returns true, otherwise it returns false.

Implements Tifpack::Preconditioner< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type >.

template<class MatrixType>
void Tifpack::Chebyshev< MatrixType >::apply ( const Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &  X,
Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &  Y,
Teuchos::ETransp  mode = Teuchos::NO_TRANS,
Scalar  alpha = Teuchos::ScalarTraits< Scalar >::one(),
Scalar  beta = Teuchos::ScalarTraits< Scalar >::zero() 
) const [virtual]

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

Parameters:
X - (In) A Tpetra::MultiVector of dimension NumVectors to be preconditioned.
Y - (InOut) A Tpetra::_MultiVector of dimension NumVectors containing result.

Implements Tifpack::Preconditioner< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type >.

template<class MatrixType >
const Teuchos::RCP< const Tpetra::Map< typename MatrixType::local_ordinal_type, typename MatrixType::global_ordinal_type, typename MatrixType::node_type > > & Tifpack::Chebyshev< MatrixType >::getDomainMap (  )  const [inline, virtual]
template<class MatrixType >
const Teuchos::RCP< const Tpetra::Map< typename MatrixType::local_ordinal_type, typename MatrixType::global_ordinal_type, typename MatrixType::node_type > > & Tifpack::Chebyshev< MatrixType >::getRangeMap (  )  const [inline, virtual]
template<class MatrixType>
void Tifpack::Chebyshev< MatrixType >::applyMat ( const Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &  X,
Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &  Y,
Teuchos::ETransp  mode = Teuchos::NO_TRANS 
) const

Applies the matrix to a Tpetra::MultiVector.

Parameters:
X - (In) A Tpetra::MultiVector of dimension NumVectors to multiply with matrix.
Y - (Out) A Tpetra::MultiVector of dimension NumVectors containing the result.
template<class MatrixType >
Teuchos::ScalarTraits< typename MatrixType::scalar_type >::magnitudeType Tifpack::Chebyshev< MatrixType >::computeCondEst ( CondestType  CT = Cheap,
LocalOrdinal  MaxIters = 1550,
magnitudeType  Tol = 1e-9,
const Teuchos::Ptr< const Tpetra::RowMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &  matrix = Teuchos::null 
) [inline]

Computes the estimated condition number and returns the value.

template<class MatrixType >
Teuchos::ScalarTraits< typename MatrixType::scalar_type >::magnitudeType Tifpack::Chebyshev< MatrixType >::getCondEst (  )  const [inline, virtual]
template<class MatrixType >
const Teuchos::RCP< const Teuchos::Comm< int > > & Tifpack::Chebyshev< MatrixType >::getComm (  )  const [inline]

Returns the Tpetra::BlockMap object associated with the range of this matrix operator.

template<class MatrixType >
Teuchos::RCP< const Tpetra::RowMatrix< typename MatrixType::scalar_type, typename MatrixType::local_ordinal_type, typename MatrixType::global_ordinal_type, typename MatrixType::node_type > > Tifpack::Chebyshev< MatrixType >::getMatrix (  )  const [inline, virtual]
template<class MatrixType >
double Tifpack::Chebyshev< MatrixType >::getComputeFlops (  )  const [inline]

Returns the number of flops in the computation phase.

template<class MatrixType >
double Tifpack::Chebyshev< MatrixType >::getApplyFlops (  )  const [inline]

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

template<class MatrixType >
int Tifpack::Chebyshev< MatrixType >::getNumInitialize (  )  const [inline, virtual]
template<class MatrixType >
int Tifpack::Chebyshev< MatrixType >::getNumCompute (  )  const [inline, virtual]
template<class MatrixType >
int Tifpack::Chebyshev< MatrixType >::getNumApply (  )  const [inline, virtual]
template<class MatrixType >
double Tifpack::Chebyshev< MatrixType >::getInitializeTime (  )  const [inline, virtual]
template<class MatrixType >
double Tifpack::Chebyshev< MatrixType >::getComputeTime (  )  const [inline, virtual]
template<class MatrixType >
double Tifpack::Chebyshev< MatrixType >::getApplyTime (  )  const [inline, virtual]
template<class MatrixType >
std::string Tifpack::Chebyshev< MatrixType >::description (  )  const [inline]

Return a simple one-line description of this object.

template<class MatrixType >
void Tifpack::Chebyshev< MatrixType >::describe ( Teuchos::FancyOStream out,
const Teuchos::EVerbosityLevel  verbLevel = Teuchos::Describable::verbLevel_default 
) const [inline]

Print the object with some verbosity level to an FancyOStream object.

template<class MatrixType>
static void Tifpack::Chebyshev< MatrixType >::PowerMethod ( const Tpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node > &  Operator,
const Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &  InvPointDiagonal,
const int  MaximumIterations,
Scalar &  LambdaMax 
) [static]

Simple power method to compute lambda_max.

template<class MatrixType >
void Tifpack::Chebyshev< MatrixType >::CG ( const Tpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node > &  Operator,
const Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &  InvPointDiagonal,
const int  MaximumIterations,
Scalar &  lambda_min,
Scalar &  lambda_max 
) [inline, static]

Not currently implemented: Use CG to estimate lambda_min and lambda_max.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
Generated on Wed Apr 13 09:56:54 2011 for Tifpack Templated Preconditioning Package by  doxygen 1.6.3