Ifpack2 Templated Preconditioning Package Version 1.0
Loading...
Searching...
No Matches
Ifpack2_Details_FastILU_Base_def.hpp
Go to the documentation of this file.
1 /*@HEADER
2// ***********************************************************************
3//
4// Ifpack2: Templated Object-Oriented Algebraic Preconditioner Package
5// Copyright (2009) Sandia Corporation
6//
7// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8// license for use of this work by or on behalf of the U.S. Government.
9//
10// Redistribution and use in source and binary forms, with or without
11// modification, are permitted provided that the following conditions are
12// met:
13//
14// 1. Redistributions of source code must retain the above copyright
15// notice, this list of conditions and the following disclaimer.
16//
17// 2. Redistributions in binary form must reproduce the above copyright
18// notice, this list of conditions and the following disclaimer in the
19// documentation and/or other materials provided with the distribution.
20//
21// 3. Neither the name of the Corporation nor the names of the
22// contributors may be used to endorse or promote products derived from
23// this software without specific prior written permission.
24//
25// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36//
37// Questions? Contact Michael A. Heroux (maherou@sandia.gov)
38//
39// ***********************************************************************
40//@HEADER
41*/
42
44
45#ifndef __IFPACK2_FASTILU_BASE_DEF_HPP__
46#define __IFPACK2_FASTILU_BASE_DEF_HPP__
47
49#include <KokkosKernels_Utils.hpp>
50#include <Kokkos_Timer.hpp>
51#include <Teuchos_TimeMonitor.hpp>
52#include <stdexcept>
53
54namespace Ifpack2
55{
56namespace Details
57{
58
59template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
61FastILU_Base(Teuchos::RCP<const TRowMatrix> A) :
62 mat_(A),
63 initFlag_(false),
64 computedFlag_(false),
65 nInit_(0),
66 nComputed_(0),
67 nApply_(0),
68 initTime_(0.0),
69 computeTime_(0.0),
70 applyTime_(0.0),
71 crsCopyTime_(0.0),
72 params_(Params::getDefaults()) {}
73
74template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
75Teuchos::RCP<const Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node> >
77getDomainMap () const
78{
79 return mat_->getDomainMap();
80}
81
82template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
83Teuchos::RCP<const Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node> >
85getRangeMap () const
86{
87 return mat_->getRangeMap();
88}
89
90template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
92apply (const Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> &X,
93 Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> &Y,
94 Teuchos::ETransp mode,
95 Scalar alpha,
96 Scalar beta) const
97{
98 const std::string timerName ("Ifpack2::FastILU::apply");
99 Teuchos::RCP<Teuchos::Time> timer = Teuchos::TimeMonitor::lookupCounter (timerName);
100 if (timer.is_null ()) {
101 timer = Teuchos::TimeMonitor::getNewCounter (timerName);
102 }
103 Teuchos::TimeMonitor timeMon (*timer);
104
105 if(!isInitialized() || !isComputed())
106 {
107 throw std::runtime_error(std::string("Called ") + getName() + "::apply() without first calling initialize() and/or compute().");
108 }
109 if(X.getNumVectors() != Y.getNumVectors())
110 {
111 throw std::invalid_argument(getName() + "::apply: X and Y have different numbers of vectors (pass X and Y with exactly matching dimensions)");
112 }
113 if(X.getLocalLength() != Y.getLocalLength())
114 {
115 throw std::invalid_argument(getName() + "::apply: X and Y have different lengths (pass X and Y with exactly matching dimensions)");
116 }
117 //zero out applyTime_ now, because the calls to applyLocalPrec() will add to it
118 applyTime_ = 0;
119 int nvecs = X.getNumVectors();
120 auto nrowsX = X.getLocalLength();
121 auto nrowsY = Y.getLocalLength();
122 if(nvecs == 1)
123 {
124 auto x2d = X.getLocalViewDevice(Tpetra::Access::ReadOnly);
125 auto y2d = Y.getLocalViewDevice(Tpetra::Access::ReadWrite);
126 ImplScalarArray x1d (const_cast<ImplScalar*>(x2d.data()), nrowsX);
127 ImplScalarArray y1d (const_cast<ImplScalar*>(y2d.data()), nrowsY);
128
129 applyLocalPrec(x1d, y1d);
130 }
131 else
132 {
133 //Solve each vector one at a time (until FastILU supports multiple RHS)
134 auto x2d = X.getLocalViewDevice(Tpetra::Access::ReadOnly);
135 auto y2d = Y.getLocalViewDevice(Tpetra::Access::ReadWrite);
136 for(int i = 0; i < nvecs; i++)
137 {
138 auto xColView1d = Kokkos::subview(x2d, Kokkos::ALL(), i);
139 auto yColView1d = Kokkos::subview(y2d, Kokkos::ALL(), i);
140 ImplScalarArray x1d (const_cast<ImplScalar*>(xColView1d.data()), nrowsX);
141 ImplScalarArray y1d (const_cast<ImplScalar*>(yColView1d.data()), nrowsY);
142
143 applyLocalPrec(x1d, y1d);
144 }
145 }
146}
147
148template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
150setParameters (const Teuchos::ParameterList& List)
151{
152 //Params constructor does all parameter validation, and sets default values
153 params_ = Params(List, getName());
154}
155
156template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
159{
160 const std::string timerName ("Ifpack2::FastILU::initialize");
161 Teuchos::RCP<Teuchos::Time> timer = Teuchos::TimeMonitor::lookupCounter (timerName);
162 if (timer.is_null ()) {
163 timer = Teuchos::TimeMonitor::getNewCounter (timerName);
164 }
165 Teuchos::TimeMonitor timeMon (*timer);
166
167 if(mat_.is_null())
168 {
169 throw std::runtime_error(std::string("Called ") + getName() + "::initialize() but matrix was null (call setMatrix() with a non-null matrix first)");
170 }
171 Kokkos::Timer copyTimer;
172 CrsArrayReader<Scalar, ImplScalar, LocalOrdinal, GlobalOrdinal, Node>::getStructure(mat_.get(), localRowPtrsHost_, localRowPtrs_, localColInds_);
173 crsCopyTime_ = copyTimer.seconds();
174
175 if (params_.use_metis)
176 {
177 const std::string timerNameMetis ("Ifpack2::FastILU::Metis");
178 Teuchos::RCP<Teuchos::Time> timerMetis = Teuchos::TimeMonitor::lookupCounter (timerNameMetis);
179 if (timerMetis.is_null ()) {
180 timerMetis = Teuchos::TimeMonitor::getNewCounter (timerNameMetis);
181 }
182 Teuchos::TimeMonitor timeMonMetis (*timerMetis);
183 #ifdef HAVE_IFPACK2_METIS
184 idx_t nrows = localRowPtrsHost_.size() - 1;
185 if (nrows > 0) {
186 // reorder will convert both graph and perm/iperm to the internal METIS integer type
187 metis_perm_ = MetisArrayHost(Kokkos::ViewAllocateWithoutInitializing("metis_perm"), nrows);
188 metis_iperm_ = MetisArrayHost(Kokkos::ViewAllocateWithoutInitializing("metis_iperm"), nrows);
189
190 // copy ColInds to host
191 auto localColIndsHost_ = Kokkos::create_mirror_view(localColInds_);
192 Kokkos::deep_copy(localColIndsHost_, localColInds_);
193
194 // prepare for calling metis
195 idx_t nnz = localColIndsHost_.size();
196 MetisArrayHost metis_rowptr;
197 MetisArrayHost metis_colidx;
198
199 bool metis_symmetrize = true;
200 if (metis_symmetrize) {
201 // symmetrize
202 using OrdinalArrayMirror = typename OrdinalArray::host_mirror_type;
203 KokkosKernels::Impl::symmetrize_graph_symbolic_hashmap<
204 OrdinalArrayHost, OrdinalArrayMirror, MetisArrayHost, MetisArrayHost, Kokkos::HostSpace::execution_space>
205 (nrows, localRowPtrsHost_, localColIndsHost_, metis_rowptr, metis_colidx);
206
207 // remove diagonals
208 idx_t old_nnz = nnz = 0;
209 for (idx_t i = 0; i < nrows; i++) {
210 for (LocalOrdinal k = old_nnz; k < metis_rowptr(i+1); k++) {
211 if (metis_colidx(k) != i) {
212 metis_colidx(nnz) = metis_colidx(k);
213 nnz++;
214 }
215 }
216 old_nnz = metis_rowptr(i+1);
217 metis_rowptr(i+1) = nnz;
218 }
219 } else {
220 // copy and remove diagonals
221 metis_rowptr = MetisArrayHost(Kokkos::ViewAllocateWithoutInitializing("metis_rowptr"), nrows+1);
222 metis_colidx = MetisArrayHost(Kokkos::ViewAllocateWithoutInitializing("metis_colidx"), nnz);
223 nnz = 0;
224 metis_rowptr(0) = 0;
225 for (idx_t i = 0; i < nrows; i++) {
226 for (LocalOrdinal k = localRowPtrsHost_(i); k < localRowPtrsHost_(i+1); k++) {
227 if (localColIndsHost_(k) != i) {
228 metis_colidx(nnz) = localColIndsHost_(k);
229 nnz++;
230 }
231 }
232 metis_rowptr(i+1) = nnz;
233 }
234 }
235
236 // call metis
237 int info = METIS_NodeND(&nrows, metis_rowptr.data(), metis_colidx.data(),
238 NULL, NULL, metis_perm_.data(), metis_iperm_.data());
239 if (METIS_OK != info) {
240 throw std::runtime_error(std::string("METIS_NodeND returned info = " + info));
241 }
242 }
243 #else
244 throw std::runtime_error(std::string("TPL METIS is not enabled"));
245 #endif
246 }
247
248 initLocalPrec(); //note: initLocalPrec updates initTime
249 initFlag_ = true;
250 nInit_++;
251}
252
253template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
255isInitialized() const
256{
257 return initFlag_;
258}
259
260template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
262compute()
263{
264 if(!initFlag_)
265 {
266 throw std::runtime_error(getName() + ": initialize() must be called before compute()");
267 }
268
269 const std::string timerName ("Ifpack2::FastILU::compute");
270 Teuchos::RCP<Teuchos::Time> timer = Teuchos::TimeMonitor::lookupCounter (timerName);
271 if (timer.is_null ()) {
272 timer = Teuchos::TimeMonitor::getNewCounter (timerName);
273 }
274 Teuchos::TimeMonitor timeMon (*timer);
275
276 //get copy of values array from matrix
277 Kokkos::Timer copyTimer;
278 CrsArrayReader<Scalar, ImplScalar, LocalOrdinal, GlobalOrdinal, Node>::getValues(mat_.get(), localValues_, localRowPtrsHost_);
279 crsCopyTime_ += copyTimer.seconds(); //add to the time spent getting rowptrs/colinds
280 computeLocalPrec(); //this updates computeTime_
281 computedFlag_ = true;
282 nComputed_++;
283}
284
285template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
287isComputed() const
288{
289 return computedFlag_;
290}
291
292template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
293Teuchos::RCP<const Tpetra::RowMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> >
299
300template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
306
307template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
309getNumCompute() const
310{
311 return nComputed_;
312}
313
314template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
320
321template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
323getInitializeTime() const
324{
325 return initTime_;
326}
327
328template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
330getComputeTime() const
331{
332 return computeTime_;
333}
334
335template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
337getApplyTime() const
338{
339 return applyTime_;
340}
341
342template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
344getCopyTime() const
345{
346 return crsCopyTime_;
347}
348
349template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
351checkLocalILU() const
352{
353 //if the underlying type of this doesn't implement checkLocalILU, it's an illegal operation
354 throw std::runtime_error(std::string("Preconditioner type Ifpack2::Details::") + getName() + " doesn't support checkLocalILU().");
355}
356
357template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
359checkLocalIC() const
360{
361 //if the underlying type of this doesn't implement checkLocalIC, it's an illegal operation
362 throw std::runtime_error(std::string("Preconditioner type Ifpack2::Details::") + getName() + " doesn't support checkLocalIC().");
363}
364
365template<typename Scalar, typename LocalOrdinal, typename GlobalOrdinal, typename Node>
367{
368 std::ostringstream os;
369 //Output is a YAML dictionary
370 os << "\"Ifpack2::Details::" << getName() << "\": {";
371 os << "Initialized: " << (isInitialized() ? "true" : "false") << ", ";
372 os << "Computed: " << (isComputed() ? "true" : "false") << ", ";
373 os << "Sweeps: " << getSweeps() << ", ";
374 os << "Triangular solve type: " << getSpTrsvType() << ", ";
375 if (getSpTrsvType() == "Fast") {
376 os << "# of triangular solve iterations: " << getNTrisol() << ", ";
377 }
378 if(mat_.is_null())
379 {
380 os << "Matrix: null";
381 }
382 else
383 {
384 os << "Global matrix dimensions: [" << mat_->getGlobalNumRows() << ", " << mat_->getGlobalNumCols() << "]";
385 os << ", Global nnz: " << mat_->getGlobalNumEntries();
386 }
387 return os.str();
388}
389
390template<typename Scalar, typename LocalOrdinal, typename GlobalOrdinal, typename Node>
392setMatrix(const Teuchos::RCP<const TRowMatrix>& A)
393{
394 if(A.is_null())
395 {
396 throw std::invalid_argument(std::string("Ifpack2::Details::") + getName() + "::setMatrix() called with a null matrix. Pass a non-null matrix.");
397 }
398 //bmk note: this modeled after RILUK::setMatrix
399 if(mat_.get() != A.get())
400 {
401 mat_ = A;
402 initFlag_ = false;
403 computedFlag_ = false;
404 }
405}
406
407template<typename Scalar, typename LocalOrdinal, typename GlobalOrdinal, typename Node>
408typename FastILU_Base<Scalar, LocalOrdinal, GlobalOrdinal, Node>::Params
411{
412 Params p;
413 p.use_metis = false;
414 p.sptrsv_algo = FastILU::SpTRSV::Fast;
415 p.nFact = 5; // # of sweeps for computing fastILU
416 p.nTrisol = 5; // # of sweeps for applying fastSpTRSV
417 p.level = 0; // level of ILU
418 p.omega = 1.0; // damping factor for fastILU
419 p.shift = 0;
420 p.guessFlag = true;
421 p.blockSizeILU = 1; // # of nonzeros / thread, for fastILU
422 p.blockSize = 1; // # of rows / thread, for SpTRSV
423 return p;
424}
425
426template<typename Scalar, typename LocalOrdinal, typename GlobalOrdinal, typename Node>
427FastILU_Base<Scalar, LocalOrdinal, GlobalOrdinal, Node>::
428Params::Params(const Teuchos::ParameterList& pL, std::string precType)
429{
430 *this = getDefaults();
431 typedef typename Teuchos::ScalarTraits<Scalar>::magnitudeType magnitude;
432 //For each parameter, check that if the parameter exists, it has the right type
433 //Then get the value and sanity check it
434 //If the parameter doesn't exist, leave it as default (from Params::getDefaults())
435 //"sweeps" aka nFact
436 #define TYPE_ERROR(name, correctTypeName) {throw std::invalid_argument(precType + "::setParameters(): parameter \"" + name + "\" has the wrong type (must be " + correctTypeName + ")");}
437 #define CHECK_VALUE(param, member, cond, msg) {if(cond) {throw std::invalid_argument(precType + "::setParameters(): parameter \"" + param + "\" has value " + std::to_string(member) + " but " + msg);}}
438
439 //metis
440 if(pL.isParameter("metis"))
441 {
442 if(pL.isType<bool>("metis"))
443 use_metis = pL.get<bool>("metis");
444 else
445 TYPE_ERROR("metis", "bool");
446 }
447
448 if(pL.isParameter("sweeps"))
449 {
450 if(pL.isType<int>("sweeps"))
451 {
452 nFact = pL.get<int>("sweeps");
453 CHECK_VALUE("sweeps", nFact, nFact < 1, "must have a value of at least 1");
454 }
455 else
456 TYPE_ERROR("sweeps", "int");
457 }
458 std::string sptrsv_type = "Fast";
459 if(pL.isParameter("triangular solve type")) {
460 sptrsv_type = pL.get<std::string> ("triangular solve type");
461 }
462 if (sptrsv_type == "Standard Host") {
463 sptrsv_algo = FastILU::SpTRSV::StandardHost;
464 } else if (sptrsv_type == "Standard") {
465 sptrsv_algo = FastILU::SpTRSV::Standard;
466 }
467
468 //"triangular solve iterations" aka nTrisol
469 if(pL.isParameter("triangular solve iterations"))
470 {
471 if(pL.isType<int>("triangular solve iterations"))
472 {
473 nTrisol = pL.get<int>("triangular solve iterations");
474 CHECK_VALUE("triangular solve iterations", nTrisol, nTrisol < 1, "must have a value of at least 1");
475 }
476 else
477 TYPE_ERROR("triangular solve iterations", "int");
478 }
479 //"level"
480 if(pL.isParameter("level"))
481 {
482 if(pL.isType<int>("level"))
483 {
484 level = pL.get<int>("level");
485 }
486 else if(pL.isType<double>("level"))
487 {
488 //Level can be read as double (like in ILUT), but must be an exact integer
489 //Any integer used for level-of-fill can be represented exactly in double (so use exact compare)
490 double dval = pL.get<double>("level");
491 double ipart;
492 double fpart = modf(dval, &ipart);
493 level = ipart;
494 CHECK_VALUE("level", level, fpart != 0, "must be an integral value");
495 }
496 else
497 {
498 TYPE_ERROR("level", "int");
499 }
500 CHECK_VALUE("level", level, level < 0, "must be nonnegative");
501 }
502 //"damping factor" aka omega -- try both double and magnitude as type
503 if(pL.isParameter("damping factor"))
504 {
505 if(pL.isType<double>("damping factor"))
506 omega = pL.get<double>("damping factor");
507 else if(pL.isType<magnitude>("damping factor"))
508 omega = pL.get<magnitude>("damping factor");
509 else
510 TYPE_ERROR("damping factor", "double or magnitude_type");
511 CHECK_VALUE("damping factor", omega, omega <= 0 || omega > 1, "must be in the range (0, 1]");
512 }
513 //"shift" -- also try both double and magnitude
514 if(pL.isParameter("shift"))
515 {
516 if(pL.isType<double>("shift"))
517 shift = pL.get<double>("shift");
518 else if(pL.isType<magnitude>("shift"))
519 shift = pL.get<magnitude>("shift");
520 else
521 TYPE_ERROR("shift", "double or magnitude_type");
522 //no hard requirements for shift value so don't
523 }
524 //"guess" aka guessFlag
525 if(pL.isParameter("guess"))
526 {
527 if(pL.isType<bool>("guess"))
528 guessFlag = pL.get<bool>("guess");
529 else
530 TYPE_ERROR("guess", "bool");
531 }
532 //"block size" aka blkSz
533 if(pL.isParameter("block size for ILU"))
534 {
535 if(pL.isType<int>("block size for ILU"))
536 {
537 blockSizeILU = pL.get<int>("block size for ILU");
538 CHECK_VALUE("block size for ILU", blockSizeILU, blockSizeILU < 1, "must have a value of at least 1");
539 }
540 else
541 TYPE_ERROR("block size for ILU", "int");
542 }
543 //"block size" aka blkSz
544 if(pL.isParameter("block size for SpTRSV"))
545 {
546 if(pL.isType<int>("block size for SpTRSV"))
547 blockSize = pL.get<int>("block size for SpTRSV");
548 else
549 TYPE_ERROR("block size for SpTRSV", "int");
550 }
551 #undef CHECK_VALUE
552 #undef TYPE_ERROR
553}
554
555#define IFPACK2_DETAILS_FASTILU_BASE_INSTANT(S, L, G, N) \
556template class Ifpack2::Details::FastILU_Base<S, L, G, N>;
557
558} //namespace Details
559} //namespace Ifpack2
560
561#endif
562
Provides functions for retrieving local CRS arrays (row pointers, column indices, and values) from Tp...
The base class of the Ifpack2 FastILU wrappers (Filu, Fildl and Fic)
Definition Ifpack2_Details_FastILU_Base_decl.hpp:74
Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node >::impl_scalar_type ImplScalar
Kokkos scalar type.
Definition Ifpack2_Details_FastILU_Base_decl.hpp:81
double getInitializeTime() const
Get the time spent in the last initialize() call.
Definition Ifpack2_Details_FastILU_Base_def.hpp:323
virtual void checkLocalILU() const
Verify and print debug information about the underlying ILU preconditioner (only supported if this is...
Definition Ifpack2_Details_FastILU_Base_def.hpp:351
void setMatrix(const Teuchos::RCP< const TRowMatrix > &A)
Definition Ifpack2_Details_FastILU_Base_def.hpp:392
void compute()
Compute the preconditioner.
Definition Ifpack2_Details_FastILU_Base_def.hpp:262
double getComputeTime() const
Get the time spent in the last compute() call.
Definition Ifpack2_Details_FastILU_Base_def.hpp:330
double getCopyTime() const
Get the time spent deep copying local 3-array CRS out of the matrix.
Definition Ifpack2_Details_FastILU_Base_def.hpp:344
int getNumApply() const
Get the number of times apply() was called.
Definition Ifpack2_Details_FastILU_Base_def.hpp:316
void initialize()
Initialize the preconditioner.
Definition Ifpack2_Details_FastILU_Base_def.hpp:158
bool isInitialized() const
Whether initialize() has been called since the last time the matrix's structure was changed.
Definition Ifpack2_Details_FastILU_Base_def.hpp:255
FastILU_Base(Teuchos::RCP< const TRowMatrix > mat_)
Constructor.
Definition Ifpack2_Details_FastILU_Base_def.hpp:61
void setParameters(const Teuchos::ParameterList &List)
Validate parameters, and set defaults when parameters are not provided.
Definition Ifpack2_Details_FastILU_Base_def.hpp:150
void apply(const TMultiVec &X, TMultiVec &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, Scalar alpha=Teuchos::ScalarTraits< Scalar >::one(), Scalar beta=Teuchos::ScalarTraits< Scalar >::zero()) const
Apply the preconditioner.
Definition Ifpack2_Details_FastILU_Base_def.hpp:92
double getApplyTime() const
Get the time spent in the last apply() call.
Definition Ifpack2_Details_FastILU_Base_def.hpp:337
Teuchos::RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const
Get the domain map of the matrix.
Definition Ifpack2_Details_FastILU_Base_def.hpp:77
virtual void checkLocalIC() const
Verify and print debug information about the underlying IC preconditioner.
Definition Ifpack2_Details_FastILU_Base_def.hpp:359
int getNumInitialize() const
Get the number of times initialize() was called.
Definition Ifpack2_Details_FastILU_Base_def.hpp:302
Teuchos::RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const
Get the range map of the matrix.
Definition Ifpack2_Details_FastILU_Base_def.hpp:85
Teuchos::RCP< const TRowMatrix > getMatrix() const
Get the current matrix.
Definition Ifpack2_Details_FastILU_Base_def.hpp:295
Kokkos::View< LocalOrdinal *, execution_space >::HostMirror OrdinalArrayHost
Array of LocalOrdinal on host.
Definition Ifpack2_Details_FastILU_Base_decl.hpp:93
std::string description() const
Return a brief description of the preconditioner, in YAML format.
Definition Ifpack2_Details_FastILU_Base_def.hpp:366
Kokkos::View< ImplScalar *, execution_space > ImplScalarArray
Array of Scalar on device.
Definition Ifpack2_Details_FastILU_Base_decl.hpp:95
int getNumCompute() const
Get the number of times compute() was called.
Definition Ifpack2_Details_FastILU_Base_def.hpp:309
bool isComputed() const
Whether compute() has been called since the last time the matrix's values or structure were changed.
Definition Ifpack2_Details_FastILU_Base_def.hpp:287
Ifpack2 implementation details.
Preconditioners and smoothers for Tpetra sparse matrices.
Definition Ifpack2_AdditiveSchwarz_decl.hpp:74