46 #ifndef IFPACK2_ILUT_DECL_HPP 47 #define IFPACK2_ILUT_DECL_HPP 51 #include "Tpetra_CrsMatrix_decl.hpp" 52 #include "Ifpack2_LocalSparseTriangularSolver_decl.hpp" 58 #include <type_traits> 90 template<
class MatrixType>
93 typename MatrixType::local_ordinal_type,
94 typename MatrixType::global_ordinal_type,
95 typename MatrixType::node_type>,
97 typename MatrixType::local_ordinal_type,
98 typename MatrixType::global_ordinal_type,
99 typename MatrixType::node_type> >
118 typedef typename Teuchos::ScalarTraits<scalar_type>::magnitudeType
magnitude_type;
121 typedef Tpetra::RowMatrix<scalar_type,
126 static_assert(std::is_same<MatrixType, row_matrix_type>::value,
"Ifpack2::ILUT: 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.");
129 typedef Tpetra::CrsMatrix<scalar_type,
135 typedef Tpetra::Map<local_ordinal_type,
151 explicit ILUT (
const Teuchos::RCP<const row_matrix_type>& A);
188 void setParameters (
const Teuchos::ParameterList& params);
201 return IsInitialized_;
246 setMatrix (
const Teuchos::RCP<const row_matrix_type>& A);
257 apply (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
258 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
259 Teuchos::ETransp mode = Teuchos::NO_TRANS,
260 scalar_type alpha = Teuchos::ScalarTraits<scalar_type>::one(),
261 scalar_type beta = Teuchos::ScalarTraits<scalar_type>::zero())
const;
264 Teuchos::RCP<const map_type> getDomainMap()
const;
267 Teuchos::RCP<const map_type> getRangeMap()
const;
270 bool hasTransposeApply()
const;
277 Teuchos::RCP<const Teuchos::Comm<int> > getComm()
const;
280 Teuchos::RCP<const row_matrix_type> getMatrix ()
const;
283 Teuchos::RCP<const crs_matrix_type>
getL ()
const {
return L_; }
286 Teuchos::RCP<const crs_matrix_type>
getU ()
const {
return U_; }
289 int getNumInitialize()
const;
292 int getNumCompute()
const;
295 int getNumApply()
const;
298 double getInitializeTime()
const;
301 double getComputeTime()
const;
304 double getApplyTime()
const;
307 size_t getNodeSmootherComplexity()
const;
338 return(DropTolerance_);
342 global_size_t getGlobalNumEntries()
const;
345 size_t getNodeNumEntries()
const;
352 std::string description()
const;
355 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default)
const;
360 typedef Teuchos::ScalarTraits<scalar_type> STS;
361 typedef Teuchos::ScalarTraits<magnitude_type> STM;
362 typedef typename Teuchos::Array<local_ordinal_type>::size_type size_type;
380 static Teuchos::RCP<const row_matrix_type>
381 makeLocalFilter (
const Teuchos::RCP<const row_matrix_type>& A);
387 Teuchos::RCP<const row_matrix_type> A_;
389 Teuchos::RCP<const row_matrix_type> A_local_;
391 Teuchos::RCP<crs_matrix_type> L_;
393 Teuchos::RCP<LocalSparseTriangularSolver<row_matrix_type> > L_solver_;
395 Teuchos::RCP<crs_matrix_type> U_;
397 Teuchos::RCP<LocalSparseTriangularSolver<row_matrix_type> > U_solver_;
403 magnitude_type Athresh_;
404 magnitude_type Rthresh_;
405 magnitude_type RelaxValue_;
407 magnitude_type DropTolerance_;
415 double InitializeTime_;
419 mutable double ApplyTime_;
425 mutable int NumApply_;
magnitude_type getRelaxValue() const
Get the relax value.
Definition: Ifpack2_ILUT_decl.hpp:332
Mix-in interface for preconditioners that can change their matrix after construction.
Definition: Ifpack2_Details_CanChangeMatrix.hpp:93
Teuchos::RCP< const crs_matrix_type > getL() const
Returns a reference to the L factor.
Definition: Ifpack2_ILUT_decl.hpp:283
MatrixType::global_ordinal_type global_ordinal_type
The type of global indices in the input MatrixType.
Definition: Ifpack2_ILUT_decl.hpp:112
Teuchos::ScalarTraits< scalar_type >::magnitudeType magnitude_type
The type of the magnitude (absolute value) of a matrix entry.
Definition: Ifpack2_ILUT_decl.hpp:118
magnitude_type getDropTolerance() const
Gets the dropping tolerance.
Definition: Ifpack2_ILUT_decl.hpp:337
magnitude_type getAbsoluteThreshold() const
Get absolute threshold value.
Definition: Ifpack2_ILUT_decl.hpp:322
bool isComputed() const
If compute() is completed, this query returns true, otherwise it returns false.
Definition: Ifpack2_ILUT_decl.hpp:215
ILUT (incomplete LU factorization with threshold) of a Tpetra sparse matrix.
Definition: Ifpack2_ILUT_decl.hpp:91
bool isInitialized() const
Returns true if the preconditioner has been successfully initialized.
Definition: Ifpack2_ILUT_decl.hpp:200
MatrixType::scalar_type scalar_type
The type of the entries of the input MatrixType.
Definition: Ifpack2_ILUT_decl.hpp:106
Interface for all Ifpack2 preconditioners.
Definition: Ifpack2_Preconditioner.hpp:107
Tpetra::Map< local_ordinal_type, global_ordinal_type, node_type > map_type
Type of the Tpetra::Map specialization that this class uses.
Definition: Ifpack2_ILUT_decl.hpp:137
Declaration of interface for preconditioners that can change their matrix after construction.
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_ILUT_decl.hpp:124
magnitude_type getRelativeThreshold() const
Get relative threshold value.
Definition: Ifpack2_ILUT_decl.hpp:327
Definition: Ifpack2_Container.hpp:761
Tpetra::CrsMatrix< scalar_type, local_ordinal_type, global_ordinal_type, node_type > crs_matrix_type
Type of the Tpetra::CrsMatrix specialization that this class uses for the L and U factors...
Definition: Ifpack2_ILUT_decl.hpp:126
Teuchos::RCP< const crs_matrix_type > getU() const
Returns a reference to the U factor.
Definition: Ifpack2_ILUT_decl.hpp:286
Preconditioners and smoothers for Tpetra sparse matrices.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:72
int getLevelOfFill() const
The level of fill.
Definition: Ifpack2_ILUT_decl.hpp:317
MatrixType::node_type node_type
The Node type used by the input MatrixType.
Definition: Ifpack2_ILUT_decl.hpp:115
MatrixType::local_ordinal_type local_ordinal_type
The type of local indices in the input MatrixType.
Definition: Ifpack2_ILUT_decl.hpp:109