17#ifndef IFPACK2_CHEBYSHEV_DECL_HPP
18#define IFPACK2_CHEBYSHEV_DECL_HPP
25#include "Ifpack2_Details_Chebyshev.hpp"
32#include "Tpetra_CrsMatrix_decl.hpp"
164template<
class MatrixType>
167 typename MatrixType::local_ordinal_type,
168 typename MatrixType::global_ordinal_type,
169 typename MatrixType::node_type>,
171 typename MatrixType::local_ordinal_type,
172 typename MatrixType::global_ordinal_type,
173 typename MatrixType::node_type> >
198 typedef typename Teuchos::ScalarTraits<scalar_type>::magnitudeType
magnitude_type;
207 static_assert (std::is_same<MatrixType, row_matrix_type>::value,
208 "Ifpack2::Chebyshev: MatrixType must be a Tpetra::RowMatrix "
209 "specialization. Don't use Tpetra::CrsMatrix here.");
212 typedef Tpetra::Map<local_ordinal_type, global_ordinal_type, node_type>
map_type;
247 explicit Chebyshev (
const Teuchos::RCP<const row_matrix_type>& A);
394 bool supportsZeroStartingSolution() {
return true; }
409 return IsInitialized_;
486 setMatrix (
const Teuchos::RCP<const row_matrix_type>& A);
521 apply (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
522 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
523 Teuchos::ETransp mode = Teuchos::NO_TRANS,
524 scalar_type alpha = Teuchos::ScalarTraits<scalar_type>::one(),
525 scalar_type beta = Teuchos::ScalarTraits<scalar_type>::zero())
const;
557 applyMat (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
558 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
559 Teuchos::ETransp mode = Teuchos::NO_TRANS)
const;
566 Teuchos::RCP<const Teuchos::Comm<int> >
getComm()
const;
569 Teuchos::RCP<const row_matrix_type>
getMatrix()
const;
575 Teuchos::RCP<const Tpetra::CrsMatrix<scalar_type, local_ordinal_type, global_ordinal_type, node_type> >
616 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default)
const;
623 typedef Teuchos::ScalarTraits<typename MatrixType::scalar_type> STS;
626 typedef Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type> MV;
642 applyImpl (
const MV& X,
644 Teuchos::ETransp mode,
674 mutable int NumApply_;
676 double InitializeTime_;
683 mutable double ApplyTime_;
685 double ComputeFlops_;
690 mutable double ApplyFlops_;
Declaration of interface for preconditioners that can change their matrix after construction.
Diagonally scaled Chebyshev iteration for Tpetra sparse matrices.
Definition Ifpack2_Chebyshev_decl.hpp:174
MatrixType::global_ordinal_type global_ordinal_type
The type of global indices in the input MatrixType.
Definition Ifpack2_Chebyshev_decl.hpp:189
double getInitializeTime() const
The total time spent in all calls to initialize().
Definition Ifpack2_Chebyshev_def.hpp:164
void compute()
(Re)compute the left scaling, and (if applicable) estimate max and min eigenvalues of D_inv * A.
Definition Ifpack2_Chebyshev_def.hpp:287
std::string description() const
A simple one-line description of this object.
Definition Ifpack2_Chebyshev_def.hpp:314
Tpetra::Map< local_ordinal_type, global_ordinal_type, node_type > map_type
The Tpetra::Map specialization matching MatrixType.
Definition Ifpack2_Chebyshev_decl.hpp:212
Chebyshev(const Teuchos::RCP< const row_matrix_type > &A)
Constructor.
Definition Ifpack2_Chebyshev_def.hpp:25
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to a Teuchos::FancyOStream.
Definition Ifpack2_Chebyshev_def.hpp:343
Teuchos::RCP< const map_type > getRangeMap() const
The Tpetra::Map representing the range of this operator.
Definition Ifpack2_Chebyshev_def.hpp:128
void applyMat(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) const
Compute Y = Op(A)*X, where Op(A) is either A, , or .
Definition Ifpack2_Chebyshev_def.hpp:253
void initialize()
Initialize the preconditioner.
Definition Ifpack2_Chebyshev_def.hpp:272
Teuchos::RCP< const row_matrix_type > getMatrix() const
The matrix for which this is a preconditioner.
Definition Ifpack2_Chebyshev_def.hpp:93
int getNumApply() const
The total number of successful calls to apply().
Definition Ifpack2_Chebyshev_def.hpp:158
Teuchos::ScalarTraits< scalar_type >::magnitudeType magnitude_type
The type of the magnitude (absolute value) of a matrix entry.
Definition Ifpack2_Chebyshev_decl.hpp:198
MatrixType::node_type::device_type device_type
The Kokkos::Device specialization used by the input MatrixType.
Definition Ifpack2_Chebyshev_decl.hpp:192
MatrixType::local_ordinal_type local_ordinal_type
The type of local indices in the input MatrixType.
Definition Ifpack2_Chebyshev_decl.hpp:186
bool isInitialized() const
Definition Ifpack2_Chebyshev_decl.hpp:408
MatrixType::node_type node_type
The Node type used by the input MatrixType.
Definition Ifpack2_Chebyshev_decl.hpp:195
size_t getNodeSmootherComplexity() const
Get a rough estimate of cost per iteration.
Definition Ifpack2_Chebyshev_def.hpp:193
Tpetra::Vector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > vector_type
The Tpetra::Vector specialization matching MatrixType.
Definition Ifpack2_Chebyshev_decl.hpp:220
MatrixType::scalar_type scalar_type
The type of the entries of the input MatrixType.
Definition Ifpack2_Chebyshev_decl.hpp:183
virtual void setMatrix(const Teuchos::RCP< const row_matrix_type > &A)
Change the matrix to be preconditioned.
Definition Ifpack2_Chebyshev_def.hpp:49
Tpetra::RowMatrix< scalar_type, local_ordinal_type, global_ordinal_type, node_type > row_matrix_type
The Tpetra::RowMatrix specialization matching MatrixType.
Definition Ifpack2_Chebyshev_decl.hpp:205
bool isComputed() const
Definition Ifpack2_Chebyshev_decl.hpp:455
int getNumCompute() const
The total number of successful calls to compute().
Definition Ifpack2_Chebyshev_def.hpp:152
void setParameters(const Teuchos::ParameterList ¶ms)
Set (or reset) parameters.
Definition Ifpack2_Chebyshev_def.hpp:61
double getComputeFlops() const
The total number of floating-point operations taken by all calls to compute().
Definition Ifpack2_Chebyshev_def.hpp:182
double getComputeTime() const
The total time spent in all calls to compute().
Definition Ifpack2_Chebyshev_def.hpp:170
Teuchos::RCP< const Tpetra::CrsMatrix< scalar_type, local_ordinal_type, global_ordinal_type, node_type > > getCrsMatrix() const
Attempt to return the matrix A as a Tpetra::CrsMatrix.
Definition Ifpack2_Chebyshev_def.hpp:104
void setZeroStartingSolution(bool zeroStartingSolution)
Set this preconditioner's parameters.
Definition Ifpack2_Chebyshev_def.hpp:72
Teuchos::RCP< const map_type > getDomainMap() const
The Tpetra::Map representing the domain of this operator.
Definition Ifpack2_Chebyshev_def.hpp:114
int getNumInitialize() const
The total number of successful calls to initialize().
Definition Ifpack2_Chebyshev_def.hpp:146
virtual ~Chebyshev()
Destructor.
Definition Ifpack2_Chebyshev_def.hpp:44
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
The communicator over which the matrix is distributed.
Definition Ifpack2_Chebyshev_def.hpp:79
double getApplyFlops() const
The total number of floating-point operations taken by all calls to apply().
Definition Ifpack2_Chebyshev_def.hpp:188
MatrixType matrix_type
The template parameter of this class.
Definition Ifpack2_Chebyshev_decl.hpp:180
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
Apply the preconditioner to X, returning the result in Y.
Definition Ifpack2_Chebyshev_def.hpp:208
MatrixType::scalar_type getLambdaMaxForApply() const
The estimate of the maximum eigenvalue used in the apply().
Definition Ifpack2_Chebyshev_def.hpp:477
bool hasTransposeApply() const
Whether it's possible to apply the transpose of this operator.
Definition Ifpack2_Chebyshev_def.hpp:140
double getApplyTime() const
The total time spent in all calls to apply().
Definition Ifpack2_Chebyshev_def.hpp:176
Mix-in interface for preconditioners that can change their matrix after construction.
Definition Ifpack2_Details_CanChangeMatrix.hpp:60
Left-scaled Chebyshev iteration.
Definition Ifpack2_Details_Chebyshev_decl.hpp:75
Interface for all Ifpack2 preconditioners.
Definition Ifpack2_Preconditioner.hpp:75
Preconditioners and smoothers for Tpetra sparse matrices.
Definition Ifpack2_AdditiveSchwarz_decl.hpp:41