51 #ifndef IFPACK2_CHEBYSHEV_DECL_HPP 52 #define IFPACK2_CHEBYSHEV_DECL_HPP 59 #include "Ifpack2_Details_Chebyshev.hpp" 66 #include "Tpetra_CrsMatrix_decl.hpp" 68 #include <type_traits> 198 template<
class MatrixType>
201 typename MatrixType::local_ordinal_type,
202 typename MatrixType::global_ordinal_type,
203 typename MatrixType::node_type>,
205 typename MatrixType::local_ordinal_type,
206 typename MatrixType::global_ordinal_type,
207 typename MatrixType::node_type> >
241 static_assert (std::is_same<MatrixType, row_matrix_type>::value,
242 "Ifpack2::Chebyshev: MatrixType must be a Tpetra::RowMatrix " 243 "specialization. Don't use Tpetra::CrsMatrix here.");
246 typedef Tpetra::Map<local_ordinal_type, global_ordinal_type, node_type>
map_type;
439 return IsInitialized_;
551 apply (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
552 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
587 applyMat (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
588 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
652 template <
class NewMatrixType>
friend class Chebyshev;
673 template <
typename NewMatrixType>
686 typedef Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type> MV;
702 applyImpl (
const MV& X,
732 mutable int NumApply_;
734 double InitializeTime_;
741 mutable double ApplyTime_;
743 double ComputeFlops_;
748 mutable double ApplyFlops_;
754 template <
typename MatrixType>
755 template <
typename NewMatrixType>
762 typedef Tpetra::RowMatrix<
typename NewMatrixType::scalar_type,
763 typename NewMatrixType::local_ordinal_type,
764 typename NewMatrixType::global_ordinal_type,
765 typename NewMatrixType::node_type> new_row_matrix_type;
768 RCP<new_prec_type> prec (
new new_prec_type (A_newnode));
769 prec->setParameters (params);
777 #endif // IFPACK2_CHEBYSHEV_DECL_HPP bool isInitialized() const
Definition: Ifpack2_Chebyshev_decl.hpp:438
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:349
Mix-in interface for preconditioners that can change their matrix after construction.
Definition: Ifpack2_Details_CanChangeMatrix.hpp:93
MatrixType::global_ordinal_type global_ordinal_type
The type of global indices in the input MatrixType.
Definition: Ifpack2_Chebyshev_decl.hpp:223
MatrixType::scalar_type scalar_type
The type of the entries of the input MatrixType.
Definition: Ifpack2_Chebyshev_decl.hpp:217
Teuchos::RCP< const map_type > getRangeMap() const
The Tpetra::Map representing the range of this operator.
Definition: Ifpack2_Chebyshev_def.hpp:151
bool isComputed() const
Definition: Ifpack2_Chebyshev_decl.hpp:485
virtual void setMatrix(const Teuchos::RCP< const row_matrix_type > &A)
Change the matrix to be preconditioned.
Definition: Ifpack2_Chebyshev_def.hpp:81
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:254
void setParameters(const Teuchos::ParameterList ¶ms)
Set (or reset) parameters.
Definition: Ifpack2_Chebyshev_def.hpp:93
double getApplyTime() const
The total time spent in all calls to apply().
Definition: Ifpack2_Chebyshev_def.hpp:199
Teuchos::RCP< Chebyshev< Tpetra::RowMatrix< typename NewMatrixType::scalar_type, typename NewMatrixType::local_ordinal_type, typename NewMatrixType::global_ordinal_type, typename NewMatrixType::node_type > > > clone(const Teuchos::RCP< const NewMatrixType > &A_newnode, const Teuchos::ParameterList ¶ms) const
Clone this object to one with a different Node type.
Definition: Ifpack2_Chebyshev_decl.hpp:758
MatrixType::node_type node_type
The Node type used by the input MatrixType.
Definition: Ifpack2_Chebyshev_decl.hpp:229
int getNumCompute() const
The total number of successful calls to compute().
Definition: Ifpack2_Chebyshev_def.hpp:175
MatrixType::node_type::device_type device_type
The Kokkos::Device specialization used by the input MatrixType.
Definition: Ifpack2_Chebyshev_decl.hpp:226
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:219
void compute()
(Re)compute the left scaling, and (if applicable) estimate max and min eigenvalues of D_inv * A...
Definition: Ifpack2_Chebyshev_def.hpp:293
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:127
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:239
MatrixType::scalar_type getLambdaMaxForApply() const
The estimate of the maximum eigenvalue used in the apply().
Definition: Ifpack2_Chebyshev_def.hpp:487
Teuchos::RCP< const row_matrix_type > getMatrix() const
The matrix for which this is a preconditioner.
Definition: Ifpack2_Chebyshev_def.hpp:116
Diagonally scaled Chebyshev iteration for Tpetra sparse matrices.
Definition: Ifpack2_Chebyshev_decl.hpp:199
Interface for all Ifpack2 preconditioners.
Definition: Ifpack2_Preconditioner.hpp:107
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:259
bool hasTransposeApply() const
Whether it's possible to apply the transpose of this operator.
Definition: Ifpack2_Chebyshev_def.hpp:163
void initialize()
Initialize the preconditioner.
Definition: Ifpack2_Chebyshev_def.hpp:278
Tpetra::Map< local_ordinal_type, global_ordinal_type, node_type > map_type
The Tpetra::Map specialization matching MatrixType.
Definition: Ifpack2_Chebyshev_decl.hpp:243
Declaration of interface for preconditioners that can change their matrix after construction.
double getComputeTime() const
The total time spent in all calls to compute().
Definition: Ifpack2_Chebyshev_def.hpp:193
static const EVerbosityLevel verbLevel_default
double getApplyFlops() const
The total number of floating-point operations taken by all calls to apply().
Definition: Ifpack2_Chebyshev_def.hpp:211
int getNumInitialize() const
The total number of successful calls to initialize().
Definition: Ifpack2_Chebyshev_def.hpp:169
MatrixType::local_ordinal_type local_ordinal_type
The type of local indices in the input MatrixType.
Definition: Ifpack2_Chebyshev_decl.hpp:220
std::string description() const
A simple one-line description of this object.
Definition: Ifpack2_Chebyshev_def.hpp:320
Teuchos::ScalarTraits< scalar_type >::magnitudeType magnitude_type
The type of the magnitude (absolute value) of a matrix entry.
Definition: Ifpack2_Chebyshev_decl.hpp:232
Teuchos::RCP< const map_type > getDomainMap() const
The Tpetra::Map representing the domain of this operator.
Definition: Ifpack2_Chebyshev_def.hpp:137
double getInitializeTime() const
The total time spent in all calls to initialize().
Definition: Ifpack2_Chebyshev_def.hpp:187
MatrixType matrix_type
The template parameter of this class.
Definition: Ifpack2_Chebyshev_decl.hpp:214
virtual ~Chebyshev()
Destructor.
Definition: Ifpack2_Chebyshev_def.hpp:76
Preconditioners and smoothers for Tpetra sparse matrices.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:72
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
The communicator over which the matrix is distributed.
Definition: Ifpack2_Chebyshev_def.hpp:102
int getNumApply() const
The total number of successful calls to apply().
Definition: Ifpack2_Chebyshev_def.hpp:181
double getComputeFlops() const
The total number of floating-point operations taken by all calls to compute().
Definition: Ifpack2_Chebyshev_def.hpp:205