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

Public Member Functions | |
| BlockRelaxation (const Teuchos::RCP< const Tpetra::RowMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &Matrix) | |
| BlockRelaxation constructor with given Tpetra::RowMatrix input. | |
| virtual | ~BlockRelaxation () |
| BlockRelaxation 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::BlockRelaxation: defines relaxation preconditioners for Tpetra::RowMatrix objects.
The Ifpack2::BlockRelaxation 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
\[ A x = b, \]
where \(A\) is a square, real matrix, and \(x, b\) are two real vectors. We begin with the decomposition
\[ A = D - E - F \]
where \(D\) is the diagonal of A, \(-E\) is the strict lower part, and \(-F\) is the strict upper part. It is assumed that the diagonal entries of \(A\) are different from zero.
Given an starting solution \(x_0\), an iteration of the (damped) Jacobi method can be written in matrix form as follows:
\[ x_{k+1} = \omega D^{-1}(E + F) x_k + D_{-1}b, \]
for \(k < k_{max}\), and \(\omega \) a damping parameter.
Using Ifpack2::Jacobi, the user can apply the specified number of sweeps ( \(k_{max}\)), 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 \(x_0\), an iteration of the (damped) GaussSeidel method can be written in matrix form as follows:
\[ (D - E) x_{k+1} = \omega F x_k + b, \]
for \(k < k_{max}\), and \(\omega \) a damping parameter. Equivalently, the Gauss-Seidel preconditioner can be defined as
\[ P_{GS}^{-1} = (D - E)^{-1}. \]
Clearly, the role of E and F can be interchanged. This is what the "relaxation: backward mode" option is for.
For a list of supported parameters, please refer to the BlockRelaxation::setParameters method.
| Ifpack2::BlockRelaxation< MatrixType, ContainerType >::BlockRelaxation | ( | const Teuchos::RCP< const Tpetra::RowMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > & | Matrix | ) | [explicit] |
BlockRelaxation constructor with given Tpetra::RowMatrix input.
| Ifpack2::BlockRelaxation< MatrixType, ContainerType >::~BlockRelaxation | ( | ) | [virtual] |
BlockRelaxation Destructor.
| void Ifpack2::BlockRelaxation< MatrixType, ContainerType >::setParameters | ( | const Teuchos::ParameterList & | params | ) | [virtual] |
Sets all the parameters for the preconditioner.
Valid parameters include the following:
| void Ifpack2::BlockRelaxation< MatrixType, ContainerType >::initialize | ( | ) | [virtual] |
| bool Ifpack2::BlockRelaxation< MatrixType, ContainerType >::isInitialized | ( | ) | const [inline, virtual] |
Returns true if the preconditioner has been successfully initialized.
| void Ifpack2::BlockRelaxation< MatrixType, ContainerType >::compute | ( | ) | [virtual] |
compute the preconditioner for the specified matrix, diagonal perturbation thresholds and relaxation parameters.
| bool Ifpack2::BlockRelaxation< MatrixType, ContainerType >::isComputed | ( | ) | const [inline, virtual] |
Return true if compute() has been called.
| void Ifpack2::BlockRelaxation< MatrixType, ContainerType >::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::BlockRelaxation< MatrixType, ContainerType >::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::BlockRelaxation< MatrixType, ContainerType >::getRangeMap | ( | ) | const [virtual] |
Returns the Tpetra::Map object associated with the range of this operator.
| void Ifpack2::BlockRelaxation< MatrixType, ContainerType >::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. |
| Teuchos::ScalarTraits< typename MatrixType::scalar_type >::magnitudeType Ifpack2::BlockRelaxation< MatrixType, ContainerType >::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::BlockRelaxation< MatrixType, ContainerType >::getCondEst | ( | ) | const [virtual] |
Returns the computed estimated condition number, or -1.0 if no computed.
| const Teuchos::RCP< const Teuchos::Comm< int > > & Ifpack2::BlockRelaxation< MatrixType, ContainerType >::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::BlockRelaxation< MatrixType, ContainerType >::getMatrix | ( | ) | const [virtual] |
Returns a reference to the matrix to be preconditioned.
| double Ifpack2::BlockRelaxation< MatrixType, ContainerType >::getComputeFlops | ( | ) | const |
Returns the number of flops in the computation phase.
| double Ifpack2::BlockRelaxation< MatrixType, ContainerType >::getApplyFlops | ( | ) | const |
Returns the number of flops for the application of the preconditioner.
| int Ifpack2::BlockRelaxation< MatrixType, ContainerType >::getNumInitialize | ( | ) | const [virtual] |
Returns the number of calls to initialize().
| int Ifpack2::BlockRelaxation< MatrixType, ContainerType >::getNumCompute | ( | ) | const [virtual] |
Returns the number of calls to compute().
| int Ifpack2::BlockRelaxation< MatrixType, ContainerType >::getNumApply | ( | ) | const [virtual] |
Returns the number of calls to apply().
| double Ifpack2::BlockRelaxation< MatrixType, ContainerType >::getInitializeTime | ( | ) | const [virtual] |
Returns the time spent in initialize().
| double Ifpack2::BlockRelaxation< MatrixType, ContainerType >::getComputeTime | ( | ) | const [virtual] |
Returns the time spent in compute().
| double Ifpack2::BlockRelaxation< MatrixType, ContainerType >::getApplyTime | ( | ) | const [virtual] |
Returns the time spent in apply().
| std::string Ifpack2::BlockRelaxation< MatrixType, ContainerType >::description | ( | ) | const |
Return a simple one-line description of this object.
| void Ifpack2::BlockRelaxation< MatrixType, ContainerType >::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.6.1