45 #ifndef __IFPACK2_FILU_DEF_HPP__ 46 #define __IFPACK2_FILU_DEF_HPP__ 48 #include "Ifpack2_Details_Filu_decl.hpp" 50 #include "Ifpack2_Details_getCrsMatrix.hpp" 51 #include <Kokkos_Timer.hpp> 52 #include <shylu_fastilu.hpp> 59 template<
typename Scalar,
typename LocalOrdinal,
typename GlobalOrdinal,
typename Node>
61 Filu(Teuchos::RCP<const TRowMatrix> A) :
62 FastILU_Base<Scalar, LocalOrdinal, GlobalOrdinal, Node>(A) {}
64 template<
typename Scalar,
typename LocalOrdinal,
typename GlobalOrdinal,
typename Node>
68 return localPrec_->getNFact();
71 template<
typename Scalar,
typename LocalOrdinal,
typename GlobalOrdinal,
typename Node>
75 return localPrec_->getSpTrsvType();
78 template<
typename Scalar,
typename LocalOrdinal,
typename GlobalOrdinal,
typename Node>
82 return localPrec_->getNTrisol();
85 template<
typename Scalar,
typename LocalOrdinal,
typename GlobalOrdinal,
typename Node>
89 localPrec_->checkILU();
92 template<
typename Scalar,
typename LocalOrdinal,
typename GlobalOrdinal,
typename Node>
96 localPrec_->checkIC();
99 template<
typename Scalar,
typename LocalOrdinal,
typename GlobalOrdinal,
typename Node>
103 auto nRows = this->mat_->getLocalNumRows();
104 auto& p = this->params_;
105 auto matCrs = Ifpack2::Details::getCrsMatrix(this->mat_);
107 bool skipSortMatrix = !matCrs.is_null() && matCrs->getCrsGraph()->isSorted() &&
109 localPrec_ = Teuchos::rcp(
new LocalFILU(skipSortMatrix, this->localRowPtrs_, this->localColInds_, this->localValues_, nRows, p.sptrsv_algo,
110 p.nFact, p.nTrisol, p.level, p.omega, p.shift, p.guessFlag ? 1 : 0, p.blockSizeILU, p.blockSize));
111 #ifdef HAVE_IFPACK2_METIS 113 localPrec_->setMetisPerm(this->metis_perm_, this->metis_iperm_);
116 localPrec_->initialize();
117 this->initTime_ = localPrec_->getInitializeTime();
120 template<
typename Scalar,
typename LocalOrdinal,
typename GlobalOrdinal,
typename Node>
125 localPrec_->setValues(this->localValues_);
126 localPrec_->compute();
127 this->computeTime_ = localPrec_->getComputeTime();
130 template<
typename Scalar,
typename LocalOrdinal,
typename GlobalOrdinal,
typename Node>
134 localPrec_->apply(x, y);
136 this->applyTime_ += localPrec_->getApplyTime();
139 template<
typename Scalar,
typename LocalOrdinal,
typename GlobalOrdinal,
typename Node>
146 #define IFPACK2_DETAILS_FILU_INSTANT(S, L, G, N) \ 147 template class Ifpack2::Details::Filu<S, L, G, N>; int getSweeps() const
Get the sweeps ("nFact") from localPrec_.
Definition: Ifpack2_Details_Filu_def.hpp:66
void initLocalPrec()
Construct the underlying preconditioner (localPrec_) using given params and then call localPrec_->ini...
Definition: Ifpack2_Details_Filu_def.hpp:101
std::string getName() const
Get the name of the underlying preconditioner ("Filu", "Fildl" or "Fic")
Definition: Ifpack2_Details_Filu_def.hpp:141
Ifpack2 implementation details.
Filu(Teuchos::RCP< const TRowMatrix > mat_)
Constructor.
Definition: Ifpack2_Details_Filu_def.hpp:61
std::string getSpTrsvType() const
Get the name of triangular solve algorithm.
Definition: Ifpack2_Details_Filu_def.hpp:73
The base class of the Ifpack2 FastILU wrappers (Filu, Fildl and Fic)
Definition: Ifpack2_Details_FastILU_Base_decl.hpp:71
void checkLocalIC() const
Verify and print debug info about the internal IC preconditioner.
Definition: Ifpack2_Details_Filu_def.hpp:94
Kokkos::View< ImplScalar *, execution_space > ImplScalarArray
Array of Scalar on device.
Definition: Ifpack2_Details_FastILU_Base_decl.hpp:95
void applyLocalPrec(ImplScalarArray x, ImplScalarArray y) const
Apply the local preconditioner with 1-D views of the local parts of X and Y (one vector only) ...
Definition: Ifpack2_Details_Filu_def.hpp:132
void checkLocalILU() const
Verify and print debug info about the internal ILU preconditioner.
Definition: Ifpack2_Details_Filu_def.hpp:87
Preconditioners and smoothers for Tpetra sparse matrices.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:74
int getNTrisol() const
Get the number of triangular solves ("nTrisol") from localPrec_.
Definition: Ifpack2_Details_Filu_def.hpp:80
Provides functions for retrieving local CRS arrays (row pointers, column indices, and values) from Tp...
void computeLocalPrec()
Get values array from the matrix and then call compute() on the underlying preconditioner.
Definition: Ifpack2_Details_Filu_def.hpp:122