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 "Tpetra_CrsMatrix.hpp" 56 #include "Teuchos_Time.hpp" 57 #include "Teuchos_TypeNameTraits.hpp" 87 template<
class ScalarType>
88 inline typename Teuchos::ScalarTraits<ScalarType>::magnitudeType
89 ilutDefaultDropTolerance () {
91 typedef Teuchos::ScalarTraits<ScalarType> STS;
92 typedef typename STS::magnitudeType magnitude_type;
93 typedef Teuchos::ScalarTraits<magnitude_type> STM;
96 const magnitude_type oneHalf = STM::one() / (STM::one() + STM::one());
101 return std::min (as<magnitude_type> (1000) * STS::magnitude (STS::eps ()), oneHalf);
107 inline Teuchos::ScalarTraits<double>::magnitudeType
108 ilutDefaultDropTolerance<double> () {
115 template <
class MatrixType>
122 DropTolerance_ (ilutDefaultDropTolerance<
scalar_type> ()),
123 InitializeTime_ (0.0),
129 IsInitialized_ (false),
135 template <
class MatrixType>
139 template<
class MatrixType>
147 template <
class MatrixType>
151 using Teuchos::Exceptions::InvalidParameterName;
152 using Teuchos::Exceptions::InvalidParameterType;
159 magnitude_type dropTol = ilutDefaultDropTolerance<scalar_type> ();
161 bool gotFillLevel =
false;
164 fillLevel = params.get<
int> (
"fact: ilut level-of-fill");
167 catch (InvalidParameterName&) {
171 catch (InvalidParameterType&) {
177 if (! gotFillLevel) {
180 fillLevel = as<int> (params.get<
magnitude_type> (
"fact: ilut level-of-fill"));
182 catch (InvalidParameterType&) {}
184 if (! gotFillLevel) {
187 fillLevel = as<int> (params.get<
double> (
"fact: ilut level-of-fill"));
189 catch (InvalidParameterType&) {}
193 TEUCHOS_TEST_FOR_EXCEPTION(
194 fillLevel <= 0, std::runtime_error,
195 "Ifpack2::ILUT: The \"fact: ilut level-of-fill\" parameter must be " 196 "strictly greater than zero, but you specified a value of " << fillLevel
197 <<
". Remember that for ILUT, the fill level p means something different " 198 "than it does for ILU(k). ILU(0) produces factors with the same sparsity " 199 "structure as the input matrix A; ILUT with p = 0 always produces a " 200 "diagonal matrix, and is thus probably not what you want.");
203 absThresh = params.get<
magnitude_type> (
"fact: absolute threshold");
205 catch (InvalidParameterType&) {
208 absThresh = as<magnitude_type> (params.get<
double> (
"fact: absolute threshold"));
210 catch (InvalidParameterName&) {
215 relThresh = params.get<
magnitude_type> (
"fact: relative threshold");
217 catch (InvalidParameterType&) {
220 relThresh = as<magnitude_type> (params.get<
double> (
"fact: relative threshold"));
222 catch (InvalidParameterName&) {
229 catch (InvalidParameterType&) {
232 relaxValue = as<magnitude_type> (params.get<
double> (
"fact: relax value"));
234 catch (InvalidParameterName&) {
241 catch (InvalidParameterType&) {
244 dropTol = as<magnitude_type> (params.get<
double> (
"fact: drop tolerance"));
246 catch (InvalidParameterName&) {
251 L_solver_->setParameters(params);
252 U_solver_->setParameters(params);
263 LevelOfFill_ = fillLevel;
264 if (absThresh != -STM::one ()) {
265 Athresh_ = absThresh;
267 if (relThresh != -STM::one ()) {
268 Rthresh_ = relThresh;
270 if (relaxValue != -STM::one ()) {
271 RelaxValue_ = relaxValue;
273 if (dropTol != -STM::one ()) {
274 DropTolerance_ = dropTol;
279 template <
class MatrixType>
280 Teuchos::RCP<const Teuchos::Comm<int> >
282 TEUCHOS_TEST_FOR_EXCEPTION(
283 A_.is_null (), std::runtime_error,
"Ifpack2::ILUT::getComm: " 284 "The matrix is null. Please call setMatrix() with a nonnull input " 285 "before calling this method.");
286 return A_->getComm ();
290 template <
class MatrixType>
291 Teuchos::RCP<const typename ILUT<MatrixType>::row_matrix_type>
297 template <
class MatrixType>
298 Teuchos::RCP<const typename ILUT<MatrixType>::map_type>
301 TEUCHOS_TEST_FOR_EXCEPTION(
302 A_.is_null (), std::runtime_error,
"Ifpack2::ILUT::getDomainMap: " 303 "The matrix is null. Please call setMatrix() with a nonnull input " 304 "before calling this method.");
305 return A_->getDomainMap ();
309 template <
class MatrixType>
310 Teuchos::RCP<const typename ILUT<MatrixType>::map_type>
313 TEUCHOS_TEST_FOR_EXCEPTION(
314 A_.is_null (), std::runtime_error,
"Ifpack2::ILUT::getRangeMap: " 315 "The matrix is null. Please call setMatrix() with a nonnull input " 316 "before calling this method.");
317 return A_->getRangeMap ();
321 template <
class MatrixType>
327 template <
class MatrixType>
329 return NumInitialize_;
333 template <
class MatrixType>
339 template <
class MatrixType>
345 template <
class MatrixType>
347 return InitializeTime_;
351 template<
class MatrixType>
357 template<
class MatrixType>
363 template<
class MatrixType>
365 TEUCHOS_TEST_FOR_EXCEPTION(
366 A_.is_null (), std::runtime_error,
"Ifpack2::ILUT::getNodeSmootherComplexity: " 367 "The input matrix A is null. Please call setMatrix() with a nonnull " 368 "input matrix, then call compute(), before calling this method.");
370 return A_->getNodeNumEntries() + getNodeNumEntries();
374 template<
class MatrixType>
376 return L_->getGlobalNumEntries () + U_->getGlobalNumEntries ();
380 template<
class MatrixType>
382 return L_->getNodeNumEntries () + U_->getNodeNumEntries ();
386 template<
class MatrixType>
389 if (A.getRawPtr () != A_.getRawPtr ()) {
391 TEUCHOS_TEST_FOR_EXCEPTION(
392 ! A.is_null () && A->getComm ()->getSize () == 1 &&
393 A->getNodeNumRows () != A->getNodeNumCols (),
394 std::runtime_error,
"Ifpack2::ILUT::setMatrix: If A's communicator only " 395 "contains one process, then A must be square. Instead, you provided a " 396 "matrix A with " << A->getNodeNumRows () <<
" rows and " 397 << A->getNodeNumCols () <<
" columns.");
403 IsInitialized_ =
false;
405 A_local_ = Teuchos::null;
412 if (! L_solver_.is_null ()) {
413 L_solver_->setMatrix (Teuchos::null);
415 if (! U_solver_.is_null ()) {
416 U_solver_->setMatrix (Teuchos::null);
426 template<
class MatrixType>
429 Teuchos::Time timer (
"ILUT::initialize");
431 Teuchos::TimeMonitor timeMon (timer);
434 TEUCHOS_TEST_FOR_EXCEPTION(
435 A_.is_null (), std::runtime_error,
"Ifpack2::ILUT::initialize: " 436 "The matrix to precondition is null. Please call setMatrix() with a " 437 "nonnull input before calling this method.");
440 IsInitialized_ =
false;
442 A_local_ = Teuchos::null;
446 A_local_ = makeLocalFilter (A_);
448 IsInitialized_ =
true;
451 InitializeTime_ += timer.totalElapsedTime ();
455 template<
typename ScalarType>
456 typename Teuchos::ScalarTraits<ScalarType>::magnitudeType
457 scalar_mag (
const ScalarType& s)
459 return Teuchos::ScalarTraits<ScalarType>::magnitude(s);
463 template<
class MatrixType>
466 using Teuchos::Array;
467 using Teuchos::ArrayRCP;
468 using Teuchos::ArrayView;
471 using Teuchos::reduceAll;
497 if (! isInitialized ()) {
501 Teuchos::Time timer (
"ILUT::compute");
503 Teuchos::TimeMonitor timeMon (timer,
true);
508 L_ = rcp (
new crs_matrix_type (A_local_->getRowMap (), A_local_->getColMap (), 0));
509 U_ = rcp (
new crs_matrix_type (A_local_->getRowMap (), A_local_->getColMap (), 0));
515 Array<ArrayView<const local_ordinal_type> > Uindices (myNumRows);
516 Array<ArrayView<const scalar_type> > Ucoefs (myNumRows);
521 #ifdef IFPACK2_WRITE_FACTORS 522 std::ofstream ofsL(
"L.tif.mtx", std::ios::out);
523 std::ofstream ofsU(
"U.tif.mtx", std::ios::out);
534 double local_nnz =
static_cast<double> (A_local_->getNodeNumEntries ());
537 const double fillLevel = as<double> (getLevelOfFill ());
538 fill = ((fillLevel - 1) * local_nnz) / (2 * myNumRows);
544 double fill_ceil=std::ceil(fill);
548 size_type fillL =
static_cast<size_type
>(fill_ceil);
549 size_type fillU =
static_cast<size_type
>(fill_ceil);
551 Array<scalar_type> InvDiagU (myNumRows, zero);
553 Array<local_ordinal_type> tmp_idx;
554 Array<scalar_type> tmpv;
556 enum { UNUSED, ORIG, FILL };
559 Array<int> pattern(max_col, UNUSED);
560 Array<scalar_type> cur_row(max_col, zero);
561 Array<magnitude_type> unorm(max_col);
563 Array<local_ordinal_type> L_cols_heap;
564 Array<local_ordinal_type> U_cols;
565 Array<local_ordinal_type> L_vals_heap;
566 Array<local_ordinal_type> U_vals_heap;
571 greater_indirect<scalar_type,local_ordinal_type> vals_comp(cur_row);
577 ArrayRCP<local_ordinal_type> ColIndicesARCP;
578 ArrayRCP<scalar_type> ColValuesARCP;
579 if (! A_local_->supportsRowViews ()) {
580 const size_t maxnz = A_local_->getNodeMaxNumRowEntries ();
581 ColIndicesARCP.resize (maxnz);
582 ColValuesARCP.resize (maxnz);
586 ArrayView<const local_ordinal_type> ColIndicesA;
587 ArrayView<const scalar_type> ColValuesA;
590 if (A_local_->supportsRowViews ()) {
591 A_local_->getLocalRowView (row_i, ColIndicesA, ColValuesA);
592 RowNnz = ColIndicesA.size ();
595 A_local_->getLocalRowCopy (row_i, ColIndicesARCP (), ColValuesARCP (), RowNnz);
596 ColIndicesA = ColIndicesARCP (0, RowNnz);
597 ColValuesA = ColValuesARCP (0, RowNnz);
602 U_cols.push_back(row_i);
603 cur_row[row_i] = zero;
604 pattern[row_i] = ORIG;
606 size_type L_cols_heaplen = 0;
607 rownorm = STM::zero ();
608 for (
size_t i = 0; i < RowNnz; ++i) {
609 if (ColIndicesA[i] < myNumRows) {
610 if (ColIndicesA[i] < row_i) {
611 add_to_heap(ColIndicesA[i], L_cols_heap, L_cols_heaplen);
613 else if (ColIndicesA[i] > row_i) {
614 U_cols.push_back(ColIndicesA[i]);
617 cur_row[ColIndicesA[i]] = ColValuesA[i];
618 pattern[ColIndicesA[i]] = ORIG;
619 rownorm += scalar_mag(ColValuesA[i]);
628 cur_row[row_i] = as<scalar_type> (getAbsoluteThreshold() * IFPACK2_SGN(v)) + rthresh*v;
630 size_type orig_U_len = U_cols.size();
631 RowNnz = L_cols_heap.size() + orig_U_len;
632 rownorm = getDropTolerance() * rownorm/RowNnz;
635 size_type L_vals_heaplen = 0;
636 while (L_cols_heaplen > 0) {
639 scalar_type multiplier = cur_row[row_k] * InvDiagU[row_k];
640 cur_row[row_k] = multiplier;
642 if (mag_mult*unorm[row_k] < rownorm) {
643 pattern[row_k] = UNUSED;
647 if (pattern[row_k] != ORIG) {
648 if (L_vals_heaplen < fillL) {
649 add_to_heap(row_k, L_vals_heap, L_vals_heaplen, vals_comp);
651 else if (L_vals_heaplen==0 ||
652 mag_mult < scalar_mag(cur_row[L_vals_heap.front()])) {
653 pattern[row_k] = UNUSED;
658 pattern[L_vals_heap.front()] = UNUSED;
660 add_to_heap(row_k, L_vals_heap, L_vals_heaplen, vals_comp);
666 ArrayView<const local_ordinal_type>& ColIndicesU = Uindices[row_k];
667 ArrayView<const scalar_type>& ColValuesU = Ucoefs[row_k];
668 size_type ColNnzU = ColIndicesU.size();
670 for(size_type j=0; j<ColNnzU; ++j) {
671 if (ColIndicesU[j] > row_k) {
674 if (pattern[col_j] != UNUSED) {
675 cur_row[col_j] -= tmp;
677 else if (scalar_mag(tmp) > rownorm) {
678 cur_row[col_j] = -tmp;
679 pattern[col_j] = FILL;
681 U_cols.push_back(col_j);
697 for (size_type i = 0; i < ColIndicesA.size (); ++i) {
698 if (ColIndicesA[i] < row_i) {
699 tmp_idx.push_back(ColIndicesA[i]);
700 tmpv.push_back(cur_row[ColIndicesA[i]]);
701 pattern[ColIndicesA[i]] = UNUSED;
706 for (size_type j = 0; j < L_vals_heaplen; ++j) {
707 tmp_idx.push_back(L_vals_heap[j]);
708 tmpv.push_back(cur_row[L_vals_heap[j]]);
709 pattern[L_vals_heap[j]] = UNUSED;
717 L_->insertLocalValues (row_i, tmp_idx (), tmpv ());
718 #ifdef IFPACK2_WRITE_FACTORS 719 for (size_type ii = 0; ii < tmp_idx.size (); ++ii) {
720 ofsL << row_i <<
" " << tmp_idx[ii] <<
" " << tmpv[ii] << std::endl;
728 if (cur_row[row_i] == zero) {
729 std::cerr <<
"Ifpack2::ILUT::Compute: zero pivot encountered! Replacing with rownorm and continuing...(You may need to set the parameter 'fact: absolute threshold'.)" << std::endl;
730 cur_row[row_i] = rownorm;
732 InvDiagU[row_i] = one / cur_row[row_i];
735 tmp_idx.push_back(row_i);
736 tmpv.push_back(cur_row[row_i]);
737 unorm[row_i] = scalar_mag(cur_row[row_i]);
738 pattern[row_i] = UNUSED;
744 size_type U_vals_heaplen = 0;
745 for(size_type j=1; j<U_cols.size(); ++j) {
747 if (pattern[col] != ORIG) {
748 if (U_vals_heaplen < fillU) {
749 add_to_heap(col, U_vals_heap, U_vals_heaplen, vals_comp);
751 else if (U_vals_heaplen!=0 && scalar_mag(cur_row[col]) >
752 scalar_mag(cur_row[U_vals_heap.front()])) {
754 add_to_heap(col, U_vals_heap, U_vals_heaplen, vals_comp);
758 tmp_idx.push_back(col);
759 tmpv.push_back(cur_row[col]);
760 unorm[row_i] += scalar_mag(cur_row[col]);
762 pattern[col] = UNUSED;
765 for(size_type j=0; j<U_vals_heaplen; ++j) {
766 tmp_idx.push_back(U_vals_heap[j]);
767 tmpv.push_back(cur_row[U_vals_heap[j]]);
768 unorm[row_i] += scalar_mag(cur_row[U_vals_heap[j]]);
771 unorm[row_i] /= (orig_U_len + U_vals_heaplen);
773 U_->insertLocalValues(row_i, tmp_idx(), tmpv() );
774 #ifdef IFPACK2_WRITE_FACTORS 775 for(
int ii=0; ii<tmp_idx.size(); ++ii) {
776 ofsU <<row_i<<
" " <<tmp_idx[ii]<<
" " <<tmpv[ii]<< std::endl;
782 U_->getLocalRowView(row_i, Uindices[row_i], Ucoefs[row_i] );
794 L_solver_->setMatrix(L_);
795 L_solver_->initialize ();
796 L_solver_->compute ();
798 U_solver_->setMatrix(U_);
799 U_solver_->initialize ();
800 U_solver_->compute ();
802 ComputeTime_ += timer.totalElapsedTime ();
808 template <
class MatrixType>
810 apply (
const Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& X,
811 Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& Y,
812 Teuchos::ETransp mode,
818 using Teuchos::rcpFromRef;
819 using STS = Teuchos::ScalarTraits<scalar_type>;
821 TEUCHOS_TEST_FOR_EXCEPTION(
822 ! isComputed (), std::runtime_error,
823 "Ifpack2::ILUT::apply: You must call compute() to compute the incomplete " 824 "factorization, before calling apply().");
826 TEUCHOS_TEST_FOR_EXCEPTION(
827 X.getNumVectors() != Y.getNumVectors(), std::runtime_error,
828 "Ifpack2::ILUT::apply: X and Y must have the same number of columns. " 829 "X has " << X.getNumVectors () <<
" columns, but Y has " 830 << Y.getNumVectors () <<
" columns.");
835 Teuchos::Time timer (
"ILUT::apply");
837 Teuchos::TimeMonitor timeMon (timer,
true);
839 if (alpha == one && beta == zero) {
840 if (mode == Teuchos::NO_TRANS) {
842 L_solver_->apply (X, Y, mode);
845 U_solver_->apply (Y, Y, mode);
850 U_solver_->apply (X, Y, mode);
853 L_solver_->apply (Y, Y, mode);
867 MV Y_tmp (Y.getMap (), Y.getNumVectors ());
868 apply (X, Y_tmp, mode);
869 Y.update (alpha, Y_tmp, beta);
875 ApplyTime_ += timer.totalElapsedTime ();
879 template <
class MatrixType>
882 std::ostringstream os;
887 os <<
"\"Ifpack2::ILUT\": {";
888 os <<
"Initialized: " << (isInitialized () ?
"true" :
"false") <<
", " 889 <<
"Computed: " << (isComputed () ?
"true" :
"false") <<
", ";
891 os <<
"Level-of-fill: " << getLevelOfFill() <<
", " 892 <<
"absolute threshold: " << getAbsoluteThreshold() <<
", " 893 <<
"relative threshold: " << getRelativeThreshold() <<
", " 894 <<
"relaxation value: " << getRelaxValue() <<
", ";
897 os <<
"Matrix: null";
900 os <<
"Global matrix dimensions: [" 901 << A_->getGlobalNumRows () <<
", " << A_->getGlobalNumCols () <<
"]" 902 <<
", Global nnz: " << A_->getGlobalNumEntries();
910 template <
class MatrixType>
914 const Teuchos::EVerbosityLevel verbLevel)
const 917 using Teuchos::OSTab;
919 using Teuchos::TypeNameTraits;
921 using Teuchos::VERB_DEFAULT;
922 using Teuchos::VERB_NONE;
923 using Teuchos::VERB_LOW;
924 using Teuchos::VERB_MEDIUM;
925 using Teuchos::VERB_HIGH;
926 using Teuchos::VERB_EXTREME;
928 const Teuchos::EVerbosityLevel vl =
929 (verbLevel == VERB_DEFAULT) ? VERB_LOW : verbLevel;
932 if (vl > VERB_NONE) {
933 out <<
"\"Ifpack2::ILUT\":" << endl;
935 out <<
"MatrixType: " << TypeNameTraits<MatrixType>::name () << endl;
936 if (this->getObjectLabel () !=
"") {
937 out <<
"Label: \"" << this->getObjectLabel () <<
"\"" << endl;
939 out <<
"Initialized: " << (isInitialized () ?
"true" :
"false")
941 <<
"Computed: " << (isComputed () ?
"true" :
"false")
943 <<
"Level of fill: " << getLevelOfFill () << endl
944 <<
"Absolute threshold: " << getAbsoluteThreshold () << endl
945 <<
"Relative threshold: " << getRelativeThreshold () << endl
946 <<
"Relax value: " << getRelaxValue () << endl;
948 if (isComputed () && vl >= VERB_HIGH) {
949 const double fillFraction =
950 (double) getGlobalNumEntries () / (double) A_->getGlobalNumEntries ();
951 const double nnzToRows =
952 (double) getGlobalNumEntries () / (double) U_->getGlobalNumRows ();
954 out <<
"Dimensions of L: [" << L_->getGlobalNumRows () <<
", " 955 << L_->getGlobalNumRows () <<
"]" << endl
956 <<
"Dimensions of U: [" << U_->getGlobalNumRows () <<
", " 957 << U_->getGlobalNumRows () <<
"]" << endl
958 <<
"Number of nonzeros in factors: " << getGlobalNumEntries () << endl
959 <<
"Fill fraction of factors over A: " << fillFraction << endl
960 <<
"Ratio of nonzeros to rows: " << nnzToRows << endl;
963 out <<
"Number of initialize calls: " << getNumInitialize () << endl
964 <<
"Number of compute calls: " << getNumCompute () << endl
965 <<
"Number of apply calls: " << getNumApply () << endl
966 <<
"Total time in seconds for initialize: " << getInitializeTime () << endl
967 <<
"Total time in seconds for compute: " << getComputeTime () << endl
968 <<
"Total time in seconds for apply: " << getApplyTime () << endl;
970 out <<
"Local matrix:" << endl;
971 A_local_->describe (out, vl);
975 template <
class MatrixType>
976 Teuchos::RCP<const typename ILUT<MatrixType>::row_matrix_type>
979 if (A->getComm ()->getSize () > 1) {
994 #define IFPACK2_ILUT_INSTANT(S,LO,GO,N) \ 995 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:334
ILUT(const Teuchos::RCP< const row_matrix_type > &A)
Constructor.
Definition: Ifpack2_ILUT_def.hpp:116
virtual ~ILUT()
Destructor.
Definition: Ifpack2_ILUT_def.hpp:136
global_size_t getGlobalNumEntries() const
Returns the number of nonzero entries in the global graph.
Definition: Ifpack2_ILUT_def.hpp:375
bool hasTransposeApply() const
Whether this object's apply() method can apply the transpose (or conjugate transpose, if applicable).
Definition: Ifpack2_ILUT_def.hpp:322
size_t getNodeNumEntries() const
Returns the number of nonzero entries in the local graph.
Definition: Ifpack2_ILUT_def.hpp:381
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:427
int getNumApply() const
Returns the number of calls to apply().
Definition: Ifpack2_ILUT_def.hpp:340
int getNumInitialize() const
Returns the number of calls to Initialize().
Definition: Ifpack2_ILUT_def.hpp:328
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:311
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:346
"Preconditioner" that solves local sparse triangular systems.
Definition: Ifpack2_LocalSparseTriangularSolver_decl.hpp:77
Teuchos::RCP< const map_type > getDomainMap() const
Tpetra::Map representing the domain of this operator.
Definition: Ifpack2_ILUT_def.hpp:299
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:464
virtual void setMatrix(const Teuchos::RCP< const row_matrix_type > &A)
Change the matrix to be preconditioned.
Definition: Ifpack2_ILUT_def.hpp:387
Teuchos::RCP< const row_matrix_type > getMatrix() const
Returns a reference to the matrix to be preconditioned.
Definition: Ifpack2_ILUT_def.hpp:292
std::string description() const
Return a simple one-line description of this object.
Definition: Ifpack2_ILUT_def.hpp:880
Definition: Ifpack2_Container.hpp:774
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:913
double getComputeTime() const
Returns the time spent in Compute().
Definition: Ifpack2_ILUT_def.hpp:352
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 Teuchos::Comm< int > > getComm() const
Returns the input matrix's communicator.
Definition: Ifpack2_ILUT_def.hpp:281
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:364
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:810
Preconditioners and smoothers for Tpetra sparse matrices.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:72
double getApplyTime() const
Returns the time spent in apply().
Definition: Ifpack2_ILUT_def.hpp:358
void setParameters(const Teuchos::ParameterList ¶ms)
Set preconditioner parameters.
Definition: Ifpack2_ILUT_def.hpp:148
MatrixType::local_ordinal_type local_ordinal_type
The type of local indices in the input MatrixType.
Definition: Ifpack2_ILUT_decl.hpp:109