207 typename MatrixType::scalar_type,
208 typename MatrixType::local_ordinal_type,
209 typename MatrixType::global_ordinal_type,
210 typename MatrixType::node_type>,
212 Tpetra::RowMatrix<typename MatrixType::scalar_type,
213 typename MatrixType::local_ordinal_type,
214 typename MatrixType::global_ordinal_type,
215 typename MatrixType::node_type> > {
236 typedef typename Teuchos::ScalarTraits<scalar_type>::magnitudeType
magnitude_type;
250 static_assert(std::is_same<MatrixType, row_matrix_type>::value,
"Ifpack2::Relaxation: Please use MatrixType = Tpetra::RowMatrix. This saves build times, library sizes, and executable sizes. Don't worry, this class still works with CrsMatrix and BlockCrsMatrix; those are both subclasses of RowMatrix.");
286 explicit Relaxation(
const Teuchos::RCP<const row_matrix_type>& A);
375 bool supportsZeroStartingSolution() {
return true; }
380 Teuchos::RCP<const Teuchos::ParameterList>
388 return isInitialized_;
426 setMatrix(
const Teuchos::RCP<const row_matrix_type>& A);
448 apply(
const Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& X,
449 Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& Y,
450 Teuchos::ETransp mode = Teuchos::NO_TRANS,
451 scalar_type alpha = Teuchos::ScalarTraits<scalar_type>::one(),
452 scalar_type beta = Teuchos::ScalarTraits<scalar_type>::zero())
const;
455 Teuchos::RCP<const Tpetra::Map<local_ordinal_type, global_ordinal_type, node_type> >
459 Teuchos::RCP<const Tpetra::Map<local_ordinal_type, global_ordinal_type, node_type> >
483 Teuchos::ETransp mode = Teuchos::NO_TRANS)
const;
490 Teuchos::RCP<const Teuchos::Comm<int> >
getComm()
const;
493 Teuchos::RCP<const row_matrix_type>
getMatrix()
const;
557 describe(Teuchos::FancyOStream& out,
558 const Teuchos::EVerbosityLevel verbLevel =
559 Teuchos::Describable::verbLevel_default)
const;
566 typedef Teuchos::ScalarTraits<scalar_type> STS;
567 typedef Teuchos::ScalarTraits<magnitude_type> STM;
569#if KOKKOS_VERSION >= 40799
570 typedef typename KokkosKernels::ArithTraits<scalar_type>::val_type impl_scalar_type;
572 typedef typename Kokkos::ArithTraits<scalar_type>::val_type impl_scalar_type;
590 block_crs_matrix_type;
593 block_multivector_type;
595 typedef Tpetra::Map<local_ordinal_type, global_ordinal_type, node_type> map_type;
596 typedef Tpetra::Import<local_ordinal_type, global_ordinal_type, node_type> import_type;
598 typedef typename crs_matrix_type::nonconst_local_inds_host_view_type nonconst_local_inds_host_view_type;
599 typedef typename crs_matrix_type::nonconst_values_host_view_type nonconst_values_host_view_type;
601 Teuchos::RCP<Ifpack2::Details::InverseDiagonalKernel<op_type> > invDiagKernel_;
607 typedef typename crs_matrix_type::local_matrix_device_type local_matrix_device_type;
608 typedef typename local_matrix_device_type::StaticCrsGraphType::row_map_type lno_row_view_t;
609 typedef typename local_matrix_device_type::StaticCrsGraphType::entries_type lno_nonzero_view_t;
610 typedef typename local_matrix_device_type::values_type scalar_nonzero_view_t;
611 typedef typename local_matrix_device_type::StaticCrsGraphType::device_type TemporaryWorkSpace;
612 typedef typename local_matrix_device_type::StaticCrsGraphType::device_type PersistentWorkSpace;
613 typedef typename local_matrix_device_type::StaticCrsGraphType::execution_space MyExecSpace;
614 typedef typename KokkosKernels::Experimental::KokkosKernelsHandle<
typename lno_row_view_t::const_value_type,
local_ordinal_type,
typename scalar_nonzero_view_t::value_type,
615 MyExecSpace, TemporaryWorkSpace, PersistentWorkSpace>
616 mt_kernel_handle_type;
617 Teuchos::RCP<mt_kernel_handle_type> mtKernelHandle_;
624 Teuchos::RCP<SerialGaussSeidel> serialGaussSeidel_;
644 void setParametersImpl(Teuchos::ParameterList& params);
647 void ApplyInverseRichardson(
648 const Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& X,
649 Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& Y)
const;
652 void ApplyInverseJacobi(
653 const Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& X,
654 Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& Y)
const;
657 void ApplyInverseJacobi_BlockCrsMatrix(
658 const Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& X,
659 Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& Y)
const;
662 void ApplyInverseMTGS_CrsMatrix(
663 const Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& B,
664 Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& X,
665 Tpetra::ESweepDirection direction)
const;
668 void ApplyInverseSerialGS(
669 const Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& X,
670 Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& Y,
671 Tpetra::ESweepDirection direction)
const;
674 void ApplyInverseSerialGS_CrsMatrix(
const crs_matrix_type& A,
675 const Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& B,
676 Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& X,
677 Tpetra::ESweepDirection direction)
const;
680 void ApplyInverseSerialGS_RowMatrix(
681 const Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& X,
682 Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& Y,
683 Tpetra::ESweepDirection direction)
const;
686 void ApplyInverseSerialGS_BlockCrsMatrix(
687 const block_crs_matrix_type& A,
688 const Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& X,
689 Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& Y,
690 Tpetra::ESweepDirection direction);
693 void ApplyInverseMTSGS_CrsMatrix(
694 const Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& X,
695 Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& Y)
const;
698 const Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& B,
699 Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& X,
700 const Tpetra::ESweepDirection direction)
const;
702 void computeBlockCrs();
705 void updateCachedMultiVector(
const Teuchos::RCP<
const Tpetra::Map<local_ordinal_type, global_ordinal_type, node_type> >& map,
size_t numVecs)
const;
717 mutable Teuchos::RCP<const Teuchos::ParameterList> validParams_;
720 Teuchos::RCP<const row_matrix_type> A_;
723 Teuchos::RCP<const import_type> Importer_;
725 Teuchos::RCP<const import_type> pointImporter_;
727 Teuchos::RCP<Tpetra::Vector<scalar_type, local_ordinal_type, global_ordinal_type, node_type> > Diagonal_;
729 mutable Teuchos::RCP<Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type> > cachedMV_;
731 typedef Kokkos::View<
typename block_crs_matrix_type::impl_scalar_type***,
732 typename block_crs_matrix_type::device_type>
734 typedef Kokkos::View<
typename block_crs_matrix_type::impl_scalar_type***,
735 typename block_crs_matrix_type::device_type,
736 Kokkos::MemoryUnmanaged>
737 unmanaged_block_diag_type;
753 block_diag_type blockDiag_;
755 Teuchos::RCP<block_multivector_type> yBlockColumnPointMap_;
760 Details::RelaxationType PrecType_ = Ifpack2::Details::JACOBI;
766 bool ZeroStartingSolution_ =
true;
768 bool DoBackwardGS_ =
false;
770 bool DoL1Method_ =
false;
776 bool fixTinyDiagEntries_ =
false;
778 bool checkDiagEntries_ =
false;
780 int clusterSize_ = 1;
782 int longRowThreshold_ = 0;
784 KokkosGraph::ColoringAlgorithm mtColoringAlgorithm_ = KokkosGraph::COLORING_DEFAULT;
787 int NumOuterSweeps_ = 1;
789 int NumInnerSweeps_ = 1;
791 bool InnerSpTrsv_ =
false;
795 bool CompactForm_ =
false;
798 bool is_matrix_structurally_symmetric_ =
false;
801 bool ifpack2_dump_matrix_ =
false;
804 bool isInitialized_ =
false;
806 bool IsComputed_ =
false;
808 int NumInitialize_ = 0;
812 bool TimerForApply_ =
true;
814 mutable int NumApply_ = 0;
816 double InitializeTime_ = 0.0;
818 double ComputeTime_ = 0.0;
820 mutable double ApplyTime_ = 0.0;
822 double ComputeFlops_ = 0.0;
824 mutable double ApplyFlops_ = 0.0;
831 size_t globalNumSmallDiagEntries_ = 0;
833 size_t globalNumZeroDiagEntries_ = 0;
835 size_t globalNumNegDiagEntries_ = 0;
847 Kokkos::View<size_t*, typename node_type::device_type> diagOffsets_;
854 bool savedDiagOffsets_ =
false;
856 bool hasBlockCrsMatrix_ =
false;
859 Teuchos::ArrayRCP<local_ordinal_type> localSmoothingIndices_;