43 #ifndef IFPACK2_EXPERIMENTAL_CRSRBILUK_DEF_HPP 44 #define IFPACK2_EXPERIMENTAL_CRSRBILUK_DEF_HPP 46 #include <Tpetra_Experimental_BlockMultiVector.hpp> 47 #include<Ifpack2_OverlappingRowMatrix.hpp> 48 #include<Ifpack2_LocalFilter.hpp> 49 #include <Ifpack2_Experimental_RBILUK.hpp> 51 #include <Ifpack2_RILUK.hpp> 57 template<
class MatrixType>
61 A_block_(
Teuchos::rcp_dynamic_cast<const block_crs_matrix_type>(Matrix_in))
64 template<
class MatrixType>
71 template<
class MatrixType>
75 template<
class MatrixType>
85 if (A.getRawPtr () != A_block_.getRawPtr ())
87 this->isAllocated_ =
false;
88 this->isInitialized_ =
false;
89 this->isComputed_ =
false;
90 this->
Graph_ = Teuchos::null;
91 L_block_ = Teuchos::null;
92 U_block_ = Teuchos::null;
93 D_block_ = Teuchos::null;
100 template<
class MatrixType>
101 const typename RBILUK<MatrixType>::block_crs_matrix_type&
104 TEUCHOS_TEST_FOR_EXCEPTION(
105 L_block_.is_null (), std::runtime_error,
"Ifpack2::RILUK::getL: The L factor " 106 "is null. Please call initialize() (and preferably also compute()) " 107 "before calling this method. If the input matrix has not yet been set, " 108 "you must first call setMatrix() with a nonnull input matrix before you " 109 "may call initialize() or compute().");
114 template<
class MatrixType>
115 const typename RBILUK<MatrixType>::block_crs_matrix_type&
118 TEUCHOS_TEST_FOR_EXCEPTION(
119 D_block_.is_null (), std::runtime_error,
"Ifpack2::RILUK::getD: The D factor " 120 "(of diagonal entries) is null. Please call initialize() (and " 121 "preferably also compute()) before calling this method. If the input " 122 "matrix has not yet been set, you must first call setMatrix() with a " 123 "nonnull input matrix before you may call initialize() or compute().");
128 template<
class MatrixType>
129 const typename RBILUK<MatrixType>::block_crs_matrix_type&
132 TEUCHOS_TEST_FOR_EXCEPTION(
133 U_block_.is_null (), std::runtime_error,
"Ifpack2::RILUK::getU: The U factor " 134 "is null. Please call initialize() (and preferably also compute()) " 135 "before calling this method. If the input matrix has not yet been set, " 136 "you must first call setMatrix() with a nonnull input matrix before you " 137 "may call initialize() or compute().");
141 template<
class MatrixType>
147 if (! this->isAllocated_) {
159 L_block_ = rcp(
new block_crs_matrix_type(*this->
Graph_->getL_Graph (), blockSize_) );
160 U_block_ = rcp(
new block_crs_matrix_type(*this->
Graph_->getU_Graph (), blockSize_) );
161 D_block_ = rcp(
new block_crs_matrix_type(*(Ifpack2::Details::computeDiagonalGraph(*(this->
Graph_->getOverlapGraph()))),
163 L_block_->setAllToScalar (STM::zero ());
164 U_block_->setAllToScalar (STM::zero ());
165 D_block_->setAllToScalar (STM::zero ());
168 this->isAllocated_ =
true;
171 template<
class MatrixType>
172 Teuchos::RCP<const typename RBILUK<MatrixType>::block_crs_matrix_type>
177 template<
class MatrixType>
182 using Teuchos::rcp_dynamic_cast;
183 const char prefix[] =
"Ifpack2::Experimental::RBILUK::initialize: ";
194 if (A_block_.is_null ()) {
199 RCP<const LocalFilter<row_matrix_type> > filteredA =
201 TEUCHOS_TEST_FOR_EXCEPTION
202 (filteredA.is_null (), std::runtime_error, prefix <<
203 "Cannot cast to filtered matrix.");
204 RCP<const OverlappingRowMatrix<row_matrix_type> > overlappedA =
206 if (! overlappedA.is_null ()) {
207 A_block_ = rcp_dynamic_cast<
const block_crs_matrix_type>(overlappedA->getUnderlyingMatrix());
210 A_block_ = rcp_dynamic_cast<
const block_crs_matrix_type>(filteredA->getUnderlyingMatrix());
214 TEUCHOS_TEST_FOR_EXCEPTION
215 (A_block_.is_null (), std::runtime_error, prefix <<
"The matrix (A_block_, " 216 "the BlockCrsMatrix) is null. Please call setMatrix() with a nonnull " 217 "input before calling this method.");
218 TEUCHOS_TEST_FOR_EXCEPTION
219 (! A_block_->isFillComplete (), std::runtime_error, prefix <<
"The matrix " 220 "(A_block_, the BlockCrsMatrix) is not fill complete. You may not invoke " 221 "initialize() or compute() with this matrix until the matrix is fill " 222 "complete. Note: BlockCrsMatrix is fill complete if and only if its " 223 "underlying graph is fill complete.");
225 blockSize_ = A_block_->getBlockSize();
227 Teuchos::Time timer (
"RBILUK::initialize");
229 Teuchos::TimeMonitor timeMon (timer);
238 this->isInitialized_ =
false;
239 this->isAllocated_ =
false;
240 this->isComputed_ =
false;
241 this->
Graph_ = Teuchos::null;
247 RCP<const crs_graph_type> matrixCrsGraph = Teuchos::rcpFromRef(A_block_->getCrsGraph() );
249 this->LevelOfFill_, 0));
251 this->Graph_->initialize ();
252 allocate_L_and_U_blocks ();
253 initAllValues (*A_block_);
256 this->isInitialized_ =
true;
257 this->numInitialize_ += 1;
258 this->initializeTime_ += timer.totalElapsedTime ();
262 template<
class MatrixType>
269 typedef Tpetra::Map<local_ordinal_type,global_ordinal_type,node_type> map_type;
272 bool DiagFound =
false;
273 size_t NumNonzeroDiags = 0;
274 size_t MaxNumEntries = A.getNodeMaxNumRowEntries();
280 Teuchos::ArrayView<const global_ordinal_type> rowGIDs = A.getRowMap()->getNodeElementList();
281 Teuchos::ArrayView<const global_ordinal_type> colGIDs = A.getColMap()->getNodeElementList();
282 bool gidsAreConsistentlyOrdered=
true;
285 if (rowGIDs[i] != colGIDs[i]) {
286 gidsAreConsistentlyOrdered=
false;
287 indexOfInconsistentGID=i;
291 TEUCHOS_TEST_FOR_EXCEPTION(gidsAreConsistentlyOrdered==
false, std::runtime_error,
292 "The ordering of the local GIDs in the row and column maps is not the same" 293 << std::endl <<
"at index " << indexOfInconsistentGID
294 <<
". Consistency is required, as all calculations are done with" 295 << std::endl <<
"local indexing.");
299 Teuchos::Array<local_ordinal_type> LI(MaxNumEntries);
300 Teuchos::Array<local_ordinal_type> UI(MaxNumEntries);
301 Teuchos::Array<scalar_type> LV(MaxNumEntries*blockMatSize);
302 Teuchos::Array<scalar_type> UV(MaxNumEntries*blockMatSize);
304 Teuchos::Array<scalar_type> diagValues(blockMatSize);
306 L_block_->setAllToScalar (STM::zero ());
307 U_block_->setAllToScalar (STM::zero ());
308 D_block_->setAllToScalar (STM::zero ());
310 RCP<const map_type> rowMap = L_block_->getRowMap ();
320 for (
size_t myRow=0; myRow<A.getNodeNumRows(); ++myRow) {
327 A.getLocalRowView(local_row, InI, InV, NumIn);
339 if (k == local_row) {
343 diagValues[jj] = this->Rthresh_ * InV[blockOffset+jj] + IFPACK2_SGN(InV[blockOffset+jj]) * this->Athresh_;
344 D_block_->replaceLocalValues(local_row, &InI[j], diagValues.getRawPtr(), 1);
347 TEUCHOS_TEST_FOR_EXCEPTION(
348 true, std::runtime_error,
"Ifpack2::RILUK::initAllValues: current " 349 "GID k = " << k <<
" < 0. I'm not sure why this is an error; it is " 350 "probably an artifact of the undocumented assumptions of the " 351 "original implementation (likely copied and pasted from Ifpack). " 352 "Nevertheless, the code I found here insisted on this being an error " 353 "state, so I will throw an exception here.");
355 else if (k < local_row) {
359 LV[LBlockOffset+jj] = InV[blockOffset+jj];
362 else if (Teuchos::as<size_t>(k) <= rowMap->getNodeNumElements()) {
366 UV[UBlockOffset+jj] = InV[blockOffset+jj];
378 diagValues[jj*(blockSize_+1)] = this->Athresh_;
379 D_block_->replaceLocalValues(local_row, &local_row, diagValues.getRawPtr(), 1);
383 L_block_->replaceLocalValues(local_row, &LI[0], &LV[0], NumL);
387 U_block_->replaceLocalValues(local_row, &UI[0], &UV[0], NumU);
391 this->isInitialized_ =
true;
394 template<
class MatrixType>
397 typedef impl_scalar_type IST;
398 const char prefix[] =
"Ifpack2::Experimental::RBILUK::compute: ";
403 TEUCHOS_TEST_FOR_EXCEPTION
404 (A_block_.is_null (), std::runtime_error, prefix <<
"The matrix (A_block_, " 405 "the BlockCrsMatrix) is null. Please call setMatrix() with a nonnull " 406 "input before calling this method.");
407 TEUCHOS_TEST_FOR_EXCEPTION
408 (! A_block_->isFillComplete (), std::runtime_error, prefix <<
"The matrix " 409 "(A_block_, the BlockCrsMatrix) is not fill complete. You may not invoke " 410 "initialize() or compute() with this matrix until the matrix is fill " 411 "complete. Note: BlockCrsMatrix is fill complete if and only if its " 412 "underlying graph is fill complete.");
420 Teuchos::Time timer (
"RBILUK::compute");
422 this->isComputed_ =
false;
429 initAllValues (*A_block_);
435 const size_t MaxNumEntries =
436 L_block_->getNodeMaxNumRowEntries () + U_block_->getNodeMaxNumRowEntries () + 1;
446 Teuchos::Array<int> ipiv_teuchos(blockSize_);
447 Kokkos::View<
int*, Kokkos::HostSpace,
448 Kokkos::MemoryUnmanaged> ipiv (ipiv_teuchos.getRawPtr (), blockSize_);
449 Teuchos::Array<IST> work_teuchos(blockSize_);
450 Kokkos::View<IST*, Kokkos::HostSpace,
451 Kokkos::MemoryUnmanaged> work (work_teuchos.getRawPtr (), blockSize_);
453 size_t num_cols = U_block_->getColMap()->getNodeNumElements();
454 Teuchos::Array<int> colflag(num_cols);
456 Teuchos::Array<impl_scalar_type> diagMod(blockMatSize,STM::zero());
457 little_block_type diagModBlock(&diagMod[0], blockSize_, rowStride, colStride);
458 Teuchos::Array<impl_scalar_type> matTmpArray(blockMatSize,STM::zero());
459 little_block_type matTmp(&matTmpArray[0], blockSize_, rowStride, colStride);
460 Teuchos::Array<impl_scalar_type> multiplierArray(blockMatSize, STM::zero());
461 little_block_type multiplier(&multiplierArray[0], blockSize_, rowStride, colStride);
469 for (
size_t j = 0; j < num_cols; ++j) {
472 Teuchos::Array<local_ordinal_type> InI(MaxNumEntries, 0);
473 Teuchos::Array<scalar_type> InV(MaxNumEntries*blockMatSize,STM::zero());
480 NumIn = MaxNumEntries;
484 L_block_->getLocalRowView(local_row, colValsL, valsL, NumL);
488 little_block_type lmat(&valsL[matOffset],blockSize_,rowStride, colStride);
489 little_block_type lmatV(&InV[matOffset],blockSize_,rowStride, colStride);
491 Tpetra::Experimental::COPY (lmat, lmatV);
492 InI[j] = colValsL[j];
495 little_block_type dmat = D_block_->getLocalBlock(local_row, local_row);
496 little_block_type dmatV(&InV[NumL*blockMatSize], blockSize_, rowStride, colStride);
498 Tpetra::Experimental::COPY (dmat, dmatV);
499 InI[NumL] = local_row;
503 U_block_->getLocalRowView(local_row, colValsU, valsU, NumURead);
507 if (!(colValsU[j] < numLocalRows))
continue;
508 InI[NumL+1+j] = colValsU[j];
510 little_block_type umat(&valsU[blockMatSize*j], blockSize_, rowStride, colStride);
511 little_block_type umatV(&InV[matOffset], blockSize_, rowStride, colStride);
513 Tpetra::Experimental::COPY (umat, umatV);
519 for (
size_t j = 0; j < NumIn; ++j) {
525 Tpetra::Experimental::deep_copy (diagModBlock, diagmod);
529 little_block_type currentVal(&InV[jj*blockMatSize], blockSize_, rowStride, colStride);
531 Tpetra::Experimental::COPY (currentVal, multiplier);
533 const little_block_type dmatInverse = D_block_->getLocalBlock(j,j);
535 Tpetra::Experimental::GEMM (
"N",
"N", STS::one (), currentVal, dmatInverse,
536 STS::zero (), matTmp);
539 Tpetra::Experimental::COPY (matTmp, currentVal);
543 U_block_->getLocalRowView(j, UUI, UUV, NumUU);
545 if (this->RelaxValue_ == STM::zero ()) {
547 if (!(UUI[k] < numLocalRows))
continue;
548 const int kk = colflag[UUI[k]];
550 little_block_type kkval(&InV[kk*blockMatSize], blockSize_, rowStride, colStride);
551 little_block_type uumat(&UUV[k*blockMatSize], blockSize_, rowStride, colStride);
552 Tpetra::Experimental::GEMM (
"N",
"N", -STM::one (), multiplier, uumat,
560 if (!(UUI[k] < numLocalRows))
continue;
561 const int kk = colflag[UUI[k]];
562 little_block_type uumat(&UUV[k*blockMatSize], blockSize_, rowStride, colStride);
564 little_block_type kkval(&InV[kk*blockMatSize], blockSize_, rowStride, colStride);
565 Tpetra::Experimental::GEMM (
"N",
"N", -STM::one (), multiplier, uumat,
570 Tpetra::Experimental::GEMM (
"N",
"N", -STM::one (), multiplier, uumat,
571 STM::one (), diagModBlock);
579 L_block_->replaceLocalValues (local_row, InI.getRawPtr (), InV.getRawPtr (), NumL);
583 Tpetra::Experimental::COPY (dmatV, dmat);
585 if (this->RelaxValue_ != STM::zero ()) {
587 Tpetra::Experimental::AXPY (this->RelaxValue_, diagModBlock, dmat);
601 for (
int k = 0; k < blockSize_; ++k) {
605 Tpetra::Experimental::GETF2 (dmat, ipiv, lapackInfo);
607 TEUCHOS_TEST_FOR_EXCEPTION(
608 lapackInfo != 0, std::runtime_error,
"Ifpack2::Experimental::RBILUK::compute: " 609 "lapackInfo = " << lapackInfo <<
" which indicates an error in the factorization GETRF.");
611 Tpetra::Experimental::GETRI (dmat, ipiv, work, lapackInfo);
613 TEUCHOS_TEST_FOR_EXCEPTION(
614 lapackInfo != 0, std::runtime_error,
"Ifpack2::Experimental::RBILUK::compute: " 615 "lapackInfo = " << lapackInfo <<
" which indicates an error in the matrix inverse GETRI.");
619 little_block_type currentVal(&InV[(NumL+1+j)*blockMatSize], blockSize_, rowStride, colStride);
621 Tpetra::Experimental::GEMM (
"N",
"N", STS::one (), dmat, currentVal,
622 STS::zero (), matTmp);
625 Tpetra::Experimental::COPY (matTmp, currentVal);
630 U_block_->replaceLocalValues (local_row, &InI[NumL+1], &InV[blockMatSize*(NumL+1)], NumU);
634 for (
size_t j = 0; j < num_cols; ++j) {
641 this->isComputed_ =
true;
642 this->numCompute_ += 1;
643 this->computeTime_ += timer.totalElapsedTime ();
647 template<
class MatrixType>
650 apply (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
651 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
652 Teuchos::ETransp mode,
657 typedef Tpetra::Experimental::BlockMultiVector<
scalar_type,
662 TEUCHOS_TEST_FOR_EXCEPTION(
663 A_block_.is_null (), std::runtime_error,
"Ifpack2::Experimental::RBILUK::apply: The matrix is " 664 "null. Please call setMatrix() with a nonnull input, then initialize() " 665 "and compute(), before calling this method.");
666 TEUCHOS_TEST_FOR_EXCEPTION(
668 "Ifpack2::Experimental::RBILUK::apply: If you have not yet called compute(), " 669 "you must call compute() before calling this method.");
670 TEUCHOS_TEST_FOR_EXCEPTION(
671 X.getNumVectors () != Y.getNumVectors (), std::invalid_argument,
672 "Ifpack2::Experimental::RBILUK::apply: X and Y do not have the same number of columns. " 673 "X.getNumVectors() = " << X.getNumVectors ()
674 <<
" != Y.getNumVectors() = " << Y.getNumVectors () <<
".");
675 TEUCHOS_TEST_FOR_EXCEPTION(
676 STS::isComplex && mode == Teuchos::CONJ_TRANS, std::logic_error,
677 "Ifpack2::Experimental::RBILUK::apply: mode = Teuchos::CONJ_TRANS is not implemented for " 678 "complex Scalar type. Please talk to the Ifpack2 developers to get this " 679 "fixed. There is a FIXME in this file about this very issue.");
681 const local_ordinal_type blockMatSize = blockSize_*blockSize_;
683 const local_ordinal_type rowStride = blockSize_;
684 const local_ordinal_type colStride = 1;
686 BMV yBlock (Y, * (A_block_->getGraph ()->getDomainMap ()), blockSize_);
687 const BMV xBlock (X, * (A_block_->getColMap ()), blockSize_);
689 Teuchos::Array<scalar_type> lclarray(blockSize_);
690 little_vec_type lclvec(&lclarray[0], blockSize_, colStride);
691 const scalar_type one = STM::one ();
692 const scalar_type zero = STM::zero ();
694 Teuchos::Time timer (
"RBILUK::apply");
696 Teuchos::TimeMonitor timeMon (timer);
697 if (alpha == one && beta == zero) {
698 if (mode == Teuchos::NO_TRANS) {
705 const local_ordinal_type numVectors = xBlock.getNumVectors();
706 BMV cBlock (* (A_block_->getGraph ()->getDomainMap ()), blockSize_, numVectors);
707 BMV rBlock (* (A_block_->getGraph ()->getDomainMap ()), blockSize_, numVectors);
708 for (local_ordinal_type imv = 0; imv < numVectors; ++imv)
710 for (
size_t i = 0; i < D_block_->getNodeNumRows(); ++i)
712 local_ordinal_type local_row = i;
713 little_vec_type xval = xBlock.getLocalBlock(local_row,imv);
714 little_vec_type cval = cBlock.getLocalBlock(local_row,imv);
716 Tpetra::Experimental::COPY (xval, cval);
718 local_ordinal_type NumL;
719 const local_ordinal_type * colValsL;
722 L_block_->getLocalRowView(local_row, colValsL, valsL, NumL);
724 for (local_ordinal_type j = 0; j < NumL; ++j)
726 local_ordinal_type col = colValsL[j];
727 little_vec_type prevVal = cBlock.getLocalBlock(col, imv);
729 const local_ordinal_type matOffset = blockMatSize*j;
730 little_block_type lij(&valsL[matOffset],blockSize_,rowStride, colStride);
733 Tpetra::Experimental::GEMV (-one, lij, prevVal, cval);
739 D_block_->applyBlock(cBlock, rBlock);
742 for (local_ordinal_type imv = 0; imv < numVectors; ++imv)
744 const local_ordinal_type numRows = D_block_->getNodeNumRows();
745 for (local_ordinal_type i = 0; i < numRows; ++i)
747 local_ordinal_type local_row = (numRows-1)-i;
748 little_vec_type rval = rBlock.getLocalBlock(local_row,imv);
749 little_vec_type yval = yBlock.getLocalBlock(local_row,imv);
751 Tpetra::Experimental::COPY (rval, yval);
753 local_ordinal_type NumU;
754 const local_ordinal_type * colValsU;
757 U_block_->getLocalRowView(local_row, colValsU, valsU, NumU);
759 for (local_ordinal_type j = 0; j < NumU; ++j)
761 local_ordinal_type col = colValsU[NumU-1-j];
762 little_vec_type prevVal = yBlock.getLocalBlock(col, imv);
764 const local_ordinal_type matOffset = blockMatSize*(NumU-1-j);
765 little_block_type uij(&valsU[matOffset], blockSize_, rowStride, colStride);
768 Tpetra::Experimental::GEMV (-one, uij, prevVal, yval);
774 TEUCHOS_TEST_FOR_EXCEPTION(
775 true, std::runtime_error,
776 "Ifpack2::Experimental::RBILUK::apply: transpose apply is not implemented for the block algorithm. ");
787 MV Y_tmp (Y.getMap (), Y.getNumVectors ());
788 apply (X, Y_tmp, mode);
789 Y.update (alpha, Y_tmp, beta);
794 this->numApply_ += 1;
795 this->applyTime_ = timer.totalElapsedTime ();
799 template<
class MatrixType>
802 std::ostringstream os;
807 os <<
"\"Ifpack2::Experimental::RBILUK\": {";
808 os <<
"Initialized: " << (this->
isInitialized () ?
"true" :
"false") <<
", " 809 <<
"Computed: " << (this->
isComputed () ?
"true" :
"false") <<
", ";
813 if (A_block_.is_null ()) {
814 os <<
"Matrix: null";
817 os <<
"Global matrix dimensions: [" 818 << A_block_->getGlobalNumRows () <<
", " << A_block_->getGlobalNumCols () <<
"]" 819 <<
", Global nnz: " << A_block_->getGlobalNumEntries();
834 #define IFPACK2_EXPERIMENTAL_RBILUK_INSTANT(S,LO,GO,N) \ 835 template class Ifpack2::Experimental::RBILUK< Tpetra::Experimental::BlockCrsMatrix<S, LO, GO, N> >; \ 836 template class Ifpack2::Experimental::RBILUK< Tpetra::RowMatrix<S, LO, GO, N> >; Ifpack2 features that are experimental. Use at your own risk.
void initialize()
Initialize by computing the symbolic incomplete factorization.
Definition: Ifpack2_Experimental_RBILUK_def.hpp:178
MatrixType::global_ordinal_type global_ordinal_type
The type of global indices in the input MatrixType.
Definition: Ifpack2_Experimental_RBILUK_decl.hpp:145
virtual ~RBILUK()
Destructor (declared virtual for memory safety).
Definition: Ifpack2_Experimental_RBILUK_def.hpp:72
Teuchos::RCP< const block_crs_matrix_type > getBlockMatrix() const
Get the input matrix.
Definition: Ifpack2_Experimental_RBILUK_def.hpp:173
const block_crs_matrix_type & getUBlock() const
Return the U factor of the ILU factorization.
Definition: Ifpack2_Experimental_RBILUK_def.hpp:130
MatrixType::scalar_type scalar_type
The type of the entries of the input MatrixType.
Definition: Ifpack2_Experimental_RBILUK_decl.hpp:136
Teuchos::RCP< crs_matrix_type > L_
The L (lower triangular) factor of ILU(k).
Definition: Ifpack2_RILUK_decl.hpp:571
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_Experimental_RBILUK_def.hpp:650
ILU(k) factorization of a given Tpetra::RowMatrix.
Definition: Ifpack2_RILUK_decl.hpp:243
MatrixType::node_type node_type
The Node type used by the input MatrixType.
Definition: Ifpack2_Experimental_RBILUK_decl.hpp:148
bool isComputed() const
Whether compute() has been called on this object.
Definition: Ifpack2_RILUK_decl.hpp:344
MatrixType::local_ordinal_type local_ordinal_type
The type of local indices in the input MatrixType.
Definition: Ifpack2_Experimental_RBILUK_decl.hpp:142
const block_crs_matrix_type & getDBlock() const
Return the diagonal entries of the ILU factorization.
Definition: Ifpack2_Experimental_RBILUK_def.hpp:116
void compute()
Compute the (numeric) incomplete factorization.
Definition: Ifpack2_Experimental_RBILUK_def.hpp:395
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
File for utility functions.
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
void setMatrix(const Teuchos::RCP< const block_crs_matrix_type > &A)
Change the matrix to be preconditioned.
Definition: Ifpack2_Experimental_RBILUK_def.hpp:77
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
const block_crs_matrix_type & getLBlock() const
Return the L factor of the ILU factorization.
Definition: Ifpack2_Experimental_RBILUK_def.hpp:102
Sparse matrix (Tpetra::RowMatrix subclass) with ghost rows.
Definition: Ifpack2_OverlappingRowMatrix_decl.hpp:59
Access only local rows and columns of a sparse matrix.
Definition: Ifpack2_LocalFilter_decl.hpp:160
Tpetra::RowMatrix< scalar_type, local_ordinal_type, global_ordinal_type, node_type > row_matrix_type
Tpetra::RowMatrix specialization used by this class.
Definition: Ifpack2_Experimental_RBILUK_decl.hpp:157
std::string description() const
A one-line description of this object.
Definition: Ifpack2_Experimental_RBILUK_def.hpp:800
Preconditioners and smoothers for Tpetra sparse matrices.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:72
ILU(k) factorization of a given Tpetra::Experimental::BlockCrsMatrix.
Definition: Ifpack2_Experimental_RBILUK_decl.hpp:128
Teuchos::RCP< crs_matrix_type > U_
The U (upper triangular) factor of ILU(k).
Definition: Ifpack2_RILUK_decl.hpp:573