41#ifndef IFPACK2_MDF_DEF_HPP
42#define IFPACK2_MDF_DEF_HPP
44#include "Ifpack2_LocalFilter.hpp"
46#include "Tpetra_CrsMatrix.hpp"
47#include "Teuchos_StandardParameterEntryValidators.hpp"
48#include "Ifpack2_LocalSparseTriangularSolver.hpp"
49#include "Ifpack2_Details_getParamTryingTypes.hpp"
50#include "Kokkos_Core.hpp"
51#include "Kokkos_Sort.hpp"
52#include "KokkosKernels_Sorting.hpp"
63template<
class dev_view_t>
64auto copy_view(
const dev_view_t & vals)
66 using Kokkos::view_alloc;
67 using Kokkos::WithoutInitializing;
68 typename dev_view_t::non_const_type newvals (view_alloc (vals.label(), WithoutInitializing), vals.extent (0));
69 Kokkos::deep_copy(newvals,vals);
73template<
class array_t,
class dev_view_t>
74void copy_dev_view_to_host_array(array_t & array,
const dev_view_t & dev_view)
76 using host_view_t =
typename dev_view_t::HostMirror;
79 const auto ext = dev_view.extent(0);
81 TEUCHOS_TEST_FOR_EXCEPTION(
82 ext !=
size_t(array.size()), std::logic_error,
"Ifpack2::MDF::copy_dev_view_to_host_array: "
83 "Size of permuations on host and device do not match. "
84 "Please report this bug to the Ifpack2 developers.");
87 Kokkos::deep_copy(host_view_t(array.get(),ext),dev_view);
90template<
class scalar_type,
class local_ordinal_type,
class global_ordinal_type,
class node_type>
91void applyReorderingPermutations(
92 const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
93 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
94 const Teuchos::ArrayRCP<local_ordinal_type> & perm)
96 TEUCHOS_TEST_FOR_EXCEPTION(X.getNumVectors() != Y.getNumVectors(), std::runtime_error,
97 "Ifpack2::MDF::applyReorderingPermuations ERROR: X.getNumVectors() != Y.getNumVectors().");
99 Teuchos::ArrayRCP<Teuchos::ArrayRCP<const scalar_type> > x_ptr = X.get2dView();
100 Teuchos::ArrayRCP<Teuchos::ArrayRCP<scalar_type> > y_ptr = Y.get2dViewNonConst();
102 for(
size_t k=0; k < X.getNumVectors(); k++)
103 for(local_ordinal_type i=0; (size_t)i< X.getLocalLength(); i++)
104 y_ptr[k][perm[i]] = x_ptr[k][i];
108template<
class scalar_type,
class local_ordinal_type,
class global_ordinal_type,
class node_type>
109auto get_local_crs_row_matrix(
110 Teuchos::RCP<
const Tpetra::RowMatrix<scalar_type,local_ordinal_type,global_ordinal_type,node_type>> A_local)
114 using Teuchos::Array;
115 using Teuchos::rcp_const_cast;
116 using Teuchos::rcp_dynamic_cast;
118 using crs_matrix_type = Tpetra::CrsMatrix<scalar_type, local_ordinal_type, global_ordinal_type, node_type>;
120 using nonconst_local_inds_host_view_type =
typename crs_matrix_type::nonconst_local_inds_host_view_type;
121 using nonconst_values_host_view_type =
typename crs_matrix_type::nonconst_values_host_view_type;
123 RCP<const crs_matrix_type> A_local_crs = rcp_dynamic_cast<const crs_matrix_type>(A_local);
124 if (A_local_crs.is_null ()) {
125 local_ordinal_type numRows = A_local->getLocalNumRows();
126 Array<size_t> entriesPerRow(numRows);
127 for(local_ordinal_type i = 0; i < numRows; i++) {
128 entriesPerRow[i] = A_local->getNumEntriesInLocalRow(i);
130 RCP<crs_matrix_type> A_local_crs_nc =
131 rcp (
new crs_matrix_type (A_local->getRowMap (),
132 A_local->getColMap (),
135 nonconst_local_inds_host_view_type indices(
"indices",A_local->getLocalMaxNumRowEntries());
136 nonconst_values_host_view_type values(
"values",A_local->getLocalMaxNumRowEntries());
137 for(local_ordinal_type i = 0; i < numRows; i++) {
138 size_t numEntries = 0;
139 A_local->getLocalRowCopy(i, indices, values, numEntries);
140 A_local_crs_nc->insertLocalValues(i, numEntries,
reinterpret_cast<scalar_type*
>(values.data()), indices.data());
142 A_local_crs_nc->fillComplete (A_local->getDomainMap (), A_local->getRangeMap ());
143 A_local_crs = rcp_const_cast<const crs_matrix_type> (A_local_crs_nc);
155template<
class MatrixType>
156MDF<MatrixType>::MDF (
const Teuchos::RCP<const row_matrix_type>& Matrix_in)
160 isAllocated_ (false),
161 isInitialized_ (false),
166 initializeTime_ (0.0),
171 allocatePermutations();
175template<
class MatrixType>
176MDF<MatrixType>::MDF (
const Teuchos::RCP<const crs_matrix_type>& Matrix_in)
180 isAllocated_ (false),
181 isInitialized_ (false),
186 initializeTime_ (0.0),
191 allocatePermutations();
194template<
class MatrixType>
195void MDF<MatrixType>::allocatePermutations (
bool force)
197 if (A_.is_null())
return;
200 if (force || permutations_.is_null() || A_->getLocalNumRows() !=
size_t(permutations_.size()))
202 permutations_ = Teuchos::null;
203 reversePermutations_ = Teuchos::null;
204 permutations_ = permutations_type(A_->getLocalNumRows());
205 reversePermutations_ = permutations_type(A_->getLocalNumRows());
209template<
class MatrixType>
210void MDF<MatrixType>::allocateSolvers ()
212 L_solver_ = Teuchos::null;
213 U_solver_ = Teuchos::null;
215 L_solver_->setObjectLabel(
"lower");
217 U_solver_->setObjectLabel(
"upper");
220template<
class MatrixType>
228 if (A.getRawPtr () !=
A_.getRawPtr ()) {
229 isAllocated_ =
false;
230 isInitialized_ =
false;
233 MDF_handle_ = Teuchos::null;
251 allocatePermutations(
true);
257template<
class MatrixType>
261 TEUCHOS_TEST_FOR_EXCEPTION(
262 L_.is_null (), std::runtime_error,
"Ifpack2::MDF::getL: The L factor "
263 "is null. Please call initialize() and compute() "
264 "before calling this method. If the input matrix has not yet been set, "
265 "you must first call setMatrix() with a nonnull input matrix before you "
266 "may call initialize() or compute().");
270template<
class MatrixType>
271typename MDF<MatrixType>::permutations_type &
274 TEUCHOS_TEST_FOR_EXCEPTION(
275 permutations_.is_null (), std::runtime_error,
"Ifpack2::MDF::getPermutations: "
276 "The permulations are null. Please call initialize() and compute() "
277 "before calling this method. If the input matrix has not yet been set, "
278 "you must first call setMatrix() with a nonnull input matrix before you "
279 "may call initialize() or compute().");
282template<
class MatrixType>
283typename MDF<MatrixType>::permutations_type &
286 TEUCHOS_TEST_FOR_EXCEPTION(
288 "The permulations are null. Please call initialize() and compute() "
289 "before calling this method. If the input matrix has not yet been set, "
290 "you must first call setMatrix() with a nonnull input matrix before you "
291 "may call initialize() or compute().");
295template<
class MatrixType>
299 TEUCHOS_TEST_FOR_EXCEPTION(
300 U_.is_null (), std::runtime_error,
"Ifpack2::MDF::getU: The U factor "
301 "is null. Please call initialize() and compute() "
302 "before calling this method. If the input matrix has not yet been set, "
303 "you must first call setMatrix() with a nonnull input matrix before you "
304 "may call initialize() or compute().");
309template<
class MatrixType>
311 TEUCHOS_TEST_FOR_EXCEPTION(
312 A_.is_null (), std::runtime_error,
"Ifpack2::MDF::getNodeSmootherComplexity: "
313 "The input matrix A is null. Please call setMatrix() with a nonnull "
314 "input matrix, then call compute(), before calling this method.");
316 if(!
L_.is_null() && !
U_.is_null())
317 return A_->getLocalNumEntries() +
L_->getLocalNumEntries() +
U_->getLocalNumEntries();
323template<
class MatrixType>
324Teuchos::RCP<const Tpetra::Map<typename MDF<MatrixType>::local_ordinal_type,
328 TEUCHOS_TEST_FOR_EXCEPTION(
329 A_.is_null (), std::runtime_error,
"Ifpack2::MDF::getDomainMap: "
330 "The matrix is null. Please call setMatrix() with a nonnull input "
331 "before calling this method.");
334 TEUCHOS_TEST_FOR_EXCEPTION(
335 L_.is_null (), std::runtime_error,
"Ifpack2::MDF::getDomainMap: "
336 "The computed graph is null. Please call initialize() and compute() before calling "
338 return L_->getDomainMap ();
342template<
class MatrixType>
343Teuchos::RCP<const Tpetra::Map<typename MDF<MatrixType>::local_ordinal_type,
347 TEUCHOS_TEST_FOR_EXCEPTION(
348 A_.is_null (), std::runtime_error,
"Ifpack2::MDF::getRangeMap: "
349 "The matrix is null. Please call setMatrix() with a nonnull input "
350 "before calling this method.");
353 TEUCHOS_TEST_FOR_EXCEPTION(
354 L_.is_null (), std::runtime_error,
"Ifpack2::MDF::getRangeMap: "
355 "The computed graph is null. Please call initialize() abd compute() before calling "
357 return L_->getRangeMap ();
360template<
class MatrixType>
366 using Teuchos::ParameterList;
367 using Teuchos::Array;
368 using Details::getParamTryingTypes;
369 const char prefix[] =
"Ifpack2::MDF: ";
373 double overalloc = 2.;
385 const std::string paramName (
"fact: mdf level-of-fill");
386 getParamTryingTypes<int, int, global_ordinal_type, double, float>
387 (fillLevel, params, paramName, prefix);
389 TEUCHOS_TEST_FOR_EXCEPTION
390 (fillLevel != 0, std::runtime_error, prefix <<
"MDF with level of fill != 0 is not yet implemented.");
393 const std::string paramName (
"Verbosity");
394 getParamTryingTypes<int, int, global_ordinal_type, double, float>
395 (verbosity, params, paramName, prefix);
398 const std::string paramName (
"fact: mdf overalloc");
399 getParamTryingTypes<double, double>
400 (overalloc, params, paramName, prefix);
411 LevelOfFill_ = fillLevel;
412 Overalloc_ = overalloc;
413 Verbosity_ = verbosity;
417template<
class MatrixType>
418Teuchos::RCP<const typename MDF<MatrixType>::row_matrix_type>
420 return Teuchos::rcp_implicit_cast<const row_matrix_type> (
A_);
424template<
class MatrixType>
425Teuchos::RCP<const typename MDF<MatrixType>::crs_matrix_type>
427 return Teuchos::rcp_dynamic_cast<const crs_matrix_type> (
A_,
true);
431template<
class MatrixType>
432Teuchos::RCP<const typename MDF<MatrixType>::row_matrix_type>
433MDF<MatrixType>::makeLocalFilter (
const Teuchos::RCP<const row_matrix_type>& A)
437 using Teuchos::rcp_dynamic_cast;
438 using Teuchos::rcp_implicit_cast;
443 if (A->getRowMap ()->getComm ()->getSize () == 1 ||
444 A->getRowMap ()->isSameAs (* (A->getColMap ()))) {
451 RCP<const LocalFilter<row_matrix_type> > A_lf_r =
452 rcp_dynamic_cast<const LocalFilter<row_matrix_type> > (A);
453 if (! A_lf_r.is_null ()) {
454 return rcp_implicit_cast<const row_matrix_type> (A_lf_r);
465template<
class MatrixType>
470 using Teuchos::rcp_const_cast;
471 using Teuchos::rcp_dynamic_cast;
472 using Teuchos::rcp_implicit_cast;
473 using Teuchos::Array;
474 using Teuchos::ArrayView;
478 const char prefix[] =
"Ifpack2::MDF::initialize: ";
480 TEUCHOS_TEST_FOR_EXCEPTION
481 (
A_.is_null (), std::runtime_error, prefix <<
"The matrix is null. Please "
482 "call setMatrix() with a nonnull input before calling this method.");
483 TEUCHOS_TEST_FOR_EXCEPTION
484 (!
A_->isFillComplete (), std::runtime_error, prefix <<
"The matrix is not "
485 "fill complete. You may not invoke initialize() or compute() with this "
486 "matrix until the matrix is fill complete. If your matrix is a "
487 "Tpetra::CrsMatrix, please call fillComplete on it (with the domain and "
488 "range Maps, if appropriate) before calling this method.");
490 Teuchos::Time timer (
"MDF::initialize");
491 double startTime = timer.wallTime();
493 Teuchos::TimeMonitor timeMon (timer);
502 isInitialized_ =
false;
503 isAllocated_ =
false;
505 MDF_handle_ = Teuchos::null;
508 TEUCHOS_TEST_FOR_EXCEPTION(
509 A_local_.is_null (), std::logic_error,
"Ifpack2::MDF::initialize: "
510 "makeLocalFilter returned null; it failed to compute A_local. "
511 "Please report this bug to the Ifpack2 developers.");
519 RCP<const crs_matrix_type> A_local_crs = Details::MDFImpl::get_local_crs_row_matrix(
A_local_);
521 auto A_local_device = A_local_crs->getLocalMatrixDevice();
522 MDF_handle_ = rcp(
new MDF_handle_device_type(A_local_device) );
523 MDF_handle_->set_verbosity(Verbosity_);
526 if constexpr (std::is_arithmetic_v<scalar_type>)
528 KokkosSparse::Experimental::mdf_symbolic(A_local_device,*MDF_handle_);
532 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
"Ifpack2::MDF::initialize: "
533 "MDF on complex scalar types is not currently supported. "
534 "Please report this to the Ifpack2 developers.");
540 checkOrderingConsistency (*
A_local_);
543 isInitialized_ =
true;
545 initializeTime_ += (timer.wallTime() - startTime);
548template<
class MatrixType>
556 Teuchos::ArrayView<const global_ordinal_type> rowGIDs = A.getRowMap()->getLocalElementList();
557 Teuchos::ArrayView<const global_ordinal_type> colGIDs = A.getColMap()->getLocalElementList();
558 bool gidsAreConsistentlyOrdered=
true;
561 if (rowGIDs[i] != colGIDs[i]) {
562 gidsAreConsistentlyOrdered=
false;
563 indexOfInconsistentGID=i;
567 TEUCHOS_TEST_FOR_EXCEPTION(gidsAreConsistentlyOrdered==
false, std::runtime_error,
568 "The ordering of the local GIDs in the row and column maps is not the same"
569 << std::endl <<
"at index " << indexOfInconsistentGID
570 <<
". Consistency is required, as all calculations are done with"
571 << std::endl <<
"local indexing.");
574template<
class MatrixType>
579 using Teuchos::rcp_const_cast;
580 using Teuchos::rcp_dynamic_cast;
581 using Teuchos::Array;
582 using Teuchos::ArrayView;
583 const char prefix[] =
"Ifpack2::MDF::compute: ";
588 TEUCHOS_TEST_FOR_EXCEPTION
589 (
A_.is_null (), std::runtime_error, prefix <<
"The matrix is null. Please "
590 "call setMatrix() with a nonnull input before calling this method.");
591 TEUCHOS_TEST_FOR_EXCEPTION
592 (!
A_->isFillComplete (), std::runtime_error, prefix <<
"The matrix is not "
593 "fill complete. You may not invoke initialize() or compute() with this "
594 "matrix until the matrix is fill complete. If your matrix is a "
595 "Tpetra::CrsMatrix, please call fillComplete on it (with the domain and "
596 "range Maps, if appropriate) before calling this method.");
602 Teuchos::Time timer (
"MDF::compute");
605 Teuchos::TimeMonitor timeMon (timer);
606 double startTime = timer.wallTime();
611 RCP<const crs_matrix_type> A_local_crs = Details::MDFImpl::get_local_crs_row_matrix(
A_local_);
614 auto A_local_device = A_local_crs->getLocalMatrixDevice();
616 if constexpr (std::is_arithmetic_v<scalar_type>)
618 KokkosSparse::Experimental::mdf_numeric(A_local_device,*MDF_handle_);
622 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error, prefix <<
623 "MDF on complex scalar types is not currently supported. "
624 "Please report this to the Ifpack2 developers.");
630 Details::MDFImpl::copy_dev_view_to_host_array(
permutations_, MDF_handle_->permutation_inv);
635 auto L_mdf = MDF_handle_->getL();
639 Details::MDFImpl::copy_view(L_mdf.graph.row_map),
640 Details::MDFImpl::copy_view(L_mdf.graph.entries),
641 Details::MDFImpl::copy_view(L_mdf.values)
645 auto U_mdf = MDF_handle_->getU();
649 Details::MDFImpl::copy_view(U_mdf.graph.row_map),
650 Details::MDFImpl::copy_view(U_mdf.graph.entries),
651 Details::MDFImpl::copy_view(U_mdf.values)
665 computeTime_ += (timer.wallTime() - startTime);
668template<
class MatrixType>
671apply_impl (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
672 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
673 Teuchos::ETransp mode,
675 scalar_type beta)
const
677 const scalar_type one = STS::one ();
678 const scalar_type zero = STS::zero ();
680 if (alpha == one && beta == zero) {
681 MV tmp (Y.getMap (), Y.getNumVectors ());
682 Details::MDFImpl::applyReorderingPermutations(X,tmp,permutations_);
683 if (mode == Teuchos::NO_TRANS) {
685 L_solver_->apply (tmp, Y, mode);
686 U_solver_->apply (Y, tmp, mode);
690 U_solver_->apply (tmp, Y, mode);
691 L_solver_->apply (Y, tmp, mode);
693 Details::MDFImpl::applyReorderingPermutations(tmp,Y,reversePermutations_);
706 MV Y_tmp (Y.getMap (), Y.getNumVectors ());
707 apply_impl (X, Y_tmp, mode);
708 Y.update (alpha, Y_tmp, beta);
713template<
class MatrixType>
716apply (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
717 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
718 Teuchos::ETransp mode,
723 using Teuchos::rcpFromRef;
725 TEUCHOS_TEST_FOR_EXCEPTION(
726 A_.is_null (), std::runtime_error,
"Ifpack2::MDF::apply: The matrix is "
727 "null. Please call setMatrix() with a nonnull input, then initialize() "
728 "and compute(), before calling this method.");
729 TEUCHOS_TEST_FOR_EXCEPTION(
731 "Ifpack2::MDF::apply: If you have not yet called compute(), "
732 "you must call compute() before calling this method.");
733 TEUCHOS_TEST_FOR_EXCEPTION(
734 X.getNumVectors () != Y.getNumVectors (), std::invalid_argument,
735 "Ifpack2::MDF::apply: X and Y do not have the same number of columns. "
736 "X.getNumVectors() = " << X.getNumVectors ()
737 <<
" != Y.getNumVectors() = " << Y.getNumVectors () <<
".");
738 TEUCHOS_TEST_FOR_EXCEPTION(
739 STS::isComplex && mode == Teuchos::CONJ_TRANS, std::logic_error,
740 "Ifpack2::MDF::apply: mode = Teuchos::CONJ_TRANS is not implemented for "
741 "complex Scalar type. Please talk to the Ifpack2 developers to get this "
742 "fixed. There is a FIXME in this file about this very issue.");
743#ifdef HAVE_IFPACK2_DEBUG
745 Teuchos::Array<magnitude_type> norms (X.getNumVectors ());
748 for (
size_t j = 0; j < X.getNumVectors (); ++j) {
749 if (STM::isnaninf (norms[j])) {
754 TEUCHOS_TEST_FOR_EXCEPTION( ! good, std::runtime_error,
"Ifpack2::MDF::apply: The 1-norm of the input X is NaN or Inf.");
758 Teuchos::Time timer (
"MDF::apply");
759 double startTime = timer.wallTime();
761 Teuchos::TimeMonitor timeMon (timer);
762 apply_impl(X,Y,mode,alpha,beta);
765#ifdef HAVE_IFPACK2_DEBUG
767 Teuchos::Array<magnitude_type> norms (Y.getNumVectors ());
770 for (
size_t j = 0; j < Y.getNumVectors (); ++j) {
771 if (STM::isnaninf (norms[j])) {
776 TEUCHOS_TEST_FOR_EXCEPTION( ! good, std::runtime_error,
"Ifpack2::MDF::apply: The 1-norm of the output Y is NaN or Inf.");
781 applyTime_ += (timer.wallTime() - startTime);
784template<
class MatrixType>
787 std::ostringstream os;
792 os <<
"\"Ifpack2::MDF\": {";
793 os <<
"Initialized: " << (
isInitialized () ?
"true" :
"false") <<
", "
794 <<
"Computed: " << (
isComputed () ?
"true" :
"false") <<
", ";
799 os <<
"Matrix: null";
802 os <<
"Global matrix dimensions: ["
803 <<
A_->getGlobalNumRows () <<
", " <<
A_->getGlobalNumCols () <<
"]"
804 <<
", Global nnz: " <<
A_->getGlobalNumEntries();
816#define IFPACK2_MDF_INSTANT(S,LO,GO,N) \
817 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:163
"Preconditioner" that solves local sparse triangular systems.
Definition Ifpack2_LocalSparseTriangularSolver_decl.hpp:88
MDF (incomplete LU factorization with minimum discarded fill reordering) of a Tpetra sparse matrix.
Definition Ifpack2_MDF_decl.hpp:92
void setParameters(const Teuchos::ParameterList ¶ms)
Definition Ifpack2_MDF_def.hpp:363
const crs_matrix_type & getL() const
Return the L factor of the MDF factorization.
Definition Ifpack2_MDF_def.hpp:259
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:716
int getLevelOfFill() const
Get level of fill (the "k" in ILU(k)).
Definition Ifpack2_MDF_decl.hpp:368
Teuchos::RCP< LocalSparseTriangularSolver< row_matrix_type > > L_solver_
Sparse triangular solver for L.
Definition Ifpack2_MDF_decl.hpp:436
bool isComputed() const
Whether compute() has been called on this object.
Definition Ifpack2_MDF_decl.hpp:209
permutations_type & getReversePermutations() const
Return the reverse permutations of the MDF factorization.
Definition Ifpack2_MDF_def.hpp:284
permutations_type reversePermutations_
The reverse permuations from MDF factorization.
Definition Ifpack2_MDF_decl.hpp:446
const crs_matrix_type & getU() const
Return the U factor of the MDF factorization.
Definition Ifpack2_MDF_def.hpp:297
void compute()
Compute the (numeric) incomplete factorization.
Definition Ifpack2_MDF_def.hpp:575
Teuchos::RCP< crs_matrix_type > U_
The U (upper triangular) factor of ILU(k).
Definition Ifpack2_MDF_decl.hpp:438
MatrixType::local_ordinal_type local_ordinal_type
The type of local indices in the input MatrixType.
Definition Ifpack2_MDF_decl.hpp:98
bool isInitialized() const
Whether initialize() has been called on this object.
Definition Ifpack2_MDF_decl.hpp:205
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:428
void initialize()
Initialize by computing the symbolic incomplete factorization.
Definition Ifpack2_MDF_def.hpp:466
std::string description() const
A one-line description of this object.
Definition Ifpack2_MDF_def.hpp:785
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:346
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:128
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:327
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:426
MatrixType::node_type node_type
The Node type used by the input MatrixType.
Definition Ifpack2_MDF_decl.hpp:104
MatrixType::global_ordinal_type global_ordinal_type
The type of global indices in the input MatrixType.
Definition Ifpack2_MDF_decl.hpp:101
permutations_type permutations_
The computed permuations from MDF factorization.
Definition Ifpack2_MDF_decl.hpp:443
Teuchos::RCP< LocalSparseTriangularSolver< row_matrix_type > > U_solver_
Sparse triangular solver for U.
Definition Ifpack2_MDF_decl.hpp:440
MatrixType::scalar_type scalar_type
The type of the entries of the input MatrixType.
Definition Ifpack2_MDF_decl.hpp:95
Teuchos::RCP< const row_matrix_type > getMatrix() const
Get the input matrix.
Definition Ifpack2_MDF_def.hpp:419
virtual void setMatrix(const Teuchos::RCP< const row_matrix_type > &A)
Change the matrix to be preconditioned.
Definition Ifpack2_MDF_def.hpp:222
size_t getNodeSmootherComplexity() const
Get a rough estimate of cost per iteration.
Definition Ifpack2_MDF_def.hpp:310
Teuchos::RCP< crs_matrix_type > L_
The L (lower triangular) factor of ILU(k).
Definition Ifpack2_MDF_decl.hpp:434
Teuchos::RCP< const row_matrix_type > A_
The (original) input matrix for which to compute ILU(k).
Definition Ifpack2_MDF_decl.hpp:420
permutations_type & getPermutations() const
Return the permutations of the MDF factorization.
Definition Ifpack2_MDF_def.hpp:272
Preconditioners and smoothers for Tpetra sparse matrices.
Definition Ifpack2_AdditiveSchwarz_decl.hpp:74