43 #ifndef IFPACK2_CRSRILUK_DEF_HPP 44 #define IFPACK2_CRSRILUK_DEF_HPP 46 #include "Ifpack2_LocalFilter.hpp" 47 #include "Tpetra_CrsMatrix.hpp" 51 template<
class MatrixType>
56 isInitialized_ (false),
61 initializeTime_ (0.0),
70 template<
class MatrixType>
75 isInitialized_ (false),
80 initializeTime_ (0.0),
89 template<
class MatrixType>
93 template<
class MatrixType>
101 if (A.getRawPtr () !=
A_.getRawPtr ()) {
102 isAllocated_ =
false;
103 isInitialized_ =
false;
116 template<
class MatrixType>
120 TEUCHOS_TEST_FOR_EXCEPTION(
121 L_.is_null (), std::runtime_error,
"Ifpack2::RILUK::getL: The L factor " 122 "is null. Please call initialize() (and preferably also compute()) " 123 "before calling this method. If the input matrix has not yet been set, " 124 "you must first call setMatrix() with a nonnull input matrix before you " 125 "may call initialize() or compute().");
130 template<
class MatrixType>
131 const Tpetra::Vector<typename RILUK<MatrixType>::scalar_type,
137 TEUCHOS_TEST_FOR_EXCEPTION(
138 D_.is_null (), std::runtime_error,
"Ifpack2::RILUK::getD: The D factor " 139 "(of diagonal entries) is null. Please call initialize() (and " 140 "preferably also compute()) before calling this method. If the input " 141 "matrix has not yet been set, you must first call setMatrix() with a " 142 "nonnull input matrix before you may call initialize() or compute().");
147 template<
class MatrixType>
151 TEUCHOS_TEST_FOR_EXCEPTION(
152 U_.is_null (), std::runtime_error,
"Ifpack2::RILUK::getU: The U factor " 153 "is null. Please call initialize() (and preferably also compute()) " 154 "before calling this method. If the input matrix has not yet been set, " 155 "you must first call setMatrix() with a nonnull input matrix before you " 156 "may call initialize() or compute().");
161 template<
class MatrixType>
162 Teuchos::RCP<const Tpetra::Map<typename RILUK<MatrixType>::local_ordinal_type,
163 typename RILUK<MatrixType>::global_ordinal_type,
166 TEUCHOS_TEST_FOR_EXCEPTION(
167 A_.is_null (), std::runtime_error,
"Ifpack2::RILUK::getDomainMap: " 168 "The matrix is null. Please call setMatrix() with a nonnull input " 169 "before calling this method.");
172 TEUCHOS_TEST_FOR_EXCEPTION(
173 Graph_.is_null (), std::runtime_error,
"Ifpack2::RILUK::getDomainMap: " 174 "The computed graph is null. Please call initialize() before calling " 176 return Graph_->getL_Graph ()->getDomainMap ();
180 template<
class MatrixType>
181 Teuchos::RCP<const Tpetra::Map<typename RILUK<MatrixType>::local_ordinal_type,
182 typename RILUK<MatrixType>::global_ordinal_type,
185 TEUCHOS_TEST_FOR_EXCEPTION(
186 A_.is_null (), std::runtime_error,
"Ifpack2::RILUK::getRangeMap: " 187 "The matrix is null. Please call setMatrix() with a nonnull input " 188 "before calling this method.");
191 TEUCHOS_TEST_FOR_EXCEPTION(
192 Graph_.is_null (), std::runtime_error,
"Ifpack2::RILUK::getRangeMap: " 193 "The computed graph is null. Please call initialize() before calling " 195 return Graph_->getL_Graph ()->getRangeMap ();
199 template<
class MatrixType>
205 if (! isAllocated_) {
216 L_->setAllToScalar (STS::zero ());
217 U_->setAllToScalar (STS::zero ());
222 D_ = rcp (
new vec_type (
Graph_->getL_Graph ()->getRowMap ()));
228 template<
class MatrixType>
234 using Teuchos::Exceptions::InvalidParameterName;
235 using Teuchos::Exceptions::InvalidParameterType;
251 bool gotFillLevel =
false;
253 fillLevel = params.get<
int> (
"fact: iluk level-of-fill");
256 catch (InvalidParameterType&) {
261 catch (InvalidParameterName&) {
265 if (! gotFillLevel) {
271 catch (InvalidParameterType&) {
277 if (! gotFillLevel) {
281 fillLevel = as<int> (params.get<
magnitude_type> (
"fact: iluk level-of-fill"));
284 catch (InvalidParameterType&) {
290 if (! gotFillLevel) {
294 fillLevel = as<int> (params.get<
double> (
"fact: iluk level-of-fill"));
297 catch (InvalidParameterType& e) {
307 TEUCHOS_TEST_FOR_EXCEPTION(
310 "Ifpack2::RILUK::setParameters: We should never get here! " 311 "The method should either have read the \"fact: iluk level-of-fill\" " 312 "parameter by this point, or have thrown an exception. " 313 "Please let the Ifpack2 developers know about this bug.");
321 absThresh = params.get<
magnitude_type> (
"fact: absolute threshold");
323 catch (InvalidParameterType&) {
326 absThresh = as<magnitude_type> (params.get<
double> (
"fact: absolute threshold"));
328 catch (InvalidParameterName&) {
333 relThresh = params.get<
magnitude_type> (
"fact: relative threshold");
335 catch (InvalidParameterType&) {
338 relThresh = as<magnitude_type> (params.get<
double> (
"fact: relative threshold"));
340 catch (InvalidParameterName&) {
347 catch (InvalidParameterType&) {
350 relaxValue = as<magnitude_type> (params.get<
double> (
"fact: relax value"));
352 catch (InvalidParameterName&) {
360 LevelOfFill_ = fillLevel;
367 if (absThresh != -STM::one ()) {
368 Athresh_ = absThresh;
370 if (relThresh != -STM::one ()) {
371 Rthresh_ = relThresh;
373 if (relaxValue != -STM::one ()) {
374 RelaxValue_ = relaxValue;
379 template<
class MatrixType>
380 Teuchos::RCP<const typename RILUK<MatrixType>::row_matrix_type>
386 template<
class MatrixType>
387 Teuchos::RCP<const typename RILUK<MatrixType>::crs_matrix_type>
393 template<
class MatrixType>
394 Teuchos::RCP<const typename RILUK<MatrixType>::row_matrix_type>
399 using Teuchos::rcp_dynamic_cast;
400 using Teuchos::rcp_implicit_cast;
405 if (A->getRowMap ()->getComm ()->getSize () == 1 ||
406 A->getRowMap ()->isSameAs (* (A->getColMap ()))) {
413 RCP<const LocalFilter<row_matrix_type> > A_lf_r =
415 if (! A_lf_r.is_null ()) {
427 template<
class MatrixType>
432 using Teuchos::rcp_const_cast;
433 using Teuchos::rcp_dynamic_cast;
434 using Teuchos::rcp_implicit_cast;
438 const char prefix[] =
"Ifpack2::RILUK::initialize: ";
440 TEUCHOS_TEST_FOR_EXCEPTION
441 (
A_.is_null (), std::runtime_error, prefix <<
"The matrix is null. Please " 442 "call setMatrix() with a nonnull input before calling this method.");
443 TEUCHOS_TEST_FOR_EXCEPTION
444 (!
A_->isFillComplete (), std::runtime_error, prefix <<
"The matrix is not " 445 "fill complete. You may not invoke initialize() or compute() with this " 446 "matrix until the matrix is fill complete. If your matrix is a " 447 "Tpetra::CrsMatrix, please call fillComplete on it (with the domain and " 448 "range Maps, if appropriate) before calling this method.");
450 Teuchos::Time timer (
"RILUK::initialize");
452 Teuchos::TimeMonitor timeMon (timer);
461 isInitialized_ =
false;
462 isAllocated_ =
false;
466 RCP<const row_matrix_type> A_local = makeLocalFilter (
A_);
467 TEUCHOS_TEST_FOR_EXCEPTION(
468 A_local.is_null (), std::logic_error,
"Ifpack2::RILUK::initialize: " 469 "makeLocalFilter returned null; it failed to compute A_local. " 470 "Please report this bug to the Ifpack2 developers.");
478 RCP<const crs_matrix_type> A_local_crs =
480 if (A_local_crs.is_null ()) {
485 RCP<crs_matrix_type> A_local_crs_nc =
487 A_local->getColMap (), 0));
496 import_type
import (A_local->getRowMap (), A_local->getRowMap ());
497 A_local_crs_nc->doImport (*A_local,
import, Tpetra::REPLACE);
498 A_local_crs_nc->fillComplete (A_local->getDomainMap (), A_local->getRangeMap ());
511 isInitialized_ =
true;
513 initializeTime_ += timer.totalElapsedTime ();
517 template<
class MatrixType>
522 using Teuchos::ArrayRCP;
526 using Teuchos::REDUCE_SUM;
527 using Teuchos::reduceAll;
528 typedef Tpetra::Map<local_ordinal_type,global_ordinal_type,node_type> map_type;
530 size_t NumIn = 0, NumL = 0, NumU = 0;
531 bool DiagFound =
false;
532 size_t NumNonzeroDiags = 0;
533 size_t MaxNumEntries = A.getGlobalMaxNumRowEntries();
538 Teuchos::ArrayView<const global_ordinal_type> rowGIDs = A.getRowMap()->getNodeElementList();
539 Teuchos::ArrayView<const global_ordinal_type> colGIDs = A.getColMap()->getNodeElementList();
540 bool gidsAreConsistentlyOrdered=
true;
543 if (rowGIDs[i] != colGIDs[i]) {
544 gidsAreConsistentlyOrdered=
false;
545 indexOfInconsistentGID=i;
549 TEUCHOS_TEST_FOR_EXCEPTION(gidsAreConsistentlyOrdered==
false, std::runtime_error,
550 "The ordering of the local GIDs in the row and column maps is not the same" 551 << std::endl <<
"at index " << indexOfInconsistentGID
552 <<
". Consistency is required, as all calculations are done with" 553 << std::endl <<
"local indexing.");
557 Teuchos::Array<local_ordinal_type> InI(MaxNumEntries);
558 Teuchos::Array<local_ordinal_type> LI(MaxNumEntries);
559 Teuchos::Array<local_ordinal_type> UI(MaxNumEntries);
560 Teuchos::Array<scalar_type> InV(MaxNumEntries);
561 Teuchos::Array<scalar_type> LV(MaxNumEntries);
562 Teuchos::Array<scalar_type> UV(MaxNumEntries);
565 const bool ReplaceValues =
L_->isStaticGraph () ||
L_->isLocallyIndexed ();
570 L_->setAllToScalar (STS::zero ());
571 U_->setAllToScalar (STS::zero ());
574 D_->putScalar (STS::zero ());
575 ArrayRCP<scalar_type> DV =
D_->get1dViewNonConst ();
577 RCP<const map_type> rowMap =
L_->getRowMap ();
587 Teuchos::ArrayView<const global_ordinal_type> nodeGIDs = rowMap->getNodeElementList();
588 for (
size_t myRow=0; myRow<A.getNodeNumRows(); ++myRow) {
593 A.getLocalRowCopy (local_row, InI(), InV(), NumIn);
601 for (
size_t j = 0; j < NumIn; ++j) {
604 if (k == local_row) {
607 DV[local_row] += Rthresh_ * InV[j] + IFPACK2_SGN(InV[j]) * Athresh_;
610 TEUCHOS_TEST_FOR_EXCEPTION(
611 true, std::runtime_error,
"Ifpack2::RILUK::initAllValues: current " 612 "GID k = " << k <<
" < 0. I'm not sure why this is an error; it is " 613 "probably an artifact of the undocumented assumptions of the " 614 "original implementation (likely copied and pasted from Ifpack). " 615 "Nevertheless, the code I found here insisted on this being an error " 616 "state, so I will throw an exception here.");
618 else if (k < local_row) {
623 else if (Teuchos::as<size_t>(k) <= rowMap->getNodeNumElements()) {
635 DV[local_row] = Athresh_;
640 L_->replaceLocalValues(local_row, LI(0, NumL), LV(0,NumL));
644 L_->insertLocalValues(local_row, LI(0,NumL), LV(0,NumL));
650 U_->replaceLocalValues(local_row, UI(0,NumU), UV(0,NumU));
654 U_->insertLocalValues(local_row, UI(0,NumU), UV(0,NumU));
670 isInitialized_ =
true;
674 template<
class MatrixType>
677 const char prefix[] =
"Ifpack2::RILUK::compute: ";
682 TEUCHOS_TEST_FOR_EXCEPTION
683 (
A_.is_null (), std::runtime_error, prefix <<
"The matrix is null. Please " 684 "call setMatrix() with a nonnull input before calling this method.");
685 TEUCHOS_TEST_FOR_EXCEPTION
686 (!
A_->isFillComplete (), std::runtime_error, prefix <<
"The matrix is not " 687 "fill complete. You may not invoke initialize() or compute() with this " 688 "matrix until the matrix is fill complete. If your matrix is a " 689 "Tpetra::CrsMatrix, please call fillComplete on it (with the domain and " 690 "range Maps, if appropriate) before calling this method.");
696 Teuchos::Time timer (
"RILUK::compute");
707 const scalar_type MaxDiagonalValue = STS::one () / MinDiagonalValue;
709 size_t NumIn, NumL, NumU;
712 const size_t MaxNumEntries =
713 L_->getNodeMaxNumRowEntries () +
U_->getNodeMaxNumRowEntries () + 1;
715 Teuchos::Array<local_ordinal_type> InI(MaxNumEntries);
716 Teuchos::Array<scalar_type> InV(MaxNumEntries);
717 size_t num_cols =
U_->getColMap()->getNodeNumElements();
718 Teuchos::Array<int> colflag(num_cols);
720 Teuchos::ArrayRCP<scalar_type> DV =
D_->get1dViewNonConst();
726 Teuchos::ArrayView<const local_ordinal_type> UUI;
727 Teuchos::ArrayView<const scalar_type> UUV;
728 for (
size_t j = 0; j < num_cols; ++j) {
732 for (
size_t i = 0; i <
L_->getNodeNumRows (); ++i) {
737 NumIn = MaxNumEntries;
738 L_->getLocalRowCopy (local_row, InI (), InV (), NumL);
741 InI[NumL] = local_row;
743 U_->getLocalRowCopy (local_row, InI (NumL+1, MaxNumEntries-NumL-1),
744 InV (NumL+1, MaxNumEntries-NumL-1), NumU);
748 for (
size_t j = 0; j < NumIn; ++j) {
754 for (
size_t jj = 0; jj < NumL; ++jj) {
760 U_->getLocalRowView(j, UUI, UUV);
763 if (RelaxValue_ == STM::zero ()) {
764 for (
size_t k = 0; k < NumUU; ++k) {
765 const int kk = colflag[UUI[k]];
770 InV[kk] -= multiplier * UUV[k];
775 for (
size_t k = 0; k < NumUU; ++k) {
779 const int kk = colflag[UUI[k]];
781 InV[kk] -= multiplier*UUV[k];
784 diagmod -= multiplier*UUV[k];
791 L_->replaceLocalValues (local_row, InI (0, NumL), InV (0, NumL));
796 if (RelaxValue_ != STM::zero ()) {
797 DV[i] += RelaxValue_*diagmod;
800 if (STS::magnitude (DV[i]) > STS::magnitude (MaxDiagonalValue)) {
801 if (STS::real (DV[i]) < STM::zero ()) {
802 DV[i] = -MinDiagonalValue;
805 DV[i] = MinDiagonalValue;
809 DV[i] = STS::one () / DV[i];
812 for (
size_t j = 0; j < NumU; ++j) {
813 InV[NumL+1+j] *= DV[i];
818 U_->replaceLocalValues (local_row, InI (NumL+1, NumU), InV (NumL+1, NumU));
822 for (
size_t j = 0; j < NumIn; ++j) {
823 colflag[InI[j]] = -1;
833 TEUCHOS_TEST_FOR_EXCEPTION(
834 !
L_->isLowerTriangular (), std::runtime_error,
835 "Ifpack2::RILUK::compute: L isn't lower triangular.");
836 TEUCHOS_TEST_FOR_EXCEPTION(
837 !
U_->isUpperTriangular (), std::runtime_error,
838 "Ifpack2::RILUK::compute: U isn't lower triangular.");
843 computeTime_ += timer.totalElapsedTime ();
847 template<
class MatrixType>
850 apply (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
851 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
852 Teuchos::ETransp mode,
857 using Teuchos::rcpFromRef;
859 TEUCHOS_TEST_FOR_EXCEPTION(
860 A_.is_null (), std::runtime_error,
"Ifpack2::RILUK::apply: The matrix is " 861 "null. Please call setMatrix() with a nonnull input, then initialize() " 862 "and compute(), before calling this method.");
863 TEUCHOS_TEST_FOR_EXCEPTION(
865 "Ifpack2::RILUK::apply: If you have not yet called compute(), " 866 "you must call compute() before calling this method.");
867 TEUCHOS_TEST_FOR_EXCEPTION(
868 X.getNumVectors () != Y.getNumVectors (), std::invalid_argument,
869 "Ifpack2::RILUK::apply: X and Y do not have the same number of columns. " 870 "X.getNumVectors() = " << X.getNumVectors ()
871 <<
" != Y.getNumVectors() = " << Y.getNumVectors () <<
".");
872 TEUCHOS_TEST_FOR_EXCEPTION(
873 STS::isComplex && mode == Teuchos::CONJ_TRANS, std::logic_error,
874 "Ifpack2::RILUK::apply: mode = Teuchos::CONJ_TRANS is not implemented for " 875 "complex Scalar type. Please talk to the Ifpack2 developers to get this " 876 "fixed. There is a FIXME in this file about this very issue.");
877 #ifdef HAVE_IFPACK2_DEBUG 880 TEUCHOS_TEST_FOR_EXCEPTION( STM::isnaninf (D_nrm1), std::runtime_error,
"Ifpack2::RILUK::apply: The 1-norm of the stored diagonal is NaN or Inf.");
881 Teuchos::Array<magnitude_type> norms (X.getNumVectors ());
884 for (
size_t j = 0; j < X.getNumVectors (); ++j) {
885 if (STM::isnaninf (norms[j])) {
890 TEUCHOS_TEST_FOR_EXCEPTION( ! good, std::runtime_error,
"Ifpack2::RILUK::apply: The 1-norm of the input X is NaN or Inf.");
892 #endif // HAVE_IFPACK2_DEBUG 897 Teuchos::Time timer (
"RILUK::apply");
899 Teuchos::TimeMonitor timeMon (timer);
900 if (alpha == one && beta == zero) {
901 if (mode == Teuchos::NO_TRANS) {
908 MV C (
D_->getMap (), X.getNumVectors ());
909 L_->localSolve (X, C, mode);
914 C.elementWiseMultiply (one, *
D_, C, zero);
916 U_->localSolve (C, Y, mode);
926 MV C (
D_->getMap (), X.getNumVectors ());
927 U_->localSolve (X, C, mode);
936 C.elementWiseMultiply (one, *
D_, C, zero);
938 L_->localSolve (C, Y, mode);
949 MV Y_tmp (Y.getMap (), Y.getNumVectors ());
950 apply (X, Y_tmp, mode);
951 Y.update (alpha, Y_tmp, beta);
956 #ifdef HAVE_IFPACK2_DEBUG 958 Teuchos::Array<magnitude_type> norms (Y.getNumVectors ());
961 for (
size_t j = 0; j < Y.getNumVectors (); ++j) {
962 if (STM::isnaninf (norms[j])) {
967 TEUCHOS_TEST_FOR_EXCEPTION( ! good, std::runtime_error,
"Ifpack2::RILUK::apply: The 1-norm of the output Y is NaN or Inf.");
969 #endif // HAVE_IFPACK2_DEBUG 972 applyTime_ = timer.totalElapsedTime ();
976 template<
class MatrixType>
978 multiply (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
979 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
980 const Teuchos::ETransp mode)
const 985 if (mode != Teuchos::NO_TRANS) {
986 U_->apply (X, Y, mode);
987 Y.update (one, X, one);
992 Y.elementWiseMultiply (one, *
D_, Y, zero);
994 MV Y_tmp (Y, Teuchos::Copy);
995 L_->apply (Y_tmp, Y, mode);
996 Y.update (one, Y_tmp, one);
999 L_->apply (X, Y, mode);
1000 Y.update (one, X, one);
1001 Y.elementWiseMultiply (one, *
D_, Y, zero);
1002 MV Y_tmp (Y, Teuchos::Copy);
1003 U_->apply (Y_tmp, Y, mode);
1004 Y.update (one, Y_tmp, one);
1009 template<
class MatrixType>
1012 std::ostringstream os;
1017 os <<
"\"Ifpack2::RILUK\": {";
1018 os <<
"Initialized: " << (
isInitialized () ?
"true" :
"false") <<
", " 1019 <<
"Computed: " << (
isComputed () ?
"true" :
"false") <<
", ";
1023 if (
A_.is_null ()) {
1024 os <<
"Matrix: null";
1027 os <<
"Global matrix dimensions: [" 1028 <<
A_->getGlobalNumRows () <<
", " <<
A_->getGlobalNumCols () <<
"]" 1029 <<
", Global nnz: " <<
A_->getGlobalNumEntries();
1039 #define IFPACK2_RILUK_INSTANT(S,LO,GO,N) \ 1040 template class Ifpack2::RILUK< Tpetra::RowMatrix<S, LO, GO, N> >; Teuchos::RCP< const Tpetra::Map< local_ordinal_type, global_ordinal_type, node_type > > getRangeMap() const
Returns the Tpetra::Map object associated with the range of this operator.
Definition: Ifpack2_RILUK_def.hpp:184
MatrixType::global_ordinal_type global_ordinal_type
The type of global indices in the input MatrixType.
Definition: Ifpack2_RILUK_decl.hpp:261
Teuchos::RCP< crs_matrix_type > L_
The L (lower triangular) factor of ILU(k).
Definition: Ifpack2_RILUK_decl.hpp:571
const Tpetra::Vector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > & getD() const
Return the diagonal entries of the ILU factorization.
Definition: Ifpack2_RILUK_def.hpp:135
void initialize()
Initialize by computing the symbolic incomplete factorization.
Definition: Ifpack2_RILUK_def.hpp:428
Tpetra::RowMatrix< scalar_type, local_ordinal_type, global_ordinal_type, node_type > row_matrix_type
Tpetra::RowMatrix specialization used by this class.
Definition: Ifpack2_RILUK_decl.hpp:273
virtual void setMatrix(const Teuchos::RCP< const row_matrix_type > &A)
Change the matrix to be preconditioned.
Definition: Ifpack2_RILUK_def.hpp:95
std::string description() const
A one-line description of this object.
Definition: Ifpack2_RILUK_def.hpp:1010
void setParameters(const Teuchos::ParameterList ¶ms)
Definition: Ifpack2_RILUK_def.hpp:231
ILU(k) factorization of a given Tpetra::RowMatrix.
Definition: Ifpack2_RILUK_decl.hpp:243
Teuchos::RCP< const crs_matrix_type > getCrsMatrix() const
Return the input matrix A as a Tpetra::CrsMatrix, if possible; else throws.
Definition: Ifpack2_RILUK_def.hpp:388
bool isComputed() const
Whether compute() has been called on this object.
Definition: Ifpack2_RILUK_decl.hpp:344
Tpetra::CrsMatrix< scalar_type, local_ordinal_type, global_ordinal_type, node_type > crs_matrix_type
Tpetra::CrsMatrix specialization used by this class for representing L and U.
Definition: Ifpack2_RILUK_decl.hpp:275
const crs_matrix_type & getU() const
Return the U factor of the ILU factorization.
Definition: Ifpack2_RILUK_def.hpp:149
MatrixType::node_type node_type
The Node type used by the input MatrixType.
Definition: Ifpack2_RILUK_decl.hpp:264
Teuchos::RCP< const Tpetra::Map< local_ordinal_type, global_ordinal_type, node_type > > getDomainMap() const
Returns the Tpetra::Map object associated with the domain of this operator.
Definition: Ifpack2_RILUK_def.hpp:165
MatrixType::local_ordinal_type local_ordinal_type
The type of local indices in the input MatrixType.
Definition: Ifpack2_RILUK_decl.hpp:258
virtual ~RILUK()
Destructor (declared virtual for memory safety).
Definition: Ifpack2_RILUK_def.hpp:90
Teuchos::RCP< const crs_matrix_type > A_local_crs_
The matrix used to to compute ILU(k).
Definition: Ifpack2_RILUK_decl.hpp:568
int getLevelOfFill() const
Get level of fill (the "k" in ILU(k)).
Definition: Ifpack2_RILUK_decl.hpp:501
Teuchos::RCP< Ifpack2::IlukGraph< Tpetra::CrsGraph< local_ordinal_type, global_ordinal_type, node_type > > > Graph_
The ILU(k) graph.
Definition: Ifpack2_RILUK_decl.hpp:559
void compute()
Compute the (numeric) incomplete factorization.
Definition: Ifpack2_RILUK_def.hpp:675
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 (inverse of the) incomplete factorization to X, resulting in Y.
Definition: Ifpack2_RILUK_def.hpp:850
Teuchos::ScalarTraits< scalar_type >::magnitudeType magnitude_type
The type of the magnitude (absolute value) of a matrix entry.
Definition: Ifpack2_RILUK_decl.hpp:267
Construct a level filled graph for use in computing an ILU(k) incomplete factorization.
Definition: Ifpack2_IlukGraph.hpp:97
bool isInitialized() const
Whether initialize() has been called on this object.
Definition: Ifpack2_RILUK_decl.hpp:340
Teuchos::RCP< const row_matrix_type > A_
The (original) input matrix for which to compute ILU(k).
Definition: Ifpack2_RILUK_decl.hpp:554
Teuchos::RCP< const row_matrix_type > getMatrix() const
Get the input matrix.
Definition: Ifpack2_RILUK_def.hpp:381
Definition: Ifpack2_Details_Amesos2Wrapper_decl.hpp:63
Teuchos::RCP< vec_type > D_
The diagonal entries of the ILU(k) factorization.
Definition: Ifpack2_RILUK_decl.hpp:575
Access only local rows and columns of a sparse matrix.
Definition: Ifpack2_LocalFilter_decl.hpp:160
Preconditioners and smoothers for Tpetra sparse matrices.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:72
const crs_matrix_type & getL() const
Return the L factor of the ILU factorization.
Definition: Ifpack2_RILUK_def.hpp:118
Teuchos::RCP< crs_matrix_type > U_
The U (upper triangular) factor of ILU(k).
Definition: Ifpack2_RILUK_decl.hpp:573
MatrixType::scalar_type scalar_type
The type of the entries of the input MatrixType.
Definition: Ifpack2_RILUK_decl.hpp:255