208 typename MatrixType::scalar_type,
209 typename MatrixType::local_ordinal_type,
210 typename MatrixType::global_ordinal_type,
211 typename MatrixType::node_type>,
213 Tpetra::RowMatrix<typename MatrixType::scalar_type,
214 typename MatrixType::local_ordinal_type,
215 typename MatrixType::global_ordinal_type,
216 typename MatrixType::node_type> >
238 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> >
473 applyMat (
const Tpetra::MultiVector<
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 Kokkos::ArithTraits<scalar_type>::val_type impl_scalar_type;
586 typedef Tpetra::Map<local_ordinal_type, global_ordinal_type, node_type>
map_type;
587 typedef Tpetra::Import<local_ordinal_type, global_ordinal_type, node_type>
import_type;
589 typedef typename crs_matrix_type::nonconst_local_inds_host_view_type nonconst_local_inds_host_view_type;
590 typedef typename crs_matrix_type::nonconst_values_host_view_type nonconst_values_host_view_type;
592 Teuchos::RCP<Ifpack2::Details::InverseDiagonalKernel<op_type> > invDiagKernel_;
598 typedef typename crs_matrix_type::local_matrix_device_type local_matrix_device_type;
599 typedef typename local_matrix_device_type::StaticCrsGraphType::row_map_type lno_row_view_t;
600 typedef typename local_matrix_device_type::StaticCrsGraphType::entries_type lno_nonzero_view_t;
601 typedef typename local_matrix_device_type::values_type scalar_nonzero_view_t;
602 typedef typename local_matrix_device_type::StaticCrsGraphType::device_type TemporaryWorkSpace;
603 typedef typename local_matrix_device_type::StaticCrsGraphType::device_type PersistentWorkSpace;
604 typedef typename local_matrix_device_type::StaticCrsGraphType::execution_space MyExecSpace;
605 typedef typename KokkosKernels::Experimental::KokkosKernelsHandle
606 <
typename lno_row_view_t::const_value_type,
local_ordinal_type,
typename scalar_nonzero_view_t::value_type,
607 MyExecSpace, TemporaryWorkSpace,PersistentWorkSpace > mt_kernel_handle_type;
608 Teuchos::RCP<mt_kernel_handle_type> mtKernelHandle_;
614 using SerialGaussSeidel = Ifpack2::Details::GaussSeidel<scalar_type, local_ordinal_type, global_ordinal_type, node_type>;
615 Teuchos::RCP<SerialGaussSeidel> serialGaussSeidel_;
635 void setParametersImpl (Teuchos::ParameterList& params);
638 void ApplyInverseRichardson(
639 const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
640 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y)
const;
643 void ApplyInverseJacobi(
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_BlockCrsMatrix(
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 ApplyInverseMTGS_CrsMatrix(
654 const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& B,
655 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
656 Tpetra::ESweepDirection direction)
const;
659 void ApplyInverseSerialGS(
660 const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
661 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
662 Tpetra::ESweepDirection direction)
const;
665 void ApplyInverseSerialGS_CrsMatrix (
const crs_matrix_type& A,
666 const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& B,
667 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
668 Tpetra::ESweepDirection direction)
const;
671 void ApplyInverseSerialGS_RowMatrix(
672 const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
673 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
674 Tpetra::ESweepDirection direction)
const;
677 void ApplyInverseSerialGS_BlockCrsMatrix(
678 const block_crs_matrix_type& A,
679 const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
680 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
681 Tpetra::ESweepDirection direction);
684 void ApplyInverseMTSGS_CrsMatrix(
685 const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
686 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y)
const;
689 const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& B,
690 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
691 const Tpetra::ESweepDirection direction)
const;
693 void computeBlockCrs ();
696 void updateCachedMultiVector(
const Teuchos::RCP<
const Tpetra::Map<local_ordinal_type,global_ordinal_type,node_type> >& map,
size_t numVecs)
const;
709 mutable Teuchos::RCP<const Teuchos::ParameterList> validParams_;
712 Teuchos::RCP<const row_matrix_type> A_;
715 Teuchos::RCP<const import_type> Importer_;
717 Teuchos::RCP<const import_type> pointImporter_;
719 Teuchos::RCP<Tpetra::Vector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> > Diagonal_;
721 mutable Teuchos::RCP<Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> > cachedMV_;
723 typedef Kokkos::View<
typename block_crs_matrix_type::impl_scalar_type***,
724 typename block_crs_matrix_type::device_type> block_diag_type;
725 typedef Kokkos::View<
typename block_crs_matrix_type::impl_scalar_type***,
726 typename block_crs_matrix_type::device_type,
727 Kokkos::MemoryUnmanaged> unmanaged_block_diag_type;
743 block_diag_type blockDiag_;
745 Teuchos::RCP<block_multivector_type> yBlockColumnPointMap_;
750 Details::RelaxationType PrecType_ = Ifpack2::Details::JACOBI;
756 bool ZeroStartingSolution_ =
true;
758 bool DoBackwardGS_ =
false;
760 bool DoL1Method_ =
false;
766 bool fixTinyDiagEntries_ =
false;
768 bool checkDiagEntries_ =
false;
770 int clusterSize_ = 1;
772 int longRowThreshold_ = 0;
774 KokkosGraph::ColoringAlgorithm mtColoringAlgorithm_ = KokkosGraph::COLORING_DEFAULT;
777 int NumOuterSweeps_ = 1;
779 int NumInnerSweeps_ = 1;
781 bool InnerSpTrsv_ =
false;
785 bool CompactForm_ =
false;
788 bool is_matrix_structurally_symmetric_ =
false;
791 bool ifpack2_dump_matrix_ =
false;
795 bool isInitialized_ =
false;
797 bool IsComputed_ =
false;
799 int NumInitialize_ = 0;
803 bool TimerForApply_ =
true;
805 mutable int NumApply_ = 0;
807 double InitializeTime_ = 0.0;
809 double ComputeTime_ = 0.0;
811 mutable double ApplyTime_ = 0.0;
813 double ComputeFlops_ = 0.0;
815 mutable double ApplyFlops_ = 0.0;
822 size_t globalNumSmallDiagEntries_ = 0;
824 size_t globalNumZeroDiagEntries_ = 0;
826 size_t globalNumNegDiagEntries_ = 0;
838 Kokkos::View<size_t*, typename node_type::device_type> diagOffsets_;
845 bool savedDiagOffsets_ =
false;
847 bool hasBlockCrsMatrix_ =
false;
850 Teuchos::ArrayRCP<local_ordinal_type> localSmoothingIndices_;