Ifpack2 Templated Preconditioning Package Version 1.0
Ifpack2::Krylov< MatrixType, PrecType > Class Template Reference

A class for constructing and using a CG/GMRES smoother. More...

#include <Ifpack2_Krylov_decl.hpp>

Inheritance diagram for Ifpack2::Krylov< MatrixType, PrecType >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 Krylov (const Teuchos::RCP< const Tpetra::RowMatrix< scalar_type, local_ordinal_type, global_ordinal_type, node_type > > &A)
 Krylov explicit constuctor with Tpetra::RowMatrix input.
virtual ~Krylov ()
 Krylov Destructor.
void setParameters (const Teuchos::ParameterList &params)
 Set parameters for the preconditioner.
void initialize ()
 Initialize Krylov preconditioner object.
bool isInitialized () const
 Returns true if the preconditioner has been successfully initialized.
void compute ()
 Setup iteration.
bool isComputed () const
 If compute() is completed, this query returns true, otherwise it returns false.
Methods implementing Tpetra::Operator.
void apply (const Tpetra::MultiVector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > &X, Tpetra::MultiVector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, scalar_type alpha=Teuchos::ScalarTraits< scalar_type >::one(), scalar_type beta=Teuchos::ScalarTraits< scalar_type >::zero()) const
 Returns the result of a few iterations of CG/GMRES on a Tpetra::MultiVector X in Y.
const Teuchos::RCP< const
Tpetra::Map
< local_ordinal_type,
global_ordinal_type, node_type > > & 
getDomainMap () const
 Tpetra::Map representing the domain of this operator.
const Teuchos::RCP< const
Tpetra::Map
< local_ordinal_type,
global_ordinal_type, node_type > > & 
getRangeMap () const
 Tpetra::Map representing the range of this operator.
bool hasTransposeApply () const
 Whether this object's apply() method can apply the transpose (or conjugate transpose, if applicable).
magnitude_type getCondEst () const
 Returns the computed estimated condition number, or -1.0 if no computed.
Mathematical functions.
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_type,
local_ordinal_type,
global_ordinal_type, node_type > > 
getMatrix () const
 Returns a reference to the matrix to be preconditioned.
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().
magnitude_type computeCondEst (CondestType CT=Cheap, local_ordinal_type MaxIters=1550, magnitude_type Tol=1e-9, const Teuchos::Ptr< const Tpetra::RowMatrix< scalar_type, local_ordinal_type, global_ordinal_type, node_type > > &Matrix_in=Teuchos::null)
 Computes the estimated condition number and returns the value.
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.
typedef MatrixType::scalar_type scalar_type
 The type of the entries of the input MatrixType.
typedef BelosScalarType
< scalar_type >::type 
belos_scalar_type
 The scalar type used by Belos (which may not be scalar_type)
typedef
MatrixType::local_ordinal_type 
local_ordinal_type
 The type of local indices in the input MatrixType.
typedef
MatrixType::global_ordinal_type 
global_ordinal_type
 The type of global indices in the input MatrixType.
typedef MatrixType::node_type node_type
 The type of the Kokkos Node used by the input MatrixType.
typedef Teuchos::ScalarTraits
< scalar_type >::magnitudeType 
magnitude_type
 The type of the magnitude (absolute value) of a matrix entry.
TEUCHOS_DEPRECATED typedef
MatrixType::scalar_type 
Scalar
 Preserved only for backwards compatibility. Please use "scalar_type".
TEUCHOS_DEPRECATED typedef
MatrixType::local_ordinal_type 
LocalOrdinal
 Preserved only for backwards compatibility. Please use "local_ordinal_type".
TEUCHOS_DEPRECATED typedef
MatrixType::global_ordinal_type 
GlobalOrdinal
 Preserved only for backwards compatibility. Please use "global_ordinal_type".
TEUCHOS_DEPRECATED typedef
MatrixType::node_type 
Node
 Preserved only for backwards compatibility. Please use "node_type".
TEUCHOS_DEPRECATED typedef
Teuchos::ScalarTraits
< scalar_type >::magnitudeType 
magnitudeType
 Preserved only for backwards compatibility. Please use "magnitude_type".

Detailed Description

template<class MatrixType, class PrecType>
class Ifpack2::Krylov< MatrixType, PrecType >

A class for constructing and using a CG/GMRES smoother.

