239 typename MatrixType::scalar_type,
240 typename MatrixType::local_ordinal_type,
241 typename MatrixType::global_ordinal_type,
242 typename MatrixType::node_type>,
244 Tpetra::RowMatrix<typename MatrixType::scalar_type,
245 typename MatrixType::local_ordinal_type,
246 typename MatrixType::global_ordinal_type,
247 typename MatrixType::node_type> >
269 typedef typename Teuchos::ScalarTraits<scalar_type>::magnitudeType
magnitude_type;
281 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.");
317 explicit Relaxation (
const Teuchos::RCP<const row_matrix_type>& A);
406 bool supportsZeroStartingSolution() {
return true; }
411 Teuchos::RCP<const Teuchos::ParameterList>
419 return isInitialized_;
457 setMatrix (
const Teuchos::RCP<const row_matrix_type>& A);
479 apply (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
480 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
481 Teuchos::ETransp mode = Teuchos::NO_TRANS,
482 scalar_type alpha = Teuchos::ScalarTraits<scalar_type>::one(),
483 scalar_type beta = Teuchos::ScalarTraits<scalar_type>::zero())
const;
486 Teuchos::RCP<const Tpetra::Map<local_ordinal_type,global_ordinal_type,node_type> >
490 Teuchos::RCP<const Tpetra::Map<local_ordinal_type,global_ordinal_type,node_type> >
504 applyMat (
const Tpetra::MultiVector<
514 Teuchos::ETransp mode = Teuchos::NO_TRANS)
const;
521 Teuchos::RCP<const Teuchos::Comm<int> >
getComm()
const;
524 Teuchos::RCP<const row_matrix_type>
getMatrix ()
const;
588 describe (Teuchos::FancyOStream &out,
589 const Teuchos::EVerbosityLevel verbLevel =
590 Teuchos::Describable::verbLevel_default)
const;
597 typedef Teuchos::ScalarTraits<scalar_type> STS;
598 typedef Teuchos::ScalarTraits<magnitude_type> STM;
600 typedef typename Kokkos::ArithTraits<scalar_type>::val_type impl_scalar_type;
617 typedef Tpetra::Map<local_ordinal_type, global_ordinal_type, node_type> map_type;
618 typedef Tpetra::Import<local_ordinal_type, global_ordinal_type, node_type> import_type;
620 typedef typename crs_matrix_type::nonconst_local_inds_host_view_type nonconst_local_inds_host_view_type;
621 typedef typename crs_matrix_type::nonconst_values_host_view_type nonconst_values_host_view_type;
623 Teuchos::RCP<Ifpack2::Details::InverseDiagonalKernel<op_type> > invDiagKernel_;
629 typedef typename crs_matrix_type::local_matrix_device_type local_matrix_device_type;
630 typedef typename local_matrix_device_type::StaticCrsGraphType::row_map_type lno_row_view_t;
631 typedef typename local_matrix_device_type::StaticCrsGraphType::entries_type lno_nonzero_view_t;
632 typedef typename local_matrix_device_type::values_type scalar_nonzero_view_t;
633 typedef typename local_matrix_device_type::StaticCrsGraphType::device_type TemporaryWorkSpace;
634 typedef typename local_matrix_device_type::StaticCrsGraphType::device_type PersistentWorkSpace;
635 typedef typename local_matrix_device_type::StaticCrsGraphType::execution_space MyExecSpace;
636 typedef typename KokkosKernels::Experimental::KokkosKernelsHandle
637 <
typename lno_row_view_t::const_value_type,
local_ordinal_type,
typename scalar_nonzero_view_t::value_type,
638 MyExecSpace, TemporaryWorkSpace,PersistentWorkSpace > mt_kernel_handle_type;
639 Teuchos::RCP<mt_kernel_handle_type> mtKernelHandle_;
645 using SerialGaussSeidel = Ifpack2::Details::GaussSeidel<scalar_type, local_ordinal_type, global_ordinal_type, node_type>;
646 Teuchos::RCP<SerialGaussSeidel> serialGaussSeidel_;
666 void setParametersImpl (Teuchos::ParameterList& params);
669 void ApplyInverseRichardson(
670 const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
671 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y)
const;
674 void ApplyInverseJacobi(
675 const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
676 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y)
const;
679 void ApplyInverseJacobi_BlockCrsMatrix(
680 const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
681 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y)
const;
684 void ApplyInverseMTGS_CrsMatrix(
685 const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& B,
686 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
687 Tpetra::ESweepDirection direction)
const;
690 void ApplyInverseSerialGS(
691 const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
692 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
693 Tpetra::ESweepDirection direction)
const;
696 void ApplyInverseSerialGS_CrsMatrix (
const crs_matrix_type& A,
697 const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& B,
698 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
699 Tpetra::ESweepDirection direction)
const;
702 void ApplyInverseSerialGS_RowMatrix(
703 const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
704 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
705 Tpetra::ESweepDirection direction)
const;
708 void ApplyInverseSerialGS_BlockCrsMatrix(
709 const block_crs_matrix_type& A,
710 const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
711 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
712 Tpetra::ESweepDirection direction);
715 void ApplyInverseMTSGS_CrsMatrix(
716 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)
const;
720 const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& B,
721 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
722 const Tpetra::ESweepDirection direction)
const;
724 void computeBlockCrs ();
727 void updateCachedMultiVector(
const Teuchos::RCP<
const Tpetra::Map<local_ordinal_type,global_ordinal_type,node_type> >& map,
size_t numVecs)
const;
740 mutable Teuchos::RCP<const Teuchos::ParameterList> validParams_;
743 Teuchos::RCP<const row_matrix_type> A_;
746 Teuchos::RCP<const import_type> Importer_;
748 Teuchos::RCP<const import_type> pointImporter_;
750 Teuchos::RCP<Tpetra::Vector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> > Diagonal_;
752 mutable Teuchos::RCP<Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> > cachedMV_;
754 typedef Kokkos::View<
typename block_crs_matrix_type::impl_scalar_type***,
755 typename block_crs_matrix_type::device_type> block_diag_type;
756 typedef Kokkos::View<
typename block_crs_matrix_type::impl_scalar_type***,
757 typename block_crs_matrix_type::device_type,
758 Kokkos::MemoryUnmanaged> unmanaged_block_diag_type;
774 block_diag_type blockDiag_;
776 Teuchos::RCP<block_multivector_type> yBlockColumnPointMap_;
781 Details::RelaxationType PrecType_ = Ifpack2::Details::JACOBI;
787 bool ZeroStartingSolution_ =
true;
789 bool DoBackwardGS_ =
false;
791 bool DoL1Method_ =
false;
797 bool fixTinyDiagEntries_ =
false;
799 bool checkDiagEntries_ =
false;
801 int clusterSize_ = 1;
803 int longRowThreshold_ = 0;
805 KokkosGraph::ColoringAlgorithm mtColoringAlgorithm_ = KokkosGraph::COLORING_DEFAULT;
808 int NumOuterSweeps_ = 1;
810 int NumInnerSweeps_ = 1;
812 bool InnerSpTrsv_ =
false;
816 bool CompactForm_ =
false;
819 bool is_matrix_structurally_symmetric_ =
false;
822 bool ifpack2_dump_matrix_ =
false;
826 bool isInitialized_ =
false;
828 bool IsComputed_ =
false;
830 int NumInitialize_ = 0;
834 mutable int NumApply_ = 0;
836 double InitializeTime_ = 0.0;
838 double ComputeTime_ = 0.0;
840 mutable double ApplyTime_ = 0.0;
842 double ComputeFlops_ = 0.0;
844 mutable double ApplyFlops_ = 0.0;
851 size_t globalNumSmallDiagEntries_ = 0;
853 size_t globalNumZeroDiagEntries_ = 0;
855 size_t globalNumNegDiagEntries_ = 0;
867 Kokkos::View<size_t*, typename node_type::device_type> diagOffsets_;
874 bool savedDiagOffsets_ =
false;
876 bool hasBlockCrsMatrix_ =
false;
879 Teuchos::ArrayRCP<local_ordinal_type> localSmoothingIndices_;