43 #ifndef IFPACK2_ILUT_DEF_HPP 44 #define IFPACK2_ILUT_DEF_HPP 47 #if defined (__clang__) && !defined (__INTEL_COMPILER) 48 #pragma clang system_header 51 #include "Ifpack2_Heap.hpp" 52 #include "Ifpack2_LocalFilter.hpp" 53 #include "Ifpack2_LocalSparseTriangularSolver.hpp" 54 #include "Ifpack2_Parameters.hpp" 55 #include "Ifpack2_Details_getParamTryingTypes.hpp" 56 #include "Tpetra_CrsMatrix.hpp" 57 #include "Teuchos_Time.hpp" 58 #include "Teuchos_TypeNameTraits.hpp" 59 #include <type_traits> 89 template<
class ScalarType>
90 inline typename Teuchos::ScalarTraits<ScalarType>::magnitudeType
91 ilutDefaultDropTolerance () {
92 typedef Teuchos::ScalarTraits<ScalarType> STS;
93 typedef typename STS::magnitudeType magnitude_type;
94 typedef Teuchos::ScalarTraits<magnitude_type> STM;
97 const magnitude_type oneHalf = STM::one() / (STM::one() + STM::one());
102 return std::min (static_cast<magnitude_type> (1000) * STS::magnitude (STS::eps ()), oneHalf);
108 inline Teuchos::ScalarTraits<double>::magnitudeType
109 ilutDefaultDropTolerance<double> () {
116 template <
class MatrixType>
123 DropTolerance_ (ilutDefaultDropTolerance<
scalar_type> ()),
124 InitializeTime_ (0.0),
130 IsInitialized_ (false),
136 template<
class MatrixType>
143 template <
class MatrixType>
146 using Details::getParamTryingTypes;
147 const char prefix[] =
"Ifpack2::ILUT: ";
156 double fillLevel = LevelOfFill_;
158 const std::string paramName (
"fact: ilut level-of-fill");
159 getParamTryingTypes<double, double, float>
160 (fillLevel, params, paramName, prefix);
161 TEUCHOS_TEST_FOR_EXCEPTION
162 (fillLevel < 1.0, std::runtime_error,
163 "Ifpack2::ILUT: The \"fact: ilut level-of-fill\" parameter must be >= " 164 "1.0, but you set it to " << fillLevel <<
". For ILUT, the fill level " 165 "means something different than it does for ILU(k). ILU(0) produces " 166 "factors with the same sparsity structure as the input matrix A. For " 167 "ILUT, level-of-fill = 1.0 will produce factors with nonzeros matching " 168 "the sparsity structure of A. level-of-fill > 1.0 allows for additional " 174 const std::string paramName (
"fact: absolute threshold");
175 getParamTryingTypes<magnitude_type, magnitude_type, double>
176 (absThresh, params, paramName, prefix);
181 const std::string paramName (
"fact: relative threshold");
182 getParamTryingTypes<magnitude_type, magnitude_type, double>
183 (relThresh, params, paramName, prefix);
188 const std::string paramName (
"fact: relax value");
189 getParamTryingTypes<magnitude_type, magnitude_type, double>
190 (relaxValue, params, paramName, prefix);
195 const std::string paramName (
"fact: drop tolerance");
196 getParamTryingTypes<magnitude_type, magnitude_type, double>
197 (dropTol, params, paramName, prefix);
201 L_solver_->setParameters(params);
202 U_solver_->setParameters(params);
204 LevelOfFill_ = fillLevel;
205 Athresh_ = absThresh;
206 Rthresh_ = relThresh;
207 RelaxValue_ = relaxValue;
208 DropTolerance_ = dropTol;
212 template <
class MatrixType>
213 Teuchos::RCP<const Teuchos::Comm<int> >
215 TEUCHOS_TEST_FOR_EXCEPTION(
216 A_.is_null (), std::runtime_error,
"Ifpack2::ILUT::getComm: " 217 "The matrix is null. Please call setMatrix() with a nonnull input " 218 "before calling this method.");
219 return A_->getComm ();
223 template <
class MatrixType>
224 Teuchos::RCP<const typename ILUT<MatrixType>::row_matrix_type>
230 template <
class MatrixType>
231 Teuchos::RCP<const typename ILUT<MatrixType>::map_type>
234 TEUCHOS_TEST_FOR_EXCEPTION(
235 A_.is_null (), std::runtime_error,
"Ifpack2::ILUT::getDomainMap: " 236 "The matrix is null. Please call setMatrix() with a nonnull input " 237 "before calling this method.");
238 return A_->getDomainMap ();
242 template <
class MatrixType>
243 Teuchos::RCP<const typename ILUT<MatrixType>::map_type>
246 TEUCHOS_TEST_FOR_EXCEPTION(
247 A_.is_null (), std::runtime_error,
"Ifpack2::ILUT::getRangeMap: " 248 "The matrix is null. Please call setMatrix() with a nonnull input " 249 "before calling this method.");
250 return A_->getRangeMap ();
254 template <
class MatrixType>
260 template <
class MatrixType>
262 return NumInitialize_;
266 template <
class MatrixType>
272 template <
class MatrixType>
278 template <
class MatrixType>
280 return InitializeTime_;
284 template<
class MatrixType>
290 template<
class MatrixType>
296 template<
class MatrixType>
298 TEUCHOS_TEST_FOR_EXCEPTION(
299 A_.is_null (), std::runtime_error,
"Ifpack2::ILUT::getNodeSmootherComplexity: " 300 "The input matrix A is null. Please call setMatrix() with a nonnull " 301 "input matrix, then call compute(), before calling this method.");
303 return A_->getNodeNumEntries() + getNodeNumEntries();
307 template<
class MatrixType>
309 return L_->getGlobalNumEntries () + U_->getGlobalNumEntries ();
313 template<
class MatrixType>
315 return L_->getNodeNumEntries () + U_->getNodeNumEntries ();
319 template<
class MatrixType>
322 if (A.getRawPtr () != A_.getRawPtr ()) {
324 TEUCHOS_TEST_FOR_EXCEPTION(
325 ! A.is_null () && A->getComm ()->getSize () == 1 &&
326 A->getNodeNumRows () != A->getNodeNumCols (),
327 std::runtime_error,
"Ifpack2::ILUT::setMatrix: If A's communicator only " 328 "contains one process, then A must be square. Instead, you provided a " 329 "matrix A with " << A->getNodeNumRows () <<
" rows and " 330 << A->getNodeNumCols () <<
" columns.");
336 IsInitialized_ =
false;
338 A_local_ = Teuchos::null;
345 if (! L_solver_.is_null ()) {
346 L_solver_->setMatrix (Teuchos::null);
348 if (! U_solver_.is_null ()) {
349 U_solver_->setMatrix (Teuchos::null);
359 template<
class MatrixType>
362 Teuchos::Time timer (
"ILUT::initialize");
363 double startTime = timer.wallTime();
365 Teuchos::TimeMonitor timeMon (timer);
368 TEUCHOS_TEST_FOR_EXCEPTION(
369 A_.is_null (), std::runtime_error,
"Ifpack2::ILUT::initialize: " 370 "The matrix to precondition is null. Please call setMatrix() with a " 371 "nonnull input before calling this method.");
374 IsInitialized_ =
false;
376 A_local_ = Teuchos::null;
380 A_local_ = makeLocalFilter (A_);
382 IsInitialized_ =
true;
385 InitializeTime_ += (timer.wallTime() - startTime);
389 template<
typename ScalarType>
390 typename Teuchos::ScalarTraits<ScalarType>::magnitudeType
391 scalar_mag (
const ScalarType& s)
393 return Teuchos::ScalarTraits<ScalarType>::magnitude(s);
397 template<
class MatrixType>
400 using Teuchos::Array;
401 using Teuchos::ArrayRCP;
402 using Teuchos::ArrayView;
405 using Teuchos::reduceAll;
431 if (! isInitialized ()) {
435 Teuchos::Time timer (
"ILUT::compute");
436 double startTime = timer.wallTime();
438 Teuchos::TimeMonitor timeMon (timer,
true);
447 #ifdef IFPACK2_WRITE_FACTORS 448 std::ofstream ofsL(
"L.tif.mtx", std::ios::out);
449 std::ofstream ofsU(
"U.tif.mtx", std::ios::out);
454 double local_nnz =
static_cast<double> (A_local_->getNodeNumEntries ());
455 double fill = ((getLevelOfFill () - 1.0) * local_nnz) / (2 * myNumRows);
460 double fill_ceil=std::ceil(fill);
464 size_type fillL =
static_cast<size_type
>(fill_ceil);
465 size_type fillU =
static_cast<size_type
>(fill_ceil);
467 Array<scalar_type> InvDiagU (myNumRows, zero);
469 Array<Array<local_ordinal_type> > L_tmp_idx(myNumRows);
470 Array<Array<scalar_type> > L_tmpv(myNumRows);
471 Array<Array<local_ordinal_type> > U_tmp_idx(myNumRows);
472 Array<Array<scalar_type> > U_tmpv(myNumRows);
474 enum { UNUSED, ORIG, FILL };
477 Array<int> pattern(max_col, UNUSED);
478 Array<scalar_type> cur_row(max_col, zero);
479 Array<magnitude_type> unorm(max_col);
481 Array<local_ordinal_type> L_cols_heap;
482 Array<local_ordinal_type> U_cols;
483 Array<local_ordinal_type> L_vals_heap;
484 Array<local_ordinal_type> U_vals_heap;
489 greater_indirect<scalar_type,local_ordinal_type> vals_comp(cur_row);
494 nonconst_local_inds_host_view_type ColIndicesARCP;
495 nonconst_values_host_view_type ColValuesARCP;
496 if (! A_local_->supportsRowViews ()) {
497 const size_t maxnz = A_local_->getNodeMaxNumRowEntries ();
498 Kokkos::resize(ColIndicesARCP,maxnz);
499 Kokkos::resize(ColValuesARCP,maxnz);
503 local_inds_host_view_type ColIndicesA;
504 values_host_view_type ColValuesA;
507 if (A_local_->supportsRowViews ()) {
508 A_local_->getLocalRowView (row_i, ColIndicesA, ColValuesA);
509 RowNnz = ColIndicesA.size ();
512 A_local_->getLocalRowCopy (row_i, ColIndicesARCP, ColValuesARCP, RowNnz);
513 ColIndicesA = Kokkos::subview(ColIndicesARCP,std::make_pair((
size_t)0, RowNnz));
514 ColValuesA = Kokkos::subview(ColValuesARCP,std::make_pair((
size_t)0, RowNnz));
519 U_cols.push_back(row_i);
520 cur_row[row_i] = zero;
521 pattern[row_i] = ORIG;
523 size_type L_cols_heaplen = 0;
524 rownorm = STM::zero ();
525 for (
size_t i = 0; i < RowNnz; ++i) {
526 if (ColIndicesA[i] < myNumRows) {
527 if (ColIndicesA[i] < row_i) {
528 add_to_heap(ColIndicesA[i], L_cols_heap, L_cols_heaplen);
530 else if (ColIndicesA[i] > row_i) {
531 U_cols.push_back(ColIndicesA[i]);
534 cur_row[ColIndicesA[i]] = ColValuesA[i];
535 pattern[ColIndicesA[i]] = ORIG;
536 rownorm += scalar_mag(ColValuesA[i]);
545 cur_row[row_i] = as<scalar_type> (getAbsoluteThreshold() * IFPACK2_SGN(v)) + rthresh*v;
547 size_type orig_U_len = U_cols.size();
548 RowNnz = L_cols_heap.size() + orig_U_len;
549 rownorm = getDropTolerance() * rownorm/RowNnz;
552 size_type L_vals_heaplen = 0;
553 while (L_cols_heaplen > 0) {
556 scalar_type multiplier = cur_row[row_k] * InvDiagU[row_k];
557 cur_row[row_k] = multiplier;
559 if (mag_mult*unorm[row_k] < rownorm) {
560 pattern[row_k] = UNUSED;
564 if (pattern[row_k] != ORIG) {
565 if (L_vals_heaplen < fillL) {
566 add_to_heap(row_k, L_vals_heap, L_vals_heaplen, vals_comp);
568 else if (L_vals_heaplen==0 ||
569 mag_mult < scalar_mag(cur_row[L_vals_heap.front()])) {
570 pattern[row_k] = UNUSED;
575 pattern[L_vals_heap.front()] = UNUSED;
577 add_to_heap(row_k, L_vals_heap, L_vals_heaplen, vals_comp);
583 ArrayView<local_ordinal_type> ColIndicesU = U_tmp_idx[row_k]();
584 ArrayView<scalar_type> ColValuesU = U_tmpv[row_k]();
585 size_type ColNnzU = ColIndicesU.size();
587 for(size_type j=0; j<ColNnzU; ++j) {
588 if (ColIndicesU[j] > row_k) {
591 if (pattern[col_j] != UNUSED) {
592 cur_row[col_j] -= tmp;
594 else if (scalar_mag(tmp) > rownorm) {
595 cur_row[col_j] = -tmp;
596 pattern[col_j] = FILL;
598 U_cols.push_back(col_j);
614 for (size_type i = 0; i < (size_type)ColIndicesA.size (); ++i) {
615 if (ColIndicesA[i] < row_i) {
616 L_tmp_idx[row_i].push_back(ColIndicesA[i]);
617 L_tmpv[row_i].push_back(cur_row[ColIndicesA[i]]);
618 pattern[ColIndicesA[i]] = UNUSED;
623 for (size_type j = 0; j < L_vals_heaplen; ++j) {
624 L_tmp_idx[row_i].push_back(L_vals_heap[j]);
625 L_tmpv[row_i].push_back(cur_row[L_vals_heap[j]]);
626 pattern[L_vals_heap[j]] = UNUSED;
634 #ifdef IFPACK2_WRITE_FACTORS 635 for (size_type ii = 0; ii < L_tmp_idx[row_i].size (); ++ii) {
636 ofsL << row_i <<
" " << L_tmp_idx[row_i][ii] <<
" " 637 << L_tmpv[row_i][ii] << std::endl;
643 if (cur_row[row_i] == zero) {
644 std::cerr <<
"Ifpack2::ILUT::Compute: zero pivot encountered! " 645 <<
"Replacing with rownorm and continuing..." 646 <<
"(You may need to set the parameter " 647 <<
"'fact: absolute threshold'.)" << std::endl;
648 cur_row[row_i] = rownorm;
650 InvDiagU[row_i] = one / cur_row[row_i];
653 U_tmp_idx[row_i].push_back(row_i);
654 U_tmpv[row_i].push_back(cur_row[row_i]);
655 unorm[row_i] = scalar_mag(cur_row[row_i]);
656 pattern[row_i] = UNUSED;
662 size_type U_vals_heaplen = 0;
663 for(size_type j=1; j<U_cols.size(); ++j) {
665 if (pattern[col] != ORIG) {
666 if (U_vals_heaplen < fillU) {
667 add_to_heap(col, U_vals_heap, U_vals_heaplen, vals_comp);
669 else if (U_vals_heaplen!=0 && scalar_mag(cur_row[col]) >
670 scalar_mag(cur_row[U_vals_heap.front()])) {
672 add_to_heap(col, U_vals_heap, U_vals_heaplen, vals_comp);
676 U_tmp_idx[row_i].push_back(col);
677 U_tmpv[row_i].push_back(cur_row[col]);
678 unorm[row_i] += scalar_mag(cur_row[col]);
680 pattern[col] = UNUSED;
683 for(size_type j=0; j<U_vals_heaplen; ++j) {
684 U_tmp_idx[row_i].push_back(U_vals_heap[j]);
685 U_tmpv[row_i].push_back(cur_row[U_vals_heap[j]]);
686 unorm[row_i] += scalar_mag(cur_row[U_vals_heap[j]]);
689 unorm[row_i] /= (orig_U_len + U_vals_heaplen);
691 #ifdef IFPACK2_WRITE_FACTORS 692 for(
int ii=0; ii<U_tmp_idx[row_i].size(); ++ii) {
693 ofsU <<row_i<<
" " <<U_tmp_idx[row_i][ii]<<
" " 694 <<U_tmpv[row_i][ii]<< std::endl;
705 Array<size_t> nnzPerRow(myNumRows);
711 L_solver_->setMatrix(Teuchos::null);
712 U_solver_->setMatrix(Teuchos::null);
715 nnzPerRow[row_i] = L_tmp_idx[row_i].size();
718 L_ = rcp (
new crs_matrix_type (A_local_->getRowMap(), A_local_->getColMap(),
719 nnzPerRow(), Tpetra::StaticProfile));
722 L_->insertLocalValues (row_i, L_tmp_idx[row_i](), L_tmpv[row_i]());
728 nnzPerRow[row_i] = U_tmp_idx[row_i].size();
731 U_ = rcp (
new crs_matrix_type (A_local_->getRowMap(), A_local_->getColMap(),
732 nnzPerRow(), Tpetra::StaticProfile));
735 U_->insertLocalValues (row_i, U_tmp_idx[row_i](), U_tmpv[row_i]());
740 L_solver_->setMatrix(L_);
741 L_solver_->initialize ();
742 L_solver_->compute ();
744 U_solver_->setMatrix(U_);
745 U_solver_->initialize ();
746 U_solver_->compute ();
748 ComputeTime_ += (timer.wallTime() - startTime);
754 template <
class MatrixType>
756 apply (
const Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& X,
757 Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& Y,
758 Teuchos::ETransp mode,
764 using Teuchos::rcpFromRef;
765 using STS = Teuchos::ScalarTraits<scalar_type>;
767 TEUCHOS_TEST_FOR_EXCEPTION(
768 ! isComputed (), std::runtime_error,
769 "Ifpack2::ILUT::apply: You must call compute() to compute the incomplete " 770 "factorization, before calling apply().");
772 TEUCHOS_TEST_FOR_EXCEPTION(
773 X.getNumVectors() != Y.getNumVectors(), std::runtime_error,
774 "Ifpack2::ILUT::apply: X and Y must have the same number of columns. " 775 "X has " << X.getNumVectors () <<
" columns, but Y has " 776 << Y.getNumVectors () <<
" columns.");
781 Teuchos::Time timer (
"ILUT::apply");
782 double startTime = timer.wallTime();
784 Teuchos::TimeMonitor timeMon (timer,
true);
786 if (alpha == one && beta == zero) {
787 if (mode == Teuchos::NO_TRANS) {
789 L_solver_->apply (X, Y, mode);
792 U_solver_->apply (Y, Y, mode);
797 U_solver_->apply (X, Y, mode);
800 L_solver_->apply (Y, Y, mode);
814 MV Y_tmp (Y.getMap (), Y.getNumVectors ());
815 apply (X, Y_tmp, mode);
816 Y.update (alpha, Y_tmp, beta);
822 ApplyTime_ += (timer.wallTime() - startTime);
826 template <
class MatrixType>
829 std::ostringstream os;
834 os <<
"\"Ifpack2::ILUT\": {";
835 os <<
"Initialized: " << (isInitialized () ?
"true" :
"false") <<
", " 836 <<
"Computed: " << (isComputed () ?
"true" :
"false") <<
", ";
838 os <<
"Level-of-fill: " << getLevelOfFill() <<
", " 839 <<
"absolute threshold: " << getAbsoluteThreshold() <<
", " 840 <<
"relative threshold: " << getRelativeThreshold() <<
", " 841 <<
"relaxation value: " << getRelaxValue() <<
", ";
844 os <<
"Matrix: null";
847 os <<
"Global matrix dimensions: [" 848 << A_->getGlobalNumRows () <<
", " << A_->getGlobalNumCols () <<
"]" 849 <<
", Global nnz: " << A_->getGlobalNumEntries();
857 template <
class MatrixType>
861 const Teuchos::EVerbosityLevel verbLevel)
const 864 using Teuchos::OSTab;
866 using Teuchos::TypeNameTraits;
868 using Teuchos::VERB_DEFAULT;
869 using Teuchos::VERB_NONE;
870 using Teuchos::VERB_LOW;
871 using Teuchos::VERB_MEDIUM;
872 using Teuchos::VERB_HIGH;
873 using Teuchos::VERB_EXTREME;
875 const Teuchos::EVerbosityLevel vl =
876 (verbLevel == VERB_DEFAULT) ? VERB_LOW : verbLevel;
879 if (vl > VERB_NONE) {
880 out <<
"\"Ifpack2::ILUT\":" << endl;
882 out <<
"MatrixType: " << TypeNameTraits<MatrixType>::name () << endl;
883 if (this->getObjectLabel () !=
"") {
884 out <<
"Label: \"" << this->getObjectLabel () <<
"\"" << endl;
886 out <<
"Initialized: " << (isInitialized () ?
"true" :
"false")
888 <<
"Computed: " << (isComputed () ?
"true" :
"false")
890 <<
"Level of fill: " << getLevelOfFill () << endl
891 <<
"Absolute threshold: " << getAbsoluteThreshold () << endl
892 <<
"Relative threshold: " << getRelativeThreshold () << endl
893 <<
"Relax value: " << getRelaxValue () << endl;
895 if (isComputed () && vl >= VERB_HIGH) {
896 const double fillFraction =
897 (double) getGlobalNumEntries () / (double) A_->getGlobalNumEntries ();
898 const double nnzToRows =
899 (double) getGlobalNumEntries () / (double) U_->getGlobalNumRows ();
901 out <<
"Dimensions of L: [" << L_->getGlobalNumRows () <<
", " 902 << L_->getGlobalNumRows () <<
"]" << endl
903 <<
"Dimensions of U: [" << U_->getGlobalNumRows () <<
", " 904 << U_->getGlobalNumRows () <<
"]" << endl
905 <<
"Number of nonzeros in factors: " << getGlobalNumEntries () << endl
906 <<
"Fill fraction of factors over A: " << fillFraction << endl
907 <<
"Ratio of nonzeros to rows: " << nnzToRows << endl;
910 out <<
"Number of initialize calls: " << getNumInitialize () << endl
911 <<
"Number of compute calls: " << getNumCompute () << endl
912 <<
"Number of apply calls: " << getNumApply () << endl
913 <<
"Total time in seconds for initialize: " << getInitializeTime () << endl
914 <<
"Total time in seconds for compute: " << getComputeTime () << endl
915 <<
"Total time in seconds for apply: " << getApplyTime () << endl;
917 out <<
"Local matrix:" << endl;
918 A_local_->describe (out, vl);
922 template <
class MatrixType>
923 Teuchos::RCP<const typename ILUT<MatrixType>::row_matrix_type>
926 if (A->getComm ()->getSize () > 1) {
941 #define IFPACK2_ILUT_INSTANT(S,LO,GO,N) \ 942 template class Ifpack2::ILUT< Tpetra::RowMatrix<S, LO, GO, N> >; int getNumCompute() const
Returns the number of calls to Compute().
Definition: Ifpack2_ILUT_def.hpp:267
ILUT(const Teuchos::RCP< const row_matrix_type > &A)
Constructor.
Definition: Ifpack2_ILUT_def.hpp:117
global_size_t getGlobalNumEntries() const
Returns the number of nonzero entries in the global graph.
Definition: Ifpack2_ILUT_def.hpp:308
bool hasTransposeApply() const
Whether this object's apply() method can apply the transpose (or conjugate transpose, if applicable).
Definition: Ifpack2_ILUT_def.hpp:255
size_t getNodeNumEntries() const
Returns the number of nonzero entries in the local graph.
Definition: Ifpack2_ILUT_def.hpp:314
Teuchos::ScalarTraits< scalar_type >::magnitudeType magnitude_type
The type of the magnitude (absolute value) of a matrix entry.
Definition: Ifpack2_ILUT_decl.hpp:118
void initialize()
Clear any previously computed factors.
Definition: Ifpack2_ILUT_def.hpp:360
int getNumApply() const
Returns the number of calls to apply().
Definition: Ifpack2_ILUT_def.hpp:273
int getNumInitialize() const
Returns the number of calls to Initialize().
Definition: Ifpack2_ILUT_def.hpp:261
ILUT (incomplete LU factorization with threshold) of a Tpetra sparse matrix.
Definition: Ifpack2_ILUT_decl.hpp:91
Teuchos::RCP< const map_type > getRangeMap() const
Tpetra::Map representing the range of this operator.
Definition: Ifpack2_ILUT_def.hpp:244
void rm_heap_root(Teuchos::Array< Ordinal > &heap, SizeType &heap_len)
Definition: Ifpack2_Heap.hpp:92
double getInitializeTime() const
Returns the time spent in Initialize().
Definition: Ifpack2_ILUT_def.hpp:279
"Preconditioner" that solves local sparse triangular systems.
Definition: Ifpack2_LocalSparseTriangularSolver_decl.hpp:79
Teuchos::RCP< const map_type > getDomainMap() const
Tpetra::Map representing the domain of this operator.
Definition: Ifpack2_ILUT_def.hpp:232
MatrixType::scalar_type scalar_type
The type of the entries of the input MatrixType.
Definition: Ifpack2_ILUT_decl.hpp:106
void compute()
Compute factors L and U using the specified diagonal perturbation thresholds and relaxation parameter...
Definition: Ifpack2_ILUT_def.hpp:398
virtual void setMatrix(const Teuchos::RCP< const row_matrix_type > &A)
Change the matrix to be preconditioned.
Definition: Ifpack2_ILUT_def.hpp:320
Teuchos::RCP< const row_matrix_type > getMatrix() const
Returns a reference to the matrix to be preconditioned.
Definition: Ifpack2_ILUT_def.hpp:225
std::string description() const
Return a simple one-line description of this object.
Definition: Ifpack2_ILUT_def.hpp:827
Definition: Ifpack2_Container_decl.hpp:576
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_ILUT_def.hpp:860
double getComputeTime() const
Returns the time spent in Compute().
Definition: Ifpack2_ILUT_def.hpp:285
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:134
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
Returns the input matrix's communicator.
Definition: Ifpack2_ILUT_def.hpp:214
void add_to_heap(const Ordinal &idx, Teuchos::Array< Ordinal > &heap, SizeType &heap_len)
Definition: Ifpack2_Heap.hpp:70
size_t getNodeSmootherComplexity() const
Get a rough estimate of cost per iteration.
Definition: Ifpack2_ILUT_def.hpp:297
Access only local rows and columns of a sparse matrix.
Definition: Ifpack2_LocalFilter_decl.hpp:160
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 ILUT preconditioner to X, resulting in Y.
Definition: Ifpack2_ILUT_def.hpp:756
Preconditioners and smoothers for Tpetra sparse matrices.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:73
double getApplyTime() const
Returns the time spent in apply().
Definition: Ifpack2_ILUT_def.hpp:291
void setParameters(const Teuchos::ParameterList ¶ms)
Set preconditioner parameters.
Definition: Ifpack2_ILUT_def.hpp:144
MatrixType::local_ordinal_type local_ordinal_type
The type of local indices in the input MatrixType.
Definition: Ifpack2_ILUT_decl.hpp:109