52 #ifndef IFPACK2_ADDITIVESCHWARZ_DECL_HPP
53 #define IFPACK2_ADDITIVESCHWARZ_DECL_HPP
55 #include "Ifpack2_ConfigDefs.hpp"
59 #include "Ifpack2_OverlappingRowMatrix.hpp"
60 #include "Tpetra_Map.hpp"
61 #include "Tpetra_MultiVector.hpp"
62 #include "Tpetra_RowMatrix.hpp"
64 #include <type_traits>
68 template<
class MV,
class OP,
class NormType>
277 template<
class MatrixType,
278 class LocalInverseType =
280 typename MatrixType::local_ordinal_type,
281 typename MatrixType::global_ordinal_type,
282 typename MatrixType::node_type> >
285 typename MatrixType::local_ordinal_type,
286 typename MatrixType::global_ordinal_type,
287 typename MatrixType::node_type>,
289 typename MatrixType::local_ordinal_type,
290 typename MatrixType::global_ordinal_type,
291 typename MatrixType::node_type> >,
293 typename MatrixType::local_ordinal_type,
294 typename MatrixType::global_ordinal_type,
295 typename MatrixType::node_type> >
298 static_assert(std::is_same<LocalInverseType,
300 typename MatrixType::local_ordinal_type,
301 typename MatrixType::global_ordinal_type,
302 typename MatrixType::node_type> >::value,
"Ifpack2::AdditiveSchwarz: You are not allowed to use nondefault values for the LocalInverseType template parameter. Please stop specifying this explicitly. The default template parameter is perfectly fine.");
304 static_assert(std::is_same<MatrixType,
305 Tpetra::RowMatrix<
typename MatrixType::scalar_type,
306 typename MatrixType::local_ordinal_type,
307 typename MatrixType::global_ordinal_type,
308 typename MatrixType::node_type> >::value,
"Ifpack2::AdditiveSchwarz: Please use MatrixType = Tpetra::RowMatrix instead of MatrixType = Tpetra::CrsMatrix. Don't worry, AdditiveSchwarz's constructor can take either type of matrix; it does a dynamic cast if necessary inside. Restricting the set of allowed types here will improve build times and reduce library and executable sizes.");
358 const int overlapLevel);
375 apply (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &X,
376 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &Y,
655 bool supportsZeroStartingSolution() {
return true; }
707 virtual std::ostream&
print(std::ostream& os)
const;
748 void localApply(MV &OverlappingX, MV &OverlappingY)
const;
752 bool hasInnerPrecName ()
const;
756 std::string innerPrecName ()
const;
760 void removeInnerPrecName ();
767 std::pair<Teuchos::ParameterList, bool> innerPrecParams ()
const;
771 void removeInnerPrecParams ();
774 static std::string defaultInnerPrecName ();
793 bool IsInitialized_ =
false;
795 bool IsComputed_ =
false;
797 bool IsOverlapping_ =
false;
799 int OverlapLevel_ = 0;
816 Tpetra::CombineMode CombineMode_ = Tpetra::ZERO;
817 bool AvgOverlap_ =
false;
819 bool UseReordering_ =
false;
821 std::string ReorderingAlgorithm_ =
"none";
823 bool FilterSingletons_ =
false;
827 int NumIterations_ = 1;
829 bool ZeroStartingSolution_ =
true;
834 int NumInitialize_ = 0;
838 mutable int NumApply_ = 0;
840 double InitializeTime_ = 0.0;
842 double ComputeTime_ = 0.0;
844 mutable double ApplyTime_ = 0.0;
846 double InitializeFlops_ = 0.0;
848 double ComputeFlops_ = 0.0;
850 mutable double ApplyFlops_ = 0.0;
856 mutable std::unique_ptr<MV> overlapping_B_;
858 mutable std::unique_ptr<MV> overlapping_Y_;
860 mutable std::unique_ptr<MV> num_overlap_copies_;
862 mutable std::unique_ptr<MV> R_;
864 mutable std::unique_ptr<MV> C_;
877 #endif // IFPACK2_ADDITIVESCHWARZ_DECL_HPP
Tpetra::RowMatrix< scalar_type, local_ordinal_type, global_ordinal_type, node_type > row_matrix_type
The Tpetra::RowMatrix specialization matching MatrixType.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:332
Mix-in interface for preconditioners that can change their matrix after construction.
Definition: Ifpack2_Details_CanChangeMatrix.hpp:93
void setParameterList(const Teuchos::RCP< Teuchos::ParameterList > &plist)
Set the preconditioner's parameters.
Definition: Ifpack2_AdditiveSchwarz_def.hpp:765
virtual void compute()
Computes all (coefficient) data necessary to apply the preconditioner.
Definition: Ifpack2_AdditiveSchwarz_def.hpp:1091
virtual ~AdditiveSchwarz()=default
Destructor.
virtual 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, putting the result in Y.
Definition: Ifpack2_AdditiveSchwarz_def.hpp:316
Tpetra::CrsMatrix< scalar_type, local_ordinal_type, global_ordinal_type, node_type > crs_matrix_type
The Tpetra::CrsMatrix specialization that is a subclass of MatrixType.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:337
Declaration of interface for nested preconditioners.
virtual int getNumApply() const
Returns the number of calls to apply().
Definition: Ifpack2_AdditiveSchwarz_def.hpp:1179
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:69
virtual bool isInitialized() const
Returns true if the preconditioner has been successfully initialized, false otherwise.
Definition: Ifpack2_AdditiveSchwarz_def.hpp:1084
virtual double getInitializeTime() const
Returns the time spent in initialize().
Definition: Ifpack2_AdditiveSchwarz_def.hpp:1186
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.
Definition: Ifpack2_AdditiveSchwarz_def.hpp:1262
virtual Teuchos::RCP< const Tpetra::Map< local_ordinal_type, global_ordinal_type, node_type > > getDomainMap() const
The domain Map of this operator.
Definition: Ifpack2_AdditiveSchwarz_def.hpp:262
Mix-in interface for nested preconditioners.
Definition: Ifpack2_Details_NestedPreconditioner.hpp:97
virtual double getComputeTime() const
Returns the time spent in compute().
Definition: Ifpack2_AdditiveSchwarz_def.hpp:1193
std::string description() const
Return a simple one-line description of this object.
Definition: Ifpack2_AdditiveSchwarz_def.hpp:1207
virtual std::ostream & print(std::ostream &os) const
Prints basic information on iostream. This function is used by operator<<.
Definition: Ifpack2_AdditiveSchwarz_def.hpp:1374
AdditiveSchwarz(const Teuchos::RCP< const row_matrix_type > &A)
Constructor that takes a matrix.
Definition: Ifpack2_AdditiveSchwarz_def.hpp:247
virtual double getApplyTime() const
Returns the time spent in apply().
Definition: Ifpack2_AdditiveSchwarz_def.hpp:1200
typename MatrixType::node_type node_type
The Node type used by the input MatrixType.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:323
virtual void initialize()
Computes all (graph-related) data necessary to initialize the preconditioner.
Definition: Ifpack2_AdditiveSchwarz_def.hpp:1007
typename MatrixType::global_ordinal_type global_ordinal_type
The type of global indices in the input MatrixType.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:320
virtual void setInnerPreconditioner(const Teuchos::RCP< Preconditioner< scalar_type, local_ordinal_type, global_ordinal_type, node_type > > &innerPrec)
Set the inner preconditioner.
Definition: Ifpack2_AdditiveSchwarz_def.hpp:1680
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
Get a list of the preconditioner's default parameters.
Definition: Ifpack2_AdditiveSchwarz_def.hpp:961
Interface for all Ifpack2 preconditioners.
Definition: Ifpack2_Preconditioner.hpp:107
virtual Teuchos::RCP< const row_matrix_type > getMatrix() const
The input matrix.
Definition: Ifpack2_AdditiveSchwarz_def.hpp:287
typename MatrixType::local_ordinal_type local_ordinal_type
The type of local indices in the input MatrixType.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:317
Declaration of interface for preconditioners that can change their matrix after construction.
static const EVerbosityLevel verbLevel_default
typename Teuchos::ScalarTraits< scalar_type >::magnitudeType magnitude_type
The type of the magnitude (absolute value) of a matrix entry.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:327
virtual Teuchos::RCP< const Tpetra::Map< local_ordinal_type, global_ordinal_type, node_type > > getRangeMap() const
The range Map of this operator.
Definition: Ifpack2_AdditiveSchwarz_def.hpp:275
virtual void setParameters(const Teuchos::ParameterList &plist)
Set the preconditioner's parameters.
Definition: Ifpack2_AdditiveSchwarz_def.hpp:752
virtual int getNumCompute() const
Returns the number of calls to compute().
Definition: Ifpack2_AdditiveSchwarz_def.hpp:1172
Additive Schwarz domain decomposition for Tpetra sparse matrices.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:283
virtual bool isComputed() const
Returns true if the preconditioner has been successfully computed, false otherwise.
Definition: Ifpack2_AdditiveSchwarz_def.hpp:1158
virtual void setMatrix(const Teuchos::RCP< const row_matrix_type > &A)
Change the matrix to be preconditioned.
Definition: Ifpack2_AdditiveSchwarz_def.hpp:1751
virtual int getOverlapLevel() const
Returns the level of overlap.
Definition: Ifpack2_AdditiveSchwarz_def.hpp:1384
typename MatrixType::scalar_type scalar_type
The type of the entries of the input MatrixType.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:314
void setZeroStartingSolution(bool zeroStartingSolution)
Set this preconditioner's parameters.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:657
virtual int getNumInitialize() const
Returns the number of calls to initialize().
Definition: Ifpack2_AdditiveSchwarz_def.hpp:1165