47 #ifndef IFPACK2_DATABASESCHWARZ_DECL_HPP
48 #define IFPACK2_DATABASESCHWARZ_DECL_HPP
59 #include "Tpetra_CrsMatrix_decl.hpp"
61 #include <type_traits>
96 template<
class MatrixType>
99 typename MatrixType::local_ordinal_type,
100 typename MatrixType::global_ordinal_type,
101 typename MatrixType::node_type>,
103 typename MatrixType::local_ordinal_type,
104 typename MatrixType::global_ordinal_type,
105 typename MatrixType::node_type> >
139 static_assert (std::is_same<MatrixType, row_matrix_type>::value,
140 "Ifpack2::DatabaseSchwarz: MatrixType must be a Tpetra::RowMatrix "
141 "specialization. Don't use Tpetra::CrsMatrix here.");
144 typedef Tpetra::Map<local_ordinal_type, global_ordinal_type, node_type>
map_type;
191 bool supportsZeroStartingSolution() {
return true; }
206 return IsInitialized_;
233 apply(
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
234 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
250 applyMat(
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
251 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
322 typedef Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type> MV;
345 mutable int NumApply_;
347 double InitializeTime_;
354 mutable double ApplyTime_;
356 double ComputeFlops_;
361 mutable double ApplyFlops_;
367 mutable size_t NumPatches_;
370 double PatchTolerance_;
379 mutable std::vector<std::vector<typename row_matrix_type::local_ordinal_type> > PatchIndices_;
382 mutable size_t DatabaseSize_;
385 mutable std::vector<Teuchos::RCP<typename Teuchos::SerialDenseMatrix<typename row_matrix_type::local_ordinal_type,typename row_matrix_type::scalar_type> > > DatabaseMatrices_;
388 std::vector<int> DatabaseIndices_;
391 std::vector<magnitude_type> Weights_;
401 #endif // IFPACK2_DATABASESCHWARZ_DECL_HPP
Teuchos::RCP< const row_matrix_type > getMatrix() const
The matrix for which this is a preconditioner.
Definition: Ifpack2_DatabaseSchwarz_def.hpp:190
MatrixType::local_ordinal_type local_ordinal_type
The type of local indices in the input MatrixType.
Definition: Ifpack2_DatabaseSchwarz_decl.hpp:118
Mix-in interface for preconditioners that can change their matrix after construction.
Definition: Ifpack2_Details_CanChangeMatrix.hpp:93
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. Y = alpha*Op(A)*X + beta*Y.
Definition: Ifpack2_DatabaseSchwarz_def.hpp:306
Teuchos::RCP< const row_matrix_type > A_
The matrix for which this is a preconditioner.
Definition: Ifpack2_DatabaseSchwarz_decl.hpp:265
Teuchos::RCP< const map_type > getRangeMap() const
The Tpetra::Map representing the range of this operator.
Definition: Ifpack2_DatabaseSchwarz_def.hpp:226
MatrixType::node_type::device_type device_type
The Kokkos::Device specialization used by the input MatrixType.
Definition: Ifpack2_DatabaseSchwarz_decl.hpp:124
double getApplyTime() const
The total time spent in all calls to apply().
Definition: Ifpack2_DatabaseSchwarz_def.hpp:274
size_t getNodeSmootherComplexity() const
Get a rough estimate of cost per iteration.
Definition: Ifpack2_DatabaseSchwarz_def.hpp:291
int getNumApply() const
The total number of successful calls to apply().
Definition: Ifpack2_DatabaseSchwarz_def.hpp:256
void initialize()
Initialize the preconditioner.
Definition: Ifpack2_DatabaseSchwarz_def.hpp:419
bool hasTransposeApply() const
Whether it's possible to apply the transpose of this operator.
Definition: Ifpack2_DatabaseSchwarz_def.hpp:238
double getInitializeTime() const
The total time spent in all calls to initialize().
Definition: Ifpack2_DatabaseSchwarz_def.hpp:262
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_DatabaseSchwarz_def.hpp:651
void setParameters(const Teuchos::ParameterList ¶ms)
Set (or reset) parameters.
Definition: Ifpack2_DatabaseSchwarz_def.hpp:126
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
The communicator over which the matrix is distributed.
Definition: Ifpack2_DatabaseSchwarz_def.hpp:177
Teuchos::RCP< const map_type > getDomainMap() const
The Tpetra::Map representing the domain of this operator.
Definition: Ifpack2_DatabaseSchwarz_def.hpp:212
virtual ~DatabaseSchwarz()
Destructor.
Definition: Ifpack2_DatabaseSchwarz_def.hpp:108
double getComputeTime() const
The total time spent in all calls to compute().
Definition: Ifpack2_DatabaseSchwarz_def.hpp:268
Tpetra::RowMatrix< scalar_type, local_ordinal_type, global_ordinal_type, node_type > row_matrix_type
The Tpetra::RowMatrix specialization matching MatrixType.
Definition: Ifpack2_DatabaseSchwarz_decl.hpp:137
Teuchos::ScalarTraits< scalar_type >::magnitudeType magnitude_type
The type of the magnitude (absolute value) of a matrix entry.
Definition: Ifpack2_DatabaseSchwarz_decl.hpp:130
double getApplyFlops() const
The total number of floating-point operations taken by all calls to apply().
Definition: Ifpack2_DatabaseSchwarz_def.hpp:286
void compute()
(Re)compute the left scaling, and (if applicable) estimate max and min eigenvalues of D_inv * A...
Definition: Ifpack2_DatabaseSchwarz_def.hpp:434
DatabaseSchwarz(const Teuchos::RCP< const row_matrix_type > &A)
Constructor.
Definition: Ifpack2_DatabaseSchwarz_def.hpp:61
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_DatabaseSchwarz_def.hpp:202
MatrixType::node_type node_type
The Node type used by the input MatrixType.
Definition: Ifpack2_DatabaseSchwarz_decl.hpp:127
Tpetra::Vector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > vector_type
The Tpetra::Vector specialization matching MatrixType.
Definition: Ifpack2_DatabaseSchwarz_decl.hpp:152
virtual void setMatrix(const Teuchos::RCP< const row_matrix_type > &A)
Change the matrix to be preconditioned.
Definition: Ifpack2_DatabaseSchwarz_def.hpp:113
void setZeroStartingSolution(bool zeroStartingSolution)
Set this preconditioner's parameters.
Definition: Ifpack2_DatabaseSchwarz_def.hpp:170
Interface for all Ifpack2 preconditioners.
Definition: Ifpack2_Preconditioner.hpp:107
double getComputeFlops() const
The total number of floating-point operations taken by all calls to compute().
Definition: Ifpack2_DatabaseSchwarz_def.hpp:280
std::string description() const
A simple one-line description of this object.
Definition: Ifpack2_DatabaseSchwarz_def.hpp:620
Declaration of interface for preconditioners that can change their matrix after construction.
static const EVerbosityLevel verbLevel_default
int getNumInitialize() const
The total number of successful calls to initialize().
Definition: Ifpack2_DatabaseSchwarz_def.hpp:244
Tpetra::Map< local_ordinal_type, global_ordinal_type, node_type > map_type
The Tpetra::Map specialization matching MatrixType.
Definition: Ifpack2_DatabaseSchwarz_decl.hpp:141
Overlapping Schwarz where redundant patches are not stored explicitly.
Definition: Ifpack2_DatabaseSchwarz_decl.hpp:97
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_DatabaseSchwarz_def.hpp:400
MatrixType::scalar_type scalar_type
The type of the entries of the input MatrixType.
Definition: Ifpack2_DatabaseSchwarz_decl.hpp:115
bool isComputed() const
Whether compute() has been called at least once.
Definition: Ifpack2_DatabaseSchwarz_decl.hpp:214
MatrixType matrix_type
The template parameter of this class.
Definition: Ifpack2_DatabaseSchwarz_decl.hpp:112
MatrixType::global_ordinal_type global_ordinal_type
The type of global indices in the input MatrixType.
Definition: Ifpack2_DatabaseSchwarz_decl.hpp:121
int getNumCompute() const
The total number of successful calls to compute().
Definition: Ifpack2_DatabaseSchwarz_def.hpp:250
bool isInitialized() const
Definition: Ifpack2_DatabaseSchwarz_decl.hpp:205