Ifpack2::Krylov computes a few iterations of CG/GMRES with zero initial guess as a smoother for a given Tpetra::RowMatrix.

For all valid parameters, see the method Krylov::setParameters.


Member Typedef Documentation

template<class MatrixType, class PrecType>
typedef MatrixType::scalar_type Ifpack2::Krylov< MatrixType, PrecType >::scalar_type

The type of the entries of the input MatrixType.

template<class MatrixType, class PrecType>
typedef BelosScalarType<scalar_type>::type Ifpack2::Krylov< MatrixType, PrecType >::belos_scalar_type

The scalar type used by Belos (which may not be scalar_type)

template<class MatrixType, class PrecType>
typedef MatrixType::local_ordinal_type Ifpack2::Krylov< MatrixType, PrecType >::local_ordinal_type

The type of local indices in the input MatrixType.

template<class MatrixType, class PrecType>
typedef MatrixType::global_ordinal_type Ifpack2::Krylov< MatrixType, PrecType >::global_ordinal_type

The type of global indices in the input MatrixType.

template<class MatrixType, class PrecType>
typedef MatrixType::node_type Ifpack2::Krylov< MatrixType, PrecType >::node_type

The type of the Kokkos Node used by the input MatrixType.

template<class MatrixType, class PrecType>
typedef Teuchos::ScalarTraits<scalar_type>::magnitudeType Ifpack2::Krylov< MatrixType, PrecType >::magnitude_type

The type of the magnitude (absolute value) of a matrix entry.


Constructor & Destructor Documentation

template<class MatrixType , class PrecType >
Ifpack2::Krylov< MatrixType, PrecType >::Krylov ( const Teuchos::RCP< const Tpetra::RowMatrix< scalar_type, local_ordinal_type, global_ordinal_type, node_type > > &  A) [explicit]

Krylov explicit constuctor with Tpetra::RowMatrix input.

template<class MatrixType , class PrecType >
Ifpack2::Krylov< MatrixType, PrecType >::~Krylov ( ) [virtual]

Krylov Destructor.


Member Function Documentation

template<class MatrixType , class PrecType >
void Ifpack2::Krylov< MatrixType, PrecType >::setParameters ( const Teuchos::ParameterList params) [virtual]

Set parameters for the preconditioner.

  • "krylov: number of iterations" (int)
  • "krylov: residual tolerance" (double)
  • "krylov: inner preconditioner" (string)
  • "krylov: number of sweeps for inner preconditioning" (int)
  • "krylov: damping parameter for inner preconditioning" (double)

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

template<class MatrixType , class PrecType >
void Ifpack2::Krylov< MatrixType, PrecType >::initialize ( ) [virtual]
template<class MatrixType, class PrecType>
bool Ifpack2::Krylov< MatrixType, PrecType >::isInitialized ( ) const [inline, virtual]
template<class MatrixType , class PrecType >
void Ifpack2::Krylov< MatrixType, PrecType >::compute ( ) [virtual]
template<class MatrixType, class PrecType>
bool Ifpack2::Krylov< MatrixType, PrecType >::isComputed ( ) const [inline, virtual]
template<class MatrixType, class PrecType>
void Ifpack2::Krylov< MatrixType, PrecType >::apply ( const Tpetra::MultiVector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > &  X,
Tpetra::MultiVector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > &  Y,
Teuchos::ETransp  mode = Teuchos::NO_TRANS,
scalar_type  alpha = Teuchos::ScalarTraitsscalar_type >::one(),
scalar_type  beta = Teuchos::ScalarTraitsscalar_type >::zero() 
) const [virtual]

Returns the result of a few iterations of CG/GMRES on a Tpetra::MultiVector X in Y.

Parameters:
X- (In) A Tpetra::MultiVector of dimension NumVectors to solve for.
Y- (Out) A Tpetra::MultiVector of dimension NumVectors containing result.

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

template<class MatrixType , class PrecType >
const Teuchos::RCP< const Tpetra::Map< typename MatrixType::local_ordinal_type, typename MatrixType::global_ordinal_type, typename MatrixType::node_type > > & Ifpack2::Krylov< MatrixType, PrecType >::getDomainMap ( ) const [virtual]
template<class MatrixType , class PrecType >
const Teuchos::RCP< const Tpetra::Map< typename MatrixType::local_ordinal_type, typename MatrixType::global_ordinal_type, typename MatrixType::node_type > > & Ifpack2::Krylov< MatrixType, PrecType >::getRangeMap ( ) const [virtual]
template<class MatrixType , class PrecType >
bool Ifpack2::Krylov< MatrixType, PrecType >::hasTransposeApply ( ) const

