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_decl.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 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 Teuchos::ScalarTraits<double>::magnitudeType
108 ilutDefaultDropTolerance<double> () {
115 template <
class MatrixType>
122 DropTolerance_ (ilutDefaultDropTolerance<
scalar_type> ()),
123 InitializeTime_ (0.0),
129 IsInitialized_ (false),
133 template <
class MatrixType>
137 template <
class MatrixType>
141 using Teuchos::Exceptions::InvalidParameterName;
142 using Teuchos::Exceptions::InvalidParameterType;
149 magnitude_type dropTol = ilutDefaultDropTolerance<scalar_type> ();
151 bool gotFillLevel =
false;
154 fillLevel = params.get<
int> (
"fact: ilut level-of-fill");
157 catch (InvalidParameterName&) {
161 catch (InvalidParameterType&) {
167 if (! gotFillLevel) {
170 fillLevel = as<int> (params.get<
magnitude_type> (
"fact: ilut level-of-fill"));
172 catch (InvalidParameterType&) {}
174 if (! gotFillLevel) {
177 fillLevel = as<int> (params.get<
double> (
"fact: ilut level-of-fill"));
179 catch (InvalidParameterType&) {}
183 TEUCHOS_TEST_FOR_EXCEPTION(
184 fillLevel <= 0, std::runtime_error,
185 "Ifpack2::ILUT: The \"fact: ilut level-of-fill\" parameter must be " 186 "strictly greater than zero, but you specified a value of " << fillLevel
187 <<
". Remember that for ILUT, the fill level p means something different " 188 "than it does for ILU(k). ILU(0) produces factors with the same sparsity " 189 "structure as the input matrix A; ILUT with p = 0 always produces a " 190 "diagonal matrix, and is thus probably not what you want.");
193 absThresh = params.get<
magnitude_type> (
"fact: absolute threshold");
195 catch (InvalidParameterType&) {
198 absThresh = as<magnitude_type> (params.get<
double> (
"fact: absolute threshold"));
200 catch (InvalidParameterName&) {
205 relThresh = params.get<
magnitude_type> (
"fact: relative threshold");
207 catch (InvalidParameterType&) {
210 relThresh = as<magnitude_type> (params.get<
double> (
"fact: relative threshold"));
212 catch (InvalidParameterName&) {
219 catch (InvalidParameterType&) {
222 relaxValue = as<magnitude_type> (params.get<
double> (
"fact: relax value"));
224 catch (InvalidParameterName&) {
231 catch (InvalidParameterType&) {
234 dropTol = as<magnitude_type> (params.get<
double> (
"fact: drop tolerance"));
236 catch (InvalidParameterName&) {
249 LevelOfFill_ = fillLevel;
250 if (absThresh != -STM::one ()) {
251 Athresh_ = absThresh;
253 if (relThresh != -STM::one ()) {
254 Rthresh_ = relThresh;
256 if (relaxValue != -STM::one ()) {
257 RelaxValue_ = relaxValue;
259 if (dropTol != -STM::one ()) {
260 DropTolerance_ = dropTol;
265 template <
class MatrixType>
266 Teuchos::RCP<const Teuchos::Comm<int> >
268 TEUCHOS_TEST_FOR_EXCEPTION(
269 A_.is_null (), std::runtime_error,
"Ifpack2::ILUT::getComm: " 270 "The matrix is null. Please call setMatrix() with a nonnull input " 271 "before calling this method.");
272 return A_->getComm ();
276 template <
class MatrixType>
277 Teuchos::RCP<const typename ILUT<MatrixType>::row_matrix_type>
283 template <
class MatrixType>
284 Teuchos::RCP<const typename ILUT<MatrixType>::map_type>
287 TEUCHOS_TEST_FOR_EXCEPTION(
288 A_.is_null (), std::runtime_error,
"Ifpack2::ILUT::getDomainMap: " 289 "The matrix is null. Please call setMatrix() with a nonnull input " 290 "before calling this method.");
291 return A_->getDomainMap ();
295 template <
class MatrixType>
296 Teuchos::RCP<const typename ILUT<MatrixType>::map_type>
299 TEUCHOS_TEST_FOR_EXCEPTION(
300 A_.is_null (), std::runtime_error,
"Ifpack2::ILUT::getRangeMap: " 301 "The matrix is null. Please call setMatrix() with a nonnull input " 302 "before calling this method.");
303 return A_->getRangeMap ();
307 template <
class MatrixType>
313 template <
class MatrixType>
315 return NumInitialize_;
319 template <
class MatrixType>
325 template <
class MatrixType>
331 template <
class MatrixType>
333 return InitializeTime_;
337 template<
class MatrixType>
343 template<
class MatrixType>
349 template<
class MatrixType>
351 return L_->getGlobalNumEntries () + U_->getGlobalNumEntries ();
355 template<
class MatrixType>
357 return L_->getNodeNumEntries () + U_->getNodeNumEntries ();
361 template<
class MatrixType>
364 if (A.getRawPtr () != A_.getRawPtr ()) {
366 TEUCHOS_TEST_FOR_EXCEPTION(
367 ! A.is_null () && A->getComm ()->getSize () == 1 &&
368 A->getNodeNumRows () != A->getNodeNumCols (),
369 std::runtime_error,
"Ifpack2::ILUT::setMatrix: If A's communicator only " 370 "contains one process, then A must be square. Instead, you provided a " 371 "matrix A with " << A->getNodeNumRows () <<
" rows and " 372 << A->getNodeNumCols () <<
" columns.");
378 IsInitialized_ =
false;
380 A_local_ = Teuchos::null;
387 if (! L_solver_.is_null ()) {
388 L_solver_->setMatrix (Teuchos::null);
390 if (! U_solver_.is_null ()) {
391 U_solver_->setMatrix (Teuchos::null);
401 template<
class MatrixType>
404 Teuchos::Time timer (
"ILUT::initialize");
406 Teuchos::TimeMonitor timeMon (timer);
409 TEUCHOS_TEST_FOR_EXCEPTION(
410 A_.is_null (), std::runtime_error,
"Ifpack2::ILUT::initialize: " 411 "The matrix to precondition is null. Please call setMatrix() with a " 412 "nonnull input before calling this method.");
415 IsInitialized_ =
false;
417 A_local_ = Teuchos::null;
421 A_local_ = makeLocalFilter (A_);
423 IsInitialized_ =
true;
426 InitializeTime_ += timer.totalElapsedTime ();
430 template<
typename ScalarType>
431 typename Teuchos::ScalarTraits<ScalarType>::magnitudeType
432 scalar_mag (
const ScalarType& s)
434 return Teuchos::ScalarTraits<ScalarType>::magnitude(s);
438 template<
class MatrixType>
441 using Teuchos::Array;
442 using Teuchos::ArrayRCP;
443 using Teuchos::ArrayView;
446 using Teuchos::reduceAll;
472 if (! isInitialized ()) {
476 Teuchos::Time timer (
"ILUT::compute");
478 Teuchos::TimeMonitor timeMon (timer,
true);
483 L_ = rcp (
new crs_matrix_type (A_local_->getRowMap (), A_local_->getColMap (), 0));
484 U_ = rcp (
new crs_matrix_type (A_local_->getRowMap (), A_local_->getColMap (), 0));
490 Array<ArrayView<const local_ordinal_type> > Uindices (myNumRows);
491 Array<ArrayView<const scalar_type> > Ucoefs (myNumRows);
496 #ifdef IFPACK2_WRITE_FACTORS 497 std::ofstream ofsL(
"L.tif.mtx", std::ios::out);
498 std::ofstream ofsU(
"U.tif.mtx", std::ios::out);
509 double local_nnz =
static_cast<double> (A_local_->getNodeNumEntries ());
512 const double fillLevel = as<double> (getLevelOfFill ());
513 fill = ((fillLevel - 1) * local_nnz) / (2 * myNumRows);
519 double fill_ceil=std::ceil(fill);
523 size_type fillL =
static_cast<size_type
>(fill_ceil);
524 size_type fillU =
static_cast<size_type
>(fill_ceil);
526 Array<scalar_type> InvDiagU (myNumRows, zero);
528 Array<local_ordinal_type> tmp_idx;
529 Array<scalar_type> tmpv;
531 enum { UNUSED, ORIG, FILL };
534 Array<int> pattern(max_col, UNUSED);
535 Array<scalar_type> cur_row(max_col, zero);
536 Array<magnitude_type> unorm(max_col);
538 Array<local_ordinal_type> L_cols_heap;
539 Array<local_ordinal_type> U_cols;
540 Array<local_ordinal_type> L_vals_heap;
541 Array<local_ordinal_type> U_vals_heap;
546 greater_indirect<scalar_type,local_ordinal_type> vals_comp(cur_row);
552 ArrayRCP<local_ordinal_type> ColIndicesARCP;
553 ArrayRCP<scalar_type> ColValuesARCP;
554 if (! A_local_->supportsRowViews ()) {
555 const size_t maxnz = A_local_->getNodeMaxNumRowEntries ();
556 ColIndicesARCP.resize (maxnz);
557 ColValuesARCP.resize (maxnz);
561 ArrayView<const local_ordinal_type> ColIndicesA;
562 ArrayView<const scalar_type> ColValuesA;
565 if (A_local_->supportsRowViews ()) {
566 A_local_->getLocalRowView (row_i, ColIndicesA, ColValuesA);
567 RowNnz = ColIndicesA.size ();
570 A_local_->getLocalRowCopy (row_i, ColIndicesARCP (), ColValuesARCP (), RowNnz);
571 ColIndicesA = ColIndicesARCP (0, RowNnz);
572 ColValuesA = ColValuesARCP (0, RowNnz);
577 U_cols.push_back(row_i);
578 cur_row[row_i] = zero;
579 pattern[row_i] = ORIG;
581 size_type L_cols_heaplen = 0;
582 rownorm = STM::zero ();
583 for (
size_t i = 0; i < RowNnz; ++i) {
584 if (ColIndicesA[i] < myNumRows) {
585 if (ColIndicesA[i] < row_i) {
586 add_to_heap(ColIndicesA[i], L_cols_heap, L_cols_heaplen);
588 else if (ColIndicesA[i] > row_i) {
589 U_cols.push_back(ColIndicesA[i]);
592 cur_row[ColIndicesA[i]] = ColValuesA[i];
593 pattern[ColIndicesA[i]] = ORIG;
594 rownorm += scalar_mag(ColValuesA[i]);
603 cur_row[row_i] = as<scalar_type> (getAbsoluteThreshold() * IFPACK2_SGN(v)) + rthresh*v;
605 size_type orig_U_len = U_cols.size();
606 RowNnz = L_cols_heap.size() + orig_U_len;
607 rownorm = getDropTolerance() * rownorm/RowNnz;
610 size_type L_vals_heaplen = 0;
611 while (L_cols_heaplen > 0) {
614 scalar_type multiplier = cur_row[row_k] * InvDiagU[row_k];
615 cur_row[row_k] = multiplier;
617 if (mag_mult*unorm[row_k] < rownorm) {
618 pattern[row_k] = UNUSED;
622 if (pattern[row_k] != ORIG) {
623 if (L_vals_heaplen < fillL) {
624 add_to_heap(row_k, L_vals_heap, L_vals_heaplen, vals_comp);
626 else if (L_vals_heaplen==0 ||
627 mag_mult < scalar_mag(cur_row[L_vals_heap.front()])) {
628 pattern[row_k] = UNUSED;
633 pattern[L_vals_heap.front()] = UNUSED;
635 add_to_heap(row_k, L_vals_heap, L_vals_heaplen, vals_comp);
641 ArrayView<const local_ordinal_type>& ColIndicesU = Uindices[row_k];
642 ArrayView<const scalar_type>& ColValuesU = Ucoefs[row_k];
643 size_type ColNnzU = ColIndicesU.size();
645 for(size_type j=0; j<ColNnzU; ++j) {
646 if (ColIndicesU[j] > row_k) {
649 if (pattern[col_j] != UNUSED) {
650 cur_row[col_j] -= tmp;
652 else if (scalar_mag(tmp) > rownorm) {
653 cur_row[col_j] = -tmp;
654 pattern[col_j] = FILL;
656 U_cols.push_back(col_j);
672 for (size_type i = 0; i < ColIndicesA.size (); ++i) {
673 if (ColIndicesA[i] < row_i) {
674 tmp_idx.push_back(ColIndicesA[i]);
675 tmpv.push_back(cur_row[ColIndicesA[i]]);
676 pattern[ColIndicesA[i]] = UNUSED;
681 for (size_type j = 0; j < L_vals_heaplen; ++j) {
682 tmp_idx.push_back(L_vals_heap[j]);
683 tmpv.push_back(cur_row[L_vals_heap[j]]);
684 pattern[L_vals_heap[j]] = UNUSED;
692 L_->insertLocalValues (row_i, tmp_idx (), tmpv ());
693 #ifdef IFPACK2_WRITE_FACTORS 694 for (size_type ii = 0; ii < tmp_idx.size (); ++ii) {
695 ofsL << row_i <<
" " << tmp_idx[ii] <<
" " << tmpv[ii] << std::endl;
703 if (cur_row[row_i] == zero) {
704 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;
705 cur_row[row_i] = rownorm;
707 InvDiagU[row_i] = one / cur_row[row_i];
710 tmp_idx.push_back(row_i);
711 tmpv.push_back(cur_row[row_i]);
712 unorm[row_i] = scalar_mag(cur_row[row_i]);
713 pattern[row_i] = UNUSED;
719 size_type U_vals_heaplen = 0;
720 for(size_type j=1; j<U_cols.size(); ++j) {
722 if (pattern[col] != ORIG) {
723 if (U_vals_heaplen < fillU) {
724 add_to_heap(col, U_vals_heap, U_vals_heaplen, vals_comp);
726 else if (U_vals_heaplen!=0 && scalar_mag(cur_row[col]) >
727 scalar_mag(cur_row[U_vals_heap.front()])) {
729 add_to_heap(col, U_vals_heap, U_vals_heaplen, vals_comp);
733 tmp_idx.push_back(col);
734 tmpv.push_back(cur_row[col]);
735 unorm[row_i] += scalar_mag(cur_row[col]);
737 pattern[col] = UNUSED;
740 for(size_type j=0; j<U_vals_heaplen; ++j) {
741 tmp_idx.push_back(U_vals_heap[j]);
742 tmpv.push_back(cur_row[U_vals_heap[j]]);
743 unorm[row_i] += scalar_mag(cur_row[U_vals_heap[j]]);
746 unorm[row_i] /= (orig_U_len + U_vals_heaplen);
748 U_->insertLocalValues(row_i, tmp_idx(), tmpv() );
749 #ifdef IFPACK2_WRITE_FACTORS 750 for(
int ii=0; ii<tmp_idx.size(); ++ii) {
751 ofsU <<row_i<<
" " <<tmp_idx[ii]<<
" " <<tmpv[ii]<< std::endl;
757 U_->getLocalRowView(row_i, Uindices[row_i], Ucoefs[row_i] );
770 L_solver_->initialize ();
771 L_solver_->compute ();
774 U_solver_->initialize ();
775 U_solver_->compute ();
777 ComputeTime_ += timer.totalElapsedTime ();
783 template <
class MatrixType>
785 apply (
const Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& X,
786 Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& Y,
787 Teuchos::ETransp mode,
793 using Teuchos::rcpFromRef;
794 typedef Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type> MV;
796 Teuchos::Time timer (
"ILUT::apply");
798 Teuchos::TimeMonitor timeMon (timer,
true);
800 TEUCHOS_TEST_FOR_EXCEPTION(
801 ! isComputed (), std::runtime_error,
802 "Ifpack2::ILUT::apply: You must call compute() to compute the incomplete " 803 "factorization, before calling apply().");
805 TEUCHOS_TEST_FOR_EXCEPTION(
806 X.getNumVectors() != Y.getNumVectors(), std::runtime_error,
807 "Ifpack2::ILUT::apply: X and Y must have the same number of columns. " 808 "X has " << X.getNumVectors () <<
" columns, but Y has " 809 << Y.getNumVectors () <<
" columns.");
811 if (alpha == Teuchos::ScalarTraits<scalar_type>::zero ()) {
817 if (beta == Teuchos::ScalarTraits<scalar_type>::zero ()) {
828 if (beta == Teuchos::ScalarTraits<scalar_type>::zero ()) {
829 Y_temp = rcpFromRef (Y);
831 Y_temp = rcp (
new MV (Y.getMap (), Y.getNumVectors ()));
837 RCP<const MV> X_temp;
839 auto X_lcl_host = X.template getLocalView<Kokkos::HostSpace> ();
840 auto Y_lcl_host = Y.template getLocalView<Kokkos::HostSpace> ();
841 if (X_lcl_host.ptr_on_device () == Y_lcl_host.ptr_on_device ()) {
842 X_temp = rcp (
new MV (X, Teuchos::Copy));
844 X_temp = rcpFromRef (X);
851 RCP<MV> Y_mid = rcp (
new MV (Y.getMap (), Y.getNumVectors ()));
853 if (mode == Teuchos::NO_TRANS) {
854 L_solver_->apply (*X_temp, *Y_mid, mode);
859 U_solver_->apply (*Y_mid, *Y_temp, mode);
862 U_solver_->apply (*X_temp, *Y_mid, mode);
867 L_solver_->apply (*Y_mid, *Y_temp, mode);
870 if (beta == Teuchos::ScalarTraits<scalar_type>::zero ()) {
873 Y.update (alpha, *Y_temp, beta);
877 ApplyTime_ += timer.totalElapsedTime ();
881 template <
class MatrixType>
884 std::ostringstream os;
889 os <<
"\"Ifpack2::ILUT\": {";
890 os <<
"Initialized: " << (isInitialized () ?
"true" :
"false") <<
", " 891 <<
"Computed: " << (isComputed () ?
"true" :
"false") <<
", ";
893 os <<
"Level-of-fill: " << getLevelOfFill() <<
", " 894 <<
"absolute threshold: " << getAbsoluteThreshold() <<
", " 895 <<
"relative threshold: " << getRelativeThreshold() <<
", " 896 <<
"relaxation value: " << getRelaxValue() <<
", ";
899 os <<
"Matrix: null";
902 os <<
"Global matrix dimensions: [" 903 << A_->getGlobalNumRows () <<
", " << A_->getGlobalNumCols () <<
"]" 904 <<
", Global nnz: " << A_->getGlobalNumEntries();
912 template <
class MatrixType>
916 const Teuchos::EVerbosityLevel verbLevel)
const 919 using Teuchos::OSTab;
921 using Teuchos::TypeNameTraits;
923 using Teuchos::VERB_DEFAULT;
924 using Teuchos::VERB_NONE;
925 using Teuchos::VERB_LOW;
926 using Teuchos::VERB_MEDIUM;
927 using Teuchos::VERB_HIGH;
928 using Teuchos::VERB_EXTREME;
930 const Teuchos::EVerbosityLevel vl =
931 (verbLevel == VERB_DEFAULT) ? VERB_LOW : verbLevel;
934 if (vl > VERB_NONE) {
935 out <<
"\"Ifpack2::ILUT\":" << endl;
937 out <<
"MatrixType: " << TypeNameTraits<MatrixType>::name () << endl;
938 if (this->getObjectLabel () !=
"") {
939 out <<
"Label: \"" << this->getObjectLabel () <<
"\"" << endl;
941 out <<
"Initialized: " << (isInitialized () ?
"true" :
"false")
943 <<
"Computed: " << (isComputed () ?
"true" :
"false")
945 <<
"Level of fill: " << getLevelOfFill () << endl
946 <<
"Absolute threshold: " << getAbsoluteThreshold () << endl
947 <<
"Relative threshold: " << getRelativeThreshold () << endl
948 <<
"Relax value: " << getRelaxValue () << endl;
950 if (isComputed () && vl >= VERB_HIGH) {
951 const double fillFraction =
952 (double) getGlobalNumEntries () / (double) A_->getGlobalNumEntries ();
953 const double nnzToRows =
954 (double) getGlobalNumEntries () / (double) U_->getGlobalNumRows ();
956 out <<
"Dimensions of L: [" << L_->getGlobalNumRows () <<
", " 957 << L_->getGlobalNumRows () <<
"]" << endl
958 <<
"Dimensions of U: [" << U_->getGlobalNumRows () <<
", " 959 << U_->getGlobalNumRows () <<
"]" << endl
960 <<
"Number of nonzeros in factors: " << getGlobalNumEntries () << endl
961 <<
"Fill fraction of factors over A: " << fillFraction << endl
962 <<
"Ratio of nonzeros to rows: " << nnzToRows << endl;
965 out <<
"Number of initialize calls: " << getNumInitialize () << endl
966 <<
"Number of compute calls: " << getNumCompute () << endl
967 <<
"Number of apply calls: " << getNumApply () << endl
968 <<
"Total time in seconds for initialize: " << getInitializeTime () << endl
969 <<
"Total time in seconds for compute: " << getComputeTime () << endl
970 <<
"Total time in seconds for apply: " << getApplyTime () << endl;
972 out <<
"Local matrix:" << endl;
973 A_local_->describe (out, vl);
977 template <
class MatrixType>
978 Teuchos::RCP<const typename ILUT<MatrixType>::row_matrix_type>
981 if (A->getComm ()->getSize () > 1) {
996 #define IFPACK2_ILUT_INSTANT(S,LO,GO,N) \ 997 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:320
ILUT(const Teuchos::RCP< const row_matrix_type > &A)
Constructor.
Definition: Ifpack2_ILUT_def.hpp:116
virtual ~ILUT()
Destructor.
Definition: Ifpack2_ILUT_def.hpp:134
global_size_t getGlobalNumEntries() const
Returns the number of nonzero entries in the global graph.
Definition: Ifpack2_ILUT_def.hpp:350
bool hasTransposeApply() const
Whether this object's apply() method can apply the transpose (or conjugate transpose, if applicable).
Definition: Ifpack2_ILUT_def.hpp:308
size_t getNodeNumEntries() const
Returns the number of nonzero entries in the local graph.
Definition: Ifpack2_ILUT_def.hpp:356
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:402
int getNumApply() const
Returns the number of calls to apply().
Definition: Ifpack2_ILUT_def.hpp:326
int getNumInitialize() const
Returns the number of calls to Initialize().
Definition: Ifpack2_ILUT_def.hpp:314
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:297
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:332
"Preconditioner" that solves local sparse triangular systems.
Definition: Ifpack2_LocalSparseTriangularSolver_decl.hpp:83
Teuchos::RCP< const map_type > getDomainMap() const
Tpetra::Map representing the domain of this operator.
Definition: Ifpack2_ILUT_def.hpp:285
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:439
virtual void setMatrix(const Teuchos::RCP< const row_matrix_type > &A)
Change the matrix to be preconditioned.
Definition: Ifpack2_ILUT_def.hpp:362
Teuchos::RCP< const row_matrix_type > getMatrix() const
Returns a reference to the matrix to be preconditioned.
Definition: Ifpack2_ILUT_def.hpp:278
std::string description() const
Return a simple one-line description of this object.
Definition: Ifpack2_ILUT_def.hpp:882
Definition: Ifpack2_Container.hpp:761
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:915
double getComputeTime() const
Returns the time spent in Compute().
Definition: Ifpack2_ILUT_def.hpp:338
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:267
void add_to_heap(const Ordinal &idx, Teuchos::Array< Ordinal > &heap, SizeType &heap_len)
Definition: Ifpack2_Heap.hpp:70
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:785
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:344
void setParameters(const Teuchos::ParameterList ¶ms)
Set preconditioner parameters.
Definition: Ifpack2_ILUT_def.hpp:138
MatrixType::local_ordinal_type local_ordinal_type
The type of local indices in the input MatrixType.
Definition: Ifpack2_ILUT_decl.hpp:109