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 typedef typename KokkosKernels::ArithTraits<scalar_type>::val_type impl_scalar_type;
586 block_crs_matrix_type;
589 block_multivector_type;
591 typedef Tpetra::Map<local_ordinal_type, global_ordinal_type, node_type> map_type;
592 typedef Tpetra::Import<local_ordinal_type, global_ordinal_type, node_type> import_type;
594 typedef typename crs_matrix_type::nonconst_local_inds_host_view_type nonconst_local_inds_host_view_type;
595 typedef typename crs_matrix_type::nonconst_values_host_view_type nonconst_values_host_view_type;
597 Teuchos::RCP<Ifpack2::Details::InverseDiagonalKernel<op_type> > invDiagKernel_;
603 typedef typename crs_matrix_type::local_matrix_device_type local_matrix_device_type;
604 typedef typename local_matrix_device_type::StaticCrsGraphType::row_map_type lno_row_view_t;
605 typedef typename local_matrix_device_type::StaticCrsGraphType::entries_type lno_nonzero_view_t;
606 typedef typename local_matrix_device_type::values_type scalar_nonzero_view_t;
607 typedef typename local_matrix_device_type::StaticCrsGraphType::device_type TemporaryWorkSpace;
608 typedef typename local_matrix_device_type::StaticCrsGraphType::device_type PersistentWorkSpace;
609 typedef typename local_matrix_device_type::StaticCrsGraphType::execution_space MyExecSpace;
610 typedef typename KokkosKernels::Experimental::KokkosKernelsHandle<
typename lno_row_view_t::const_value_type,
local_ordinal_type,
typename scalar_nonzero_view_t::value_type,
611 MyExecSpace, TemporaryWorkSpace, PersistentWorkSpace>
612 mt_kernel_handle_type;
613 Teuchos::RCP<mt_kernel_handle_type> mtKernelHandle_;
620 Teuchos::RCP<SerialGaussSeidel> serialGaussSeidel_;
640 void setParametersImpl(Teuchos::ParameterList& params);
643 void ApplyInverseRichardson(
644 const Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& X,
645 Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& Y)
const;
648 void ApplyInverseJacobi(
649 const Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& X,
650 Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& Y)
const;
653 void ApplyInverseJacobi_BlockCrsMatrix(
654 const Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& X,
655 Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& Y)
const;
658 void ApplyInverseMTGS_CrsMatrix(
659 const Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& B,
660 Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& X,
661 Tpetra::ESweepDirection direction)
const;
664 void ApplyInverseSerialGS(
665 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 Tpetra::ESweepDirection direction)
const;
670 void ApplyInverseSerialGS_CrsMatrix(
const crs_matrix_type& A,
671 const Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& B,
672 Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& X,
673 Tpetra::ESweepDirection direction)
const;
676 void ApplyInverseSerialGS_RowMatrix(
677 const Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& X,
678 Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& Y,
679 Tpetra::ESweepDirection direction)
const;
682 void ApplyInverseSerialGS_BlockCrsMatrix(
683 const block_crs_matrix_type& A,
684 const Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& X,
685 Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& Y,
686 Tpetra::ESweepDirection direction);
689 void ApplyInverseMTSGS_CrsMatrix(
690 const Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& X,
691 Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& Y)
const;
694 const Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& B,
695 Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& X,
696 const Tpetra::ESweepDirection direction)
const;
698 void computeBlockCrs();
701 void updateCachedMultiVector(
const Teuchos::RCP<
const Tpetra::Map<local_ordinal_type, global_ordinal_type, node_type> >& map,
size_t numVecs)
const;
713 mutable Teuchos::RCP<const Teuchos::ParameterList> validParams_;
716 Teuchos::RCP<const row_matrix_type> A_;
719 Teuchos::RCP<const import_type> Importer_;
721 Teuchos::RCP<const import_type> pointImporter_;
723 Teuchos::RCP<Tpetra::Vector<scalar_type, local_ordinal_type, global_ordinal_type, node_type> > Diagonal_;
725 mutable Teuchos::RCP<Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type> > cachedMV_;
727 typedef Kokkos::View<
typename block_crs_matrix_type::impl_scalar_type***,
728 typename block_crs_matrix_type::device_type>
730 typedef Kokkos::View<
typename block_crs_matrix_type::impl_scalar_type***,
731 typename block_crs_matrix_type::device_type,
732 Kokkos::MemoryUnmanaged>
733 unmanaged_block_diag_type;
749 block_diag_type blockDiag_;
751 Teuchos::RCP<block_multivector_type> yBlockColumnPointMap_;
756 Details::RelaxationType PrecType_ = Ifpack2::Details::JACOBI;
762 bool ZeroStartingSolution_ =
true;
764 bool DoBackwardGS_ =
false;
766 bool DoL1Method_ =
false;
772 bool fixTinyDiagEntries_ =
false;
774 bool checkDiagEntries_ =
false;
776 int clusterSize_ = 1;
778 int longRowThreshold_ = 0;
780 KokkosGraph::ColoringAlgorithm mtColoringAlgorithm_ = KokkosGraph::COLORING_DEFAULT;
783 int NumOuterSweeps_ = 1;
785 int NumInnerSweeps_ = 1;
787 bool InnerSpTrsv_ =
false;
791 bool CompactForm_ =
false;
794 bool is_matrix_structurally_symmetric_ =
false;
797 bool ifpack2_dump_matrix_ =
false;
800 bool isInitialized_ =
false;
802 bool IsComputed_ =
false;
804 int NumInitialize_ = 0;
808 bool TimerForApply_ =
true;
810 mutable int NumApply_ = 0;
812 double InitializeTime_ = 0.0;
814 double ComputeTime_ = 0.0;
816 mutable double ApplyTime_ = 0.0;
818 double ComputeFlops_ = 0.0;
820 mutable double ApplyFlops_ = 0.0;
827 size_t globalNumSmallDiagEntries_ = 0;
829 size_t globalNumZeroDiagEntries_ = 0;
831 size_t globalNumNegDiagEntries_ = 0;
843 Kokkos::View<size_t*, typename node_type::device_type> diagOffsets_;
850 bool savedDiagOffsets_ =
false;
852 bool hasBlockCrsMatrix_ =
false;
855 Teuchos::ArrayRCP<local_ordinal_type> localSmoothingIndices_;