10#ifndef IFPACK2_MDF_DEF_HPP
11#define IFPACK2_MDF_DEF_HPP
13#include "Ifpack2_LocalFilter.hpp"
15#include "Tpetra_CrsMatrix.hpp"
16#include "Teuchos_StandardParameterEntryValidators.hpp"
17#include "Ifpack2_LocalSparseTriangularSolver.hpp"
18#include "Ifpack2_Details_getParamTryingTypes.hpp"
19#include "Kokkos_Core.hpp"
20#include "Kokkos_Sort.hpp"
21#include "KokkosKernels_Sorting.hpp"
32template<
class dev_view_t>
33auto copy_view(
const dev_view_t & vals)
35 using Kokkos::view_alloc;
36 using Kokkos::WithoutInitializing;
37 typename dev_view_t::non_const_type newvals (view_alloc (vals.label(), WithoutInitializing), vals.extent (0));
38 Kokkos::deep_copy(newvals,vals);
42template<
class array_t,
class dev_view_t>
43void copy_dev_view_to_host_array(array_t & array,
const dev_view_t & dev_view)
45 using host_view_t =
typename dev_view_t::HostMirror;
48 const auto ext = dev_view.extent(0);
50 TEUCHOS_TEST_FOR_EXCEPTION(
51 ext !=
size_t(array.size()), std::logic_error,
"Ifpack2::MDF::copy_dev_view_to_host_array: "
52 "Size of permuations on host and device do not match. "
53 "Please report this bug to the Ifpack2 developers.");
56 Kokkos::deep_copy(host_view_t(array.get(),ext),dev_view);
59template<
class scalar_type,
class local_ordinal_type,
class global_ordinal_type,
class node_type>
60void applyReorderingPermutations(
61 const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
62 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
63 const Teuchos::ArrayRCP<local_ordinal_type> & perm)
65 TEUCHOS_TEST_FOR_EXCEPTION(X.getNumVectors() != Y.getNumVectors(), std::runtime_error,
66 "Ifpack2::MDF::applyReorderingPermuations ERROR: X.getNumVectors() != Y.getNumVectors().");
68 Teuchos::ArrayRCP<Teuchos::ArrayRCP<const scalar_type> > x_ptr = X.get2dView();
69 Teuchos::ArrayRCP<Teuchos::ArrayRCP<scalar_type> > y_ptr = Y.get2dViewNonConst();
71 for(
size_t k=0; k < X.getNumVectors(); k++)
72 for(local_ordinal_type i=0; (size_t)i< X.getLocalLength(); i++)
73 y_ptr[k][perm[i]] = x_ptr[k][i];
77template<
class scalar_type,
class local_ordinal_type,
class global_ordinal_type,
class node_type>
78auto get_local_crs_row_matrix(
79 Teuchos::RCP<
const Tpetra::RowMatrix<scalar_type,local_ordinal_type,global_ordinal_type,node_type>> A_local)
84 using Teuchos::rcp_const_cast;
85 using Teuchos::rcp_dynamic_cast;
87 using crs_matrix_type = Tpetra::CrsMatrix<scalar_type, local_ordinal_type, global_ordinal_type, node_type>;
89 using nonconst_local_inds_host_view_type =
typename crs_matrix_type::nonconst_local_inds_host_view_type;
90 using nonconst_values_host_view_type =
typename crs_matrix_type::nonconst_values_host_view_type;
92 RCP<const crs_matrix_type> A_local_crs = rcp_dynamic_cast<const crs_matrix_type>(A_local);
93 if (A_local_crs.is_null ()) {
94 local_ordinal_type numRows = A_local->getLocalNumRows();
95 Array<size_t> entriesPerRow(numRows);
96 for(local_ordinal_type i = 0; i < numRows; i++) {
97 entriesPerRow[i] = A_local->getNumEntriesInLocalRow(i);
99 RCP<crs_matrix_type> A_local_crs_nc =
100 rcp (
new crs_matrix_type (A_local->getRowMap (),
101 A_local->getColMap (),
104 nonconst_local_inds_host_view_type indices(
"indices",A_local->getLocalMaxNumRowEntries());
105 nonconst_values_host_view_type values(
"values",A_local->getLocalMaxNumRowEntries());
106 for(local_ordinal_type i = 0; i < numRows; i++) {
107 size_t numEntries = 0;
108 A_local->getLocalRowCopy(i, indices, values, numEntries);
109 A_local_crs_nc->insertLocalValues(i, numEntries,
reinterpret_cast<scalar_type*
>(values.data()), indices.data());
111 A_local_crs_nc->fillComplete (A_local->getDomainMap (), A_local->getRangeMap ());
112 A_local_crs = rcp_const_cast<const crs_matrix_type> (A_local_crs_nc);
124template<
class MatrixType>
125MDF<MatrixType>::MDF (
const Teuchos::RCP<const row_matrix_type>& Matrix_in)
130 isAllocated_ (false),
131 isInitialized_ (false),
136 initializeTime_ (0.0),
141 allocatePermutations();
145template<
class MatrixType>
146MDF<MatrixType>::MDF (
const Teuchos::RCP<const crs_matrix_type>& Matrix_in)
151 isAllocated_ (false),
152 isInitialized_ (false),
157 initializeTime_ (0.0),
162 allocatePermutations();
165template<
class MatrixType>
166void MDF<MatrixType>::allocatePermutations (
bool force)
168 if (A_.is_null())
return;
171 if (force || permutations_.is_null() || A_->getLocalNumRows() !=
size_t(permutations_.size()))
173 permutations_ = Teuchos::null;
174 reversePermutations_ = Teuchos::null;
175 permutations_ = permutations_type(A_->getLocalNumRows());
176 reversePermutations_ = permutations_type(A_->getLocalNumRows());
180template<
class MatrixType>
181void MDF<MatrixType>::allocateSolvers ()
183 L_solver_ = Teuchos::null;
184 U_solver_ = Teuchos::null;
186 L_solver_->setObjectLabel(
"lower");
188 U_solver_->setObjectLabel(
"upper");
191template<
class MatrixType>
199 if (A.getRawPtr () !=
A_.getRawPtr ()) {
200 isAllocated_ =
false;
201 isInitialized_ =
false;
204 MDF_handle_ = Teuchos::null;
222 allocatePermutations(
true);
228template<
class MatrixType>
232 TEUCHOS_TEST_FOR_EXCEPTION(
233 L_.is_null (), std::runtime_error,
"Ifpack2::MDF::getL: The L factor "
234 "is null. Please call initialize() and compute() "
235 "before calling this method. If the input matrix has not yet been set, "
236 "you must first call setMatrix() with a nonnull input matrix before you "
237 "may call initialize() or compute().");
241template<
class MatrixType>
242typename MDF<MatrixType>::permutations_type &
245 TEUCHOS_TEST_FOR_EXCEPTION(
246 permutations_.is_null (), std::runtime_error,
"Ifpack2::MDF::getPermutations: "
247 "The permulations are null. Please call initialize() and compute() "
248 "before calling this method. If the input matrix has not yet been set, "
249 "you must first call setMatrix() with a nonnull input matrix before you "
250 "may call initialize() or compute().");
253template<
class MatrixType>
254typename MDF<MatrixType>::permutations_type &
257 TEUCHOS_TEST_FOR_EXCEPTION(
259 "The permulations are null. Please call initialize() and compute() "
260 "before calling this method. If the input matrix has not yet been set, "
261 "you must first call setMatrix() with a nonnull input matrix before you "
262 "may call initialize() or compute().");
266template<
class MatrixType>
270 TEUCHOS_TEST_FOR_EXCEPTION(
271 U_.is_null (), std::runtime_error,
"Ifpack2::MDF::getU: The U factor "
272 "is null. Please call initialize() and compute() "
273 "before calling this method. If the input matrix has not yet been set, "
274 "you must first call setMatrix() with a nonnull input matrix before you "
275 "may call initialize() or compute().");
280template<
class MatrixType>
282 TEUCHOS_TEST_FOR_EXCEPTION(
283 A_.is_null (), std::runtime_error,
"Ifpack2::MDF::getNodeSmootherComplexity: "
284 "The input matrix A is null. Please call setMatrix() with a nonnull "
285 "input matrix, then call compute(), before calling this method.");
287 if(!
L_.is_null() && !
U_.is_null())
288 return A_->getLocalNumEntries() +
L_->getLocalNumEntries() +
U_->getLocalNumEntries();
294template<
class MatrixType>
295Teuchos::RCP<const Tpetra::Map<typename MDF<MatrixType>::local_ordinal_type,
299 TEUCHOS_TEST_FOR_EXCEPTION(
300 A_.is_null (), std::runtime_error,
"Ifpack2::MDF::getDomainMap: "
301 "The matrix is null. Please call setMatrix() with a nonnull input "
302 "before calling this method.");
305 TEUCHOS_TEST_FOR_EXCEPTION(
306 L_.is_null (), std::runtime_error,
"Ifpack2::MDF::getDomainMap: "
307 "The computed graph is null. Please call initialize() and compute() before calling "
309 return L_->getDomainMap ();
313template<
class MatrixType>
314Teuchos::RCP<const Tpetra::Map<typename MDF<MatrixType>::local_ordinal_type,
318 TEUCHOS_TEST_FOR_EXCEPTION(
319 A_.is_null (), std::runtime_error,
"Ifpack2::MDF::getRangeMap: "
320 "The matrix is null. Please call setMatrix() with a nonnull input "
321 "before calling this method.");
324 TEUCHOS_TEST_FOR_EXCEPTION(
325 L_.is_null (), std::runtime_error,
"Ifpack2::MDF::getRangeMap: "
326 "The computed graph is null. Please call initialize() abd compute() before calling "
328 return L_->getRangeMap ();
331template<
class MatrixType>
337 using Teuchos::ParameterList;
338 using Teuchos::Array;
339 using Details::getParamTryingTypes;
340 const char prefix[] =
"Ifpack2::MDF: ";
344 double overalloc = 2.;
356 const std::string paramName (
"fact: mdf level-of-fill");
357 getParamTryingTypes<int, int, global_ordinal_type, double, float>
358 (fillLevel, params, paramName, prefix);
360 TEUCHOS_TEST_FOR_EXCEPTION
361 (fillLevel != 0, std::runtime_error, prefix <<
"MDF with level of fill != 0 is not yet implemented.");
364 const std::string paramName (
"Verbosity");
365 getParamTryingTypes<int, int, global_ordinal_type, double, float>
366 (verbosity, params, paramName, prefix);
369 const std::string paramName (
"fact: mdf overalloc");
370 getParamTryingTypes<double, double>
371 (overalloc, params, paramName, prefix);
382 LevelOfFill_ = fillLevel;
383 Overalloc_ = overalloc;
384 Verbosity_ = verbosity;
388template<
class MatrixType>
389Teuchos::RCP<const typename MDF<MatrixType>::row_matrix_type>
391 return Teuchos::rcp_implicit_cast<const row_matrix_type> (
A_);
395template<
class MatrixType>
396Teuchos::RCP<const typename MDF<MatrixType>::crs_matrix_type>
398 return Teuchos::rcp_dynamic_cast<const crs_matrix_type> (
A_,
true);
402template<
class MatrixType>
403Teuchos::RCP<const typename MDF<MatrixType>::row_matrix_type>
404MDF<MatrixType>::makeLocalFilter (
const Teuchos::RCP<const row_matrix_type>& A)
408 using Teuchos::rcp_dynamic_cast;
409 using Teuchos::rcp_implicit_cast;
414 if (A->getRowMap ()->getComm ()->getSize () == 1 ||
415 A->getRowMap ()->isSameAs (* (A->getColMap ()))) {
422 RCP<const LocalFilter<row_matrix_type> > A_lf_r =
423 rcp_dynamic_cast<const LocalFilter<row_matrix_type> > (A);
424 if (! A_lf_r.is_null ()) {
425 return rcp_implicit_cast<const row_matrix_type> (A_lf_r);
436template<
class MatrixType>
441 using Teuchos::rcp_const_cast;
442 using Teuchos::rcp_dynamic_cast;
443 using Teuchos::rcp_implicit_cast;
444 using Teuchos::Array;
445 using Teuchos::ArrayView;
446 const char prefix[] =
"Ifpack2::MDF::initialize: ";
448 TEUCHOS_TEST_FOR_EXCEPTION
449 (
A_.is_null (), std::runtime_error, prefix <<
"The matrix is null. Please "
450 "call setMatrix() with a nonnull input before calling this method.");
451 TEUCHOS_TEST_FOR_EXCEPTION
452 (!
A_->isFillComplete (), std::runtime_error, prefix <<
"The matrix is not "
453 "fill complete. You may not invoke initialize() or compute() with this "
454 "matrix until the matrix is fill complete. If your matrix is a "
455 "Tpetra::CrsMatrix, please call fillComplete on it (with the domain and "
456 "range Maps, if appropriate) before calling this method.");
458 Teuchos::Time timer (
"MDF::initialize");
459 double startTime = timer.wallTime();
461 Teuchos::TimeMonitor timeMon (timer);
470 isInitialized_ =
false;
471 isAllocated_ =
false;
473 MDF_handle_ = Teuchos::null;
476 TEUCHOS_TEST_FOR_EXCEPTION(
477 A_local_.is_null (), std::logic_error,
"Ifpack2::MDF::initialize: "
478 "makeLocalFilter returned null; it failed to compute A_local. "
479 "Please report this bug to the Ifpack2 developers.");
487 RCP<const crs_matrix_type> A_local_crs = Details::MDFImpl::get_local_crs_row_matrix(
A_local_);
489 auto A_local_device = A_local_crs->getLocalMatrixDevice();
490 MDF_handle_ = rcp(
new MDF_handle_device_type(A_local_device) );
491 MDF_handle_->set_verbosity(Verbosity_);
493 KokkosSparse::Experimental::mdf_symbolic(A_local_device,*MDF_handle_);
498 checkOrderingConsistency (*
A_local_);
501 isInitialized_ =
true;
503 initializeTime_ += (timer.wallTime() - startTime);
506template<
class MatrixType>
514 Teuchos::ArrayView<const global_ordinal_type> rowGIDs = A.getRowMap()->getLocalElementList();
515 Teuchos::ArrayView<const global_ordinal_type> colGIDs = A.getColMap()->getLocalElementList();
516 bool gidsAreConsistentlyOrdered=
true;
519 if (rowGIDs[i] != colGIDs[i]) {
520 gidsAreConsistentlyOrdered=
false;
521 indexOfInconsistentGID=i;
525 TEUCHOS_TEST_FOR_EXCEPTION(gidsAreConsistentlyOrdered==
false, std::runtime_error,
526 "The ordering of the local GIDs in the row and column maps is not the same"
527 << std::endl <<
"at index " << indexOfInconsistentGID
528 <<
". Consistency is required, as all calculations are done with"
529 << std::endl <<
"local indexing.");
532template<
class MatrixType>
537 using Teuchos::rcp_const_cast;
538 using Teuchos::rcp_dynamic_cast;
539 using Teuchos::Array;
540 using Teuchos::ArrayView;
541 const char prefix[] =
"Ifpack2::MDF::compute: ";
546 TEUCHOS_TEST_FOR_EXCEPTION
547 (
A_.is_null (), std::runtime_error, prefix <<
"The matrix is null. Please "
548 "call setMatrix() with a nonnull input before calling this method.");
549 TEUCHOS_TEST_FOR_EXCEPTION
550 (!
A_->isFillComplete (), std::runtime_error, prefix <<
"The matrix is not "
551 "fill complete. You may not invoke initialize() or compute() with this "
552 "matrix until the matrix is fill complete. If your matrix is a "
553 "Tpetra::CrsMatrix, please call fillComplete on it (with the domain and "
554 "range Maps, if appropriate) before calling this method.");
560 Teuchos::Time timer (
"MDF::compute");
563 Teuchos::TimeMonitor timeMon (timer);
564 double startTime = timer.wallTime();
569 RCP<const crs_matrix_type> A_local_crs = Details::MDFImpl::get_local_crs_row_matrix(
A_local_);
572 auto A_local_device = A_local_crs->getLocalMatrixDevice();
574 KokkosSparse::Experimental::mdf_numeric(A_local_device,*MDF_handle_);
579 Details::MDFImpl::copy_dev_view_to_host_array(
permutations_, MDF_handle_->permutation_inv);
584 auto L_mdf = MDF_handle_->getL();
588 Details::MDFImpl::copy_view(L_mdf.graph.row_map),
589 Details::MDFImpl::copy_view(L_mdf.graph.entries),
590 Details::MDFImpl::copy_view(L_mdf.values)
594 auto U_mdf = MDF_handle_->getU();
598 Details::MDFImpl::copy_view(U_mdf.graph.row_map),
599 Details::MDFImpl::copy_view(U_mdf.graph.entries),
600 Details::MDFImpl::copy_view(U_mdf.values)
614 computeTime_ += (timer.wallTime() - startTime);
617template<
class MatrixType>
620apply_impl (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
621 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
622 Teuchos::ETransp mode,
624 scalar_type beta)
const
626 const scalar_type one = STS::one ();
627 const scalar_type zero = STS::zero ();
629 if (alpha == one && beta == zero) {
630 MV tmp (Y.getMap (), Y.getNumVectors ());
631 Details::MDFImpl::applyReorderingPermutations(X,tmp,permutations_);
632 if (mode == Teuchos::NO_TRANS) {
634 L_solver_->apply (tmp, Y, mode);
635 U_solver_->apply (Y, tmp, mode);
639 U_solver_->apply (tmp, Y, mode);
640 L_solver_->apply (Y, tmp, mode);
642 Details::MDFImpl::applyReorderingPermutations(tmp,Y,reversePermutations_);
655 MV Y_tmp (Y.getMap (), Y.getNumVectors ());
656 apply_impl (X, Y_tmp, mode);
657 Y.update (alpha, Y_tmp, beta);
662template<
class MatrixType>
665apply (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
666 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
667 Teuchos::ETransp mode,
672 using Teuchos::rcpFromRef;
674 TEUCHOS_TEST_FOR_EXCEPTION(
675 A_.is_null (), std::runtime_error,
"Ifpack2::MDF::apply: The matrix is "
676 "null. Please call setMatrix() with a nonnull input, then initialize() "
677 "and compute(), before calling this method.");
678 TEUCHOS_TEST_FOR_EXCEPTION(
680 "Ifpack2::MDF::apply: If you have not yet called compute(), "
681 "you must call compute() before calling this method.");
682 TEUCHOS_TEST_FOR_EXCEPTION(
683 X.getNumVectors () != Y.getNumVectors (), std::invalid_argument,
684 "Ifpack2::MDF::apply: X and Y do not have the same number of columns. "
685 "X.getNumVectors() = " << X.getNumVectors ()
686 <<
" != Y.getNumVectors() = " << Y.getNumVectors () <<
".");
687 TEUCHOS_TEST_FOR_EXCEPTION(
688 STS::isComplex && mode == Teuchos::CONJ_TRANS, std::logic_error,
689 "Ifpack2::MDF::apply: mode = Teuchos::CONJ_TRANS is not implemented for "
690 "complex Scalar type. Please talk to the Ifpack2 developers to get this "
691 "fixed. There is a FIXME in this file about this very issue.");
692#ifdef HAVE_IFPACK2_DEBUG
694 Teuchos::Array<magnitude_type> norms (X.getNumVectors ());
697 for (
size_t j = 0; j < X.getNumVectors (); ++j) {
698 if (STM::isnaninf (norms[j])) {
703 TEUCHOS_TEST_FOR_EXCEPTION( ! good, std::runtime_error,
"Ifpack2::MDF::apply: The 1-norm of the input X is NaN or Inf.");
707 Teuchos::Time timer (
"MDF::apply");
708 double startTime = timer.wallTime();
710 Teuchos::TimeMonitor timeMon (timer);
711 apply_impl(X,Y,mode,alpha,beta);
714#ifdef HAVE_IFPACK2_DEBUG
716 Teuchos::Array<magnitude_type> norms (Y.getNumVectors ());
719 for (
size_t j = 0; j < Y.getNumVectors (); ++j) {
720 if (STM::isnaninf (norms[j])) {
725 TEUCHOS_TEST_FOR_EXCEPTION( ! good, std::runtime_error,
"Ifpack2::MDF::apply: The 1-norm of the output Y is NaN or Inf.");
730 applyTime_ += (timer.wallTime() - startTime);
733template<
class MatrixType>
736 std::ostringstream os;
741 os <<
"\"Ifpack2::MDF\": {";
742 os <<
"Initialized: " << (
isInitialized () ?
"true" :
"false") <<
", "
743 <<
"Computed: " << (
isComputed () ?
"true" :
"false") <<
", ";
748 os <<
"Matrix: null";
751 os <<
"Global matrix dimensions: ["
752 <<
A_->getGlobalNumRows () <<
", " <<
A_->getGlobalNumCols () <<
"]"
753 <<
", Global nnz: " <<
A_->getGlobalNumEntries();
765#define IFPACK2_MDF_INSTANT(S,LO,GO,N) \
766 template class Ifpack2::MDF< Tpetra::RowMatrix<S, LO, GO, N> >;
Ifpack2::ScalingType enumerable type.
Access only local rows and columns of a sparse matrix.
Definition Ifpack2_LocalFilter_decl.hpp:131
"Preconditioner" that solves local sparse triangular systems.
Definition Ifpack2_LocalSparseTriangularSolver_decl.hpp:55
MDF (incomplete LU factorization with minimum discarded fill reordering) of a Tpetra sparse matrix.
Definition Ifpack2_MDF_decl.hpp:59
void setParameters(const Teuchos::ParameterList ¶ms)
Definition Ifpack2_MDF_def.hpp:334
const crs_matrix_type & getL() const
Return the L factor of the MDF factorization.
Definition Ifpack2_MDF_def.hpp:230
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_MDF_def.hpp:665
int getLevelOfFill() const
Get level of fill (the "k" in ILU(k)).
Definition Ifpack2_MDF_decl.hpp:335
Teuchos::RCP< LocalSparseTriangularSolver< row_matrix_type > > L_solver_
Sparse triangular solver for L.
Definition Ifpack2_MDF_decl.hpp:403
bool isComputed() const
Whether compute() has been called on this object.
Definition Ifpack2_MDF_decl.hpp:176
permutations_type & getReversePermutations() const
Return the reverse permutations of the MDF factorization.
Definition Ifpack2_MDF_def.hpp:255
permutations_type reversePermutations_
The reverse permuations from MDF factorization.
Definition Ifpack2_MDF_decl.hpp:413
const crs_matrix_type & getU() const
Return the U factor of the MDF factorization.
Definition Ifpack2_MDF_def.hpp:268
void compute()
Compute the (numeric) incomplete factorization.
Definition Ifpack2_MDF_def.hpp:533
Teuchos::RCP< crs_matrix_type > U_
The U (upper triangular) factor of ILU(k).
Definition Ifpack2_MDF_decl.hpp:405
bool isInitialized() const
Whether initialize() has been called on this object.
Definition Ifpack2_MDF_decl.hpp:172
Teuchos::RCP< const row_matrix_type > A_local_
The matrix whos numbers are used to to compute ILU(k). The graph may be computed using a crs_matrix_t...
Definition Ifpack2_MDF_decl.hpp:395
void initialize()
Initialize by computing the symbolic incomplete factorization.
Definition Ifpack2_MDF_def.hpp:437
std::string description() const
A one-line description of this object.
Definition Ifpack2_MDF_def.hpp:734
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_MDF_def.hpp:317
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_MDF_decl.hpp:95
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_MDF_def.hpp:298
Teuchos::RCP< const crs_matrix_type > getCrsMatrix() const
Return the input matrix A as a Tpetra::CrsMatrix, if possible; else throws.
Definition Ifpack2_MDF_def.hpp:397
MatrixType::node_type node_type
The Node type used by the input MatrixType.
Definition Ifpack2_MDF_decl.hpp:71
MatrixType::global_ordinal_type global_ordinal_type
The type of global indices in the input MatrixType.
Definition Ifpack2_MDF_decl.hpp:68
permutations_type permutations_
The computed permuations from MDF factorization.
Definition Ifpack2_MDF_decl.hpp:410
Teuchos::RCP< LocalSparseTriangularSolver< row_matrix_type > > U_solver_
Sparse triangular solver for U.
Definition Ifpack2_MDF_decl.hpp:407
MatrixType::scalar_type scalar_type
The type of the entries of the input MatrixType.
Definition Ifpack2_MDF_decl.hpp:62
Teuchos::RCP< const row_matrix_type > getMatrix() const
Get the input matrix.
Definition Ifpack2_MDF_def.hpp:390
virtual void setMatrix(const Teuchos::RCP< const row_matrix_type > &A)
Change the matrix to be preconditioned.
Definition Ifpack2_MDF_def.hpp:193
size_t getNodeSmootherComplexity() const
Get a rough estimate of cost per iteration.
Definition Ifpack2_MDF_def.hpp:281
Teuchos::RCP< crs_matrix_type > L_
The L (lower triangular) factor of ILU(k).
Definition Ifpack2_MDF_decl.hpp:401
Teuchos::RCP< const row_matrix_type > A_
The (original) input matrix for which to compute ILU(k).
Definition Ifpack2_MDF_decl.hpp:387
permutations_type & getPermutations() const
Return the permutations of the MDF factorization.
Definition Ifpack2_MDF_def.hpp:243
Preconditioners and smoothers for Tpetra sparse matrices.
Definition Ifpack2_AdditiveSchwarz_decl.hpp:41