Whether this object's apply() method can apply the transpose (or conjugate transpose, if applicable).

template<class MatrixType, class PrecType>
magnitude_type Ifpack2::Krylov< MatrixType, PrecType >::getCondEst ( ) const [inline, virtual]
template<class MatrixType , class PrecType >
const Teuchos::RCP< const Teuchos::Comm< int > > & Ifpack2::Krylov< MatrixType, PrecType >::getComm ( ) const

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

template<class MatrixType , class PrecType >
Teuchos::RCP< const Tpetra::RowMatrix< typename MatrixType::scalar_type, typename MatrixType::local_ordinal_type, typename MatrixType::global_ordinal_type, typename MatrixType::node_type > > Ifpack2::Krylov< MatrixType, PrecType >::getMatrix ( ) const [virtual]
template<class MatrixType , class PrecType >
int Ifpack2::Krylov< MatrixType, PrecType >::getNumInitialize ( ) const [virtual]
template<class MatrixType , class PrecType >
int Ifpack2::Krylov< MatrixType, PrecType >::getNumCompute ( ) const [virtual]
template<class MatrixType , class PrecType >
int Ifpack2::Krylov< MatrixType, PrecType >::getNumApply ( ) const [virtual]
template<class MatrixType , class PrecType >
double Ifpack2::Krylov< MatrixType, PrecType >::getInitializeTime ( ) const [virtual]
template<class MatrixType , class PrecType >
double Ifpack2::Krylov< MatrixType, PrecType >::getComputeTime ( ) const [virtual]
template<class MatrixType , class PrecType >
double Ifpack2::Krylov< MatrixType, PrecType >::getApplyTime ( ) const [virtual]
template<class MatrixType , class PrecType >
Krylov< MatrixType, PrecType >::magnitude_type Ifpack2::Krylov< MatrixType, PrecType >::computeCondEst ( CondestType  CT = Cheap,
local_ordinal_type  MaxIters = 1550,
magnitude_type  Tol = 1e-9,
const Teuchos::Ptr< const Tpetra::RowMatrix< scalar_type, local_ordinal_type, global_ordinal_type, node_type > > &  Matrix_in = Teuchos::null 
) [virtual]
template<class MatrixType , class PrecType >
std::string Ifpack2::Krylov< MatrixType, PrecType >::description ( ) const

Return a simple one-line description of this object.

template<class MatrixType , class PrecType >
void Ifpack2::Krylov< MatrixType, PrecType >::describe ( Teuchos::FancyOStream out,
const Teuchos::EVerbosityLevel  verbLevel = Teuchos::Describable::verbLevel_default 
) const

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


Member Data Documentation

template<class MatrixType, class PrecType>
TEUCHOS_DEPRECATED typedef MatrixType::scalar_type Ifpack2::Krylov< MatrixType, PrecType >::Scalar

Preserved only for backwards compatibility. Please use "scalar_type".

template<class MatrixType, class PrecType>
TEUCHOS_DEPRECATED typedef MatrixType::local_ordinal_type Ifpack2::Krylov< MatrixType, PrecType >::LocalOrdinal

Preserved only for backwards compatibility. Please use "local_ordinal_type".

template<class MatrixType, class PrecType>
TEUCHOS_DEPRECATED typedef MatrixType::global_ordinal_type Ifpack2::Krylov< MatrixType, PrecType >::GlobalOrdinal

Preserved only for backwards compatibility. Please use "global_ordinal_type".

template<class MatrixType, class PrecType>
TEUCHOS_DEPRECATED typedef MatrixType::node_type Ifpack2::Krylov< MatrixType, PrecType >::Node

Preserved only for backwards compatibility. Please use "node_type".

template<class MatrixType, class PrecType>
TEUCHOS_DEPRECATED typedef Teuchos::ScalarTraits<scalar_type>::magnitudeType Ifpack2::Krylov< MatrixType, PrecType >::magnitudeType

Preserved only for backwards compatibility. Please use "magnitude_type".

Reimplemented from Ifpack2::Preconditioner< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type >.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends