47 #ifndef IFPACK2_HIPTMAIR_DECL_HPP 48 #define IFPACK2_HIPTMAIR_DECL_HPP 51 #include "Tpetra_Map_fwd.hpp" 52 #include <type_traits> 70 template<
class MatrixType>
73 typename MatrixType::local_ordinal_type,
74 typename MatrixType::global_ordinal_type,
75 typename MatrixType::node_type>
94 typedef typename Teuchos::ScalarTraits<scalar_type>::magnitudeType
magnitude_type;
102 static_assert(std::is_same<MatrixType, row_matrix_type>::value,
"Ifpack2::Hiptmair: The template parameter MatrixType must be a Tpetra::RowMatrix specialization. Please don't use Tpetra::CrsMatrix (a subclass of Tpetra::RowMatrix) here anymore. The constructor can take either a RowMatrix or a CrsMatrix just fine.");
115 explicit Hiptmair (
const Teuchos::RCP<const row_matrix_type>& A,
116 const Teuchos::RCP<const row_matrix_type>& PtAP,
117 const Teuchos::RCP<const row_matrix_type>& P);
142 return IsInitialized_;
159 apply (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
160 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
161 Teuchos::ETransp mode = Teuchos::NO_TRANS,
162 scalar_type alpha = Teuchos::ScalarTraits<scalar_type>::one(),
163 scalar_type beta = Teuchos::ScalarTraits<scalar_type>::zero())
const;
166 applyHiptmairSmoother(
const Tpetra::MultiVector<
typename MatrixType::scalar_type,
167 typename MatrixType::local_ordinal_type,
168 typename MatrixType::global_ordinal_type,
169 typename MatrixType::node_type>& X,
170 Tpetra::MultiVector<
typename MatrixType::scalar_type,
171 typename MatrixType::local_ordinal_type,
172 typename MatrixType::global_ordinal_type,
173 typename MatrixType::node_type>& Y)
const;
176 Teuchos::RCP<const Tpetra::Map<local_ordinal_type,global_ordinal_type,node_type> >
getDomainMap()
const;
179 Teuchos::RCP<const Tpetra::Map<local_ordinal_type,global_ordinal_type,node_type> >
getRangeMap()
const;
189 Teuchos::RCP<const Teuchos::Comm<int> >
getComm()
const;
192 Teuchos::RCP<const Tpetra::RowMatrix<scalar_type,local_ordinal_type,global_ordinal_type,node_type> >
getMatrix()
const;
219 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default)
const;
224 typedef Teuchos::ScalarTraits<scalar_type> STS;
225 typedef Teuchos::ScalarTraits<magnitude_type> STM;
237 Teuchos::RCP<const row_matrix_type> A_, PtAP_, P_;
240 std::string precType1_, precType2_, preOrPost_;
243 bool ZeroStartingSolution_;
246 Teuchos::ParameterList precList1_, precList2_;
257 mutable int NumApply_;
259 double InitializeTime_;
263 mutable double ApplyTime_;
265 Teuchos::RCP<prec_type> ifpack2_prec1_, ifpack2_prec2_;
270 #endif // IFPACK2_HIPTMAIR_DECL_HPP void initialize()
Do any initialization that depends on the input matrix's structure.
Definition: Ifpack2_Hiptmair_def.hpp:211
int getNumInitialize() const
Returns the number of calls to Initialize().
Definition: Ifpack2_Hiptmair_def.hpp:175
double getComputeTime() const
Returns the time spent in Compute().
Definition: Ifpack2_Hiptmair_def.hpp:199
MatrixType::local_ordinal_type local_ordinal_type
The type of local indices in the input MatrixType.
Definition: Ifpack2_Hiptmair_decl.hpp:85
double getApplyTime() const
Returns the time spent in apply().
Definition: Ifpack2_Hiptmair_def.hpp:205
MatrixType::scalar_type scalar_type
The type of the entries of the input MatrixType.
Definition: Ifpack2_Hiptmair_decl.hpp:82
bool isComputed() const
Return true if compute() completed successfully, else false.
Definition: Ifpack2_Hiptmair_decl.hpp:149
Teuchos::RCP< const Tpetra::Map< local_ordinal_type, global_ordinal_type, node_type > > getRangeMap() const
Tpetra::Map representing the range of this operator.
Definition: Ifpack2_Hiptmair_def.hpp:156
int getNumCompute() const
Returns the number of calls to Compute().
Definition: Ifpack2_Hiptmair_def.hpp:181
void setParameters(const Teuchos::ParameterList ¶ms)
Set the preconditioner's parameters.
Definition: Ifpack2_Hiptmair_def.hpp:85
Tpetra::RowMatrix< scalar_type, local_ordinal_type, global_ordinal_type, node_type > row_matrix_type
Type of the Tpetra::RowMatrix specialization that this class uses.
Definition: Ifpack2_Hiptmair_decl.hpp:100
Teuchos::RCP< const Tpetra::Map< local_ordinal_type, global_ordinal_type, node_type > > getDomainMap() const
Tpetra::Map representing the domain of this operator.
Definition: Ifpack2_Hiptmair_def.hpp:144
Teuchos::RCP< const Tpetra::RowMatrix< scalar_type, local_ordinal_type, global_ordinal_type, node_type > > getMatrix() const
Returns a reference to the matrix to be preconditioned.
Definition: Ifpack2_Hiptmair_def.hpp:137
Teuchos::ScalarTraits< scalar_type >::magnitudeType magnitude_type
The type of the magnitude (absolute value) of a matrix entry.
Definition: Ifpack2_Hiptmair_decl.hpp:94
MatrixType::global_ordinal_type global_ordinal_type
The type of global indices in the input MatrixType.
Definition: Ifpack2_Hiptmair_decl.hpp:88
Wrapper for Hiptmair smoothers.
Definition: Ifpack2_Hiptmair_decl.hpp:71
bool isInitialized() const
Return true if initialize() completed successfully, else false.
Definition: Ifpack2_Hiptmair_decl.hpp:141
Hiptmair(const Teuchos::RCP< const row_matrix_type > &A, const Teuchos::RCP< const row_matrix_type > &PtAP, const Teuchos::RCP< const row_matrix_type > &P)
Constructor that takes 3 Tpetra matrices.
Definition: Ifpack2_Hiptmair_def.hpp:58
MatrixType::node_type node_type
The Node type used by the input MatrixType.
Definition: Ifpack2_Hiptmair_decl.hpp:91
Interface for all Ifpack2 preconditioners.
Definition: Ifpack2_Preconditioner.hpp:107
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_Hiptmair_def.hpp:425
void compute()
Do any initialization that depends on the input matrix's values.
Definition: Ifpack2_Hiptmair_def.hpp:248
virtual ~Hiptmair()
Destructor.
Definition: Ifpack2_Hiptmair_def.hpp:82
double getInitializeTime() const
Returns the time spent in Initialize().
Definition: Ifpack2_Hiptmair_def.hpp:193
Definition: Ifpack2_Container_decl.hpp:565
std::string description() const
Return a simple one-line description of this object.
Definition: Ifpack2_Hiptmair_def.hpp:395
bool hasTransposeApply() const
Whether this object's apply() method can apply the transpose (or conjugate transpose, if applicable).
Definition: Ifpack2_Hiptmair_def.hpp:167
int getNumApply() const
Returns the number of calls to apply().
Definition: Ifpack2_Hiptmair_def.hpp:187
Ifpack2::Preconditioner< scalar_type, local_ordinal_type, global_ordinal_type, node_type > prec_type
Type of the Ifpack2::Preconditioner specialization from which this class inherits.
Definition: Ifpack2_Hiptmair_decl.hpp:102
Preconditioners and smoothers for Tpetra sparse matrices.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:73
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
Returns the operator's communicator.
Definition: Ifpack2_Hiptmair_def.hpp:126
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_Hiptmair_def.hpp:274