|
Tifpack Templated Preconditioning Package Version 1.0
|
Ifpack2::Relaxation: defines relaxation preconditioners for Tpetra::RowMatrix objects. More...
#include <Ifpack2_Relaxation_decl.hpp>

Public Member Functions | |
| Relaxation (const Teuchos::RCP< const Tpetra::RowMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &Matrix) | |
| Relaxation constructor with given Tpetra::RowMatrix input. | |
| virtual | ~Relaxation () |
| Relaxation Destructor. | |
| void | setParameters (const Teuchos::ParameterList ¶ms) |
| Sets all the parameters for the preconditioner. | |
| void | initialize () |
| Initialize. | |
| bool | isInitialized () const |
Returns true if the preconditioner has been successfully initialized. | |
| void | compute () |
| compute the preconditioner for the specified matrix, diagonal perturbation thresholds and relaxation parameters. | |
| bool | isComputed () const |
| Return true if compute() has been called. | |
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. | |
Ifpack2::Relaxation: defines relaxation preconditioners for Tpetra::RowMatrix objects.
The Ifpack2::Relaxation class enables the construction of relaxation preconditioners for Tpetra::RowMatrix. Ifpack2::Relaxation is derived from Ifpack2::Preconditioner, 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.
This class enables the construction of the following simple preconditioners:
We now briefly describe the main features of the above preconditioners. Consider a linear system of type
where
is a square, real matrix, and
are two real vectors. We begin with the decomposition
where
is the diagonal of A,
is the strict lower part, and
is the strict upper part. It is assumed that the diagonal entries of
are different from zero.
Given an starting solution
, an iteration of the (damped) Jacobi method can be written in matrix form as follows:
for
, and
a damping parameter.
Using Ifpack2::Jacobi, the user can apply the specified number of sweeps (
), and the damping parameter. If only one sweep is used, then the class simply applies the inverse of the diagonal of A to the input vector.
Given a starting solution
, an iteration of the (damped) GaussSeidel method can be written in matrix form as follows:
for
, and
a damping parameter. Equivalently, the Gauss-Seidel preconditioner can be defined as
Clearly, the role of E and F can be interchanged. However, Ifpack2::GaussSeidel does not consider backward Gauss-Seidel methods.
For a list of supported parameters, please refer to the Relaxation::setParameters method.
| Ifpack2::Relaxation< MatrixType >::Relaxation | ( | const Teuchos::RCP< const Tpetra::RowMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > & | Matrix | ) | [explicit] |
Relaxation constructor with given Tpetra::RowMatrix input.
| Ifpack2::Relaxation< MatrixType >::~Relaxation | ( | ) | [virtual] |
Relaxation Destructor.
| void Ifpack2::Relaxation< MatrixType >::setParameters | ( | const Teuchos::ParameterList & | params | ) | [virtual] |
Sets all the parameters for the preconditioner.
Valid parameters include the following:
| void Ifpack2::Relaxation< MatrixType >::initialize | ( | ) | [virtual] |
| bool Ifpack2::Relaxation< MatrixType >::isInitialized | ( | ) | const [inline, virtual] |
Returns true if the preconditioner has been successfully initialized.
| void Ifpack2::Relaxation< MatrixType >::compute | ( | ) | [virtual] |
compute the preconditioner for the specified matrix, diagonal perturbation thresholds and relaxation parameters.
| bool Ifpack2::Relaxation< MatrixType >::isComputed | ( | ) | const [inline, virtual] |
Return true if compute() has been called.
| void Ifpack2::Relaxation< 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.
| X | - (In) A Tpetra::MultiVector of dimension NumVectors to be preconditioned. |
| Y | - (InOut) A Tpetra::MultiVector of dimension NumVectors containing result. |
| const Teuchos::RCP< const Tpetra::Map< typename MatrixType::local_ordinal_type, typename MatrixType::global_ordinal_type, typename MatrixType::node_type > > & Ifpack2::Relaxation< MatrixType >::getDomainMap | ( | ) | const [virtual] |
Returns the Tpetra::Map object associated with the domain of this operator.
| const Teuchos::RCP< const Tpetra::Map< typename MatrixType::local_ordinal_type, typename MatrixType::global_ordinal_type, typename MatrixType::node_type > > & Ifpack2::Relaxation< MatrixType >::getRangeMap | ( | ) | const [virtual] |
Returns the Tpetra::Map object associated with the range of this operator.
| void Ifpack2::Relaxation< 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.
| X | - (In) A Tpetra::MultiVector of dimension NumVectors to multiply with matrix. |
| Y | - (Out) A Tpetra::MultiVector of dimension NumVectors containing the result. |
| magnitudeType Ifpack2::Relaxation< 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 |
||
| ) | [virtual] |
Computes the estimated condition number and returns the value.
| Teuchos::ScalarTraits< typename MatrixType::scalar_type >::magnitudeType Ifpack2::Relaxation< MatrixType >::getCondEst | ( | ) | const [virtual] |
Returns the computed estimated condition number, or -1.0 if no computed.
| const Teuchos::RCP< const Teuchos::Comm< int > > & Ifpack2::Relaxation< MatrixType >::getComm | ( | ) | const |
Returns the Tpetra::BlockMap object associated with the range of this matrix operator.
| Teuchos::RCP< const Tpetra::RowMatrix< typename MatrixType::scalar_type, typename MatrixType::local_ordinal_type, typename MatrixType::global_ordinal_type, typename MatrixType::node_type > > Ifpack2::Relaxation< MatrixType >::getMatrix | ( | ) | const [virtual] |
Returns a reference to the matrix to be preconditioned.
| double Ifpack2::Relaxation< MatrixType >::getComputeFlops | ( | ) | const |
Returns the number of flops in the computation phase.
| double Ifpack2::Relaxation< MatrixType >::getApplyFlops | ( | ) | const |
Returns the number of flops for the application of the preconditioner.
| int Ifpack2::Relaxation< MatrixType >::getNumInitialize | ( | ) | const [virtual] |
Returns the number of calls to initialize().
| int Ifpack2::Relaxation< MatrixType >::getNumCompute | ( | ) | const [virtual] |
Returns the number of calls to compute().
| int Ifpack2::Relaxation< MatrixType >::getNumApply | ( | ) | const [virtual] |
Returns the number of calls to apply().
| double Ifpack2::Relaxation< MatrixType >::getInitializeTime | ( | ) | const [virtual] |
Returns the time spent in initialize().
| double Ifpack2::Relaxation< MatrixType >::getComputeTime | ( | ) | const [virtual] |
Returns the time spent in compute().
| double Ifpack2::Relaxation< MatrixType >::getApplyTime | ( | ) | const [virtual] |
Returns the time spent in apply().
| std::string Ifpack2::Relaxation< MatrixType >::description | ( | ) | const |
Return a simple one-line description of this object.
| void Ifpack2::Relaxation< MatrixType >::describe | ( | Teuchos::FancyOStream & | out, |
| const Teuchos::EVerbosityLevel | verbLevel = Teuchos::Describable::verbLevel_default |
||
| ) | const |
Print the object with some verbosity level to an FancyOStream object.
1.7.4