115 typedef ScalarType
ST;
117 typedef Teuchos::ScalarTraits<ScalarType>
STS;
119 typedef typename STS::magnitudeType
MT;
121 typedef Tpetra::Operator<
typename MV::scalar_type,
122 typename MV::local_ordinal_type,
123 typename MV::global_ordinal_type,
126 typedef Tpetra::RowMatrix<
typename MV::scalar_type,
127 typename MV::local_ordinal_type,
128 typename MV::global_ordinal_type,
131 typedef Tpetra::Vector<
typename MV::scalar_type,
132 typename MV::local_ordinal_type,
133 typename MV::global_ordinal_type,
134 typename MV::node_type>
V;
136 typedef Tpetra::Map<
typename MV::local_ordinal_type,
137 typename MV::global_ordinal_type,
148 Chebyshev (Teuchos::RCP<const row_matrix_type> A);
159 Chebyshev (Teuchos::RCP<const row_matrix_type> A, Teuchos::ParameterList& params);
271 void setZeroStartingSolution (
bool zeroStartingSolution) { zeroStartingSolution_ = zeroStartingSolution; }
326 ST getLambdaMaxForApply()
const;
329 Teuchos::RCP<const row_matrix_type>
getMatrix ()
const;
336 void setMatrix (
const Teuchos::RCP<const row_matrix_type>& A);
342 void print (std::ostream& out);
353 describe (Teuchos::FancyOStream& out,
354 const Teuchos::EVerbosityLevel verbLevel =
355 Teuchos::Describable::verbLevel_default)
const;
367 Teuchos::RCP<const row_matrix_type> A_;
370 Teuchos::RCP<ChebyshevKernel<op_type> > ck_;
382 Teuchos::RCP<const V> D_;
385 typedef Kokkos::View<size_t*, typename MV::node_type::device_type> offsets_type;
392 offsets_type diagOffsets_;
401 bool savedDiagOffsets_;
411 Teuchos::RCP<MV> W2_;
418 ST computedLambdaMax_;
425 ST computedLambdaMin_;
433 ST lambdaMaxForApply_;
444 ST lambdaMinForApply_;
447 ST eigRatioForApply_;
457 Teuchos::RCP<const V> userInvDiag_;
490 bool eigKeepVectors_;
493 std::string eigenAnalysisType_;
496 Teuchos::RCP<V> eigVector_;
497 Teuchos::RCP<V> eigVector2_;
500 int eigNormalizationFreq_;
503 bool zeroStartingSolution_;
511 bool assumeMatrixUnchanged_;
514 std::string chebyshevAlgorithm_;
517 bool computeMaxResNorm_;
520 bool computeSpectralRadius_;
524 bool ckUseNativeSpMV_;
529 Teuchos::RCP<Teuchos::FancyOStream> out_;
539 void checkConstructorInput ()
const;
542 void checkInputMatrix ()
const;
558 Teuchos::RCP<MV> makeTempMultiVector (
const MV& B);
566 Teuchos::RCP<MV> makeSecondTempMultiVector (
const MV& B);
570 firstIterationWithZeroStartingSolution
572 const ScalarType& alpha,
579 computeResidual (MV& R,
const MV& B,
const op_type& A,
const MV& X,
580 const Teuchos::ETransp mode = Teuchos::NO_TRANS);
587 static void solve (MV& Z,
const V& D_inv,
const MV& R);
594 static void solve (MV& Z,
const ST alpha,
const V& D_inv,
const MV& R);
603 Teuchos::RCP<const V>
604 makeInverseDiagonal (
const row_matrix_type& A,
const bool useDiagOffsets=
false)
const;
615 Teuchos::RCP<V> makeRangeMapVector (
const Teuchos::RCP<V>& D)
const;
618 Teuchos::RCP<const V>
619 makeRangeMapVectorConst (
const Teuchos::RCP<const V>& D)
const;
640 textbookApplyImpl (
const op_type& A,
647 const V& D_inv)
const;
671 fourthKindApplyImpl (
const op_type& A,
701 ifpackApplyImpl (
const op_type& A,
723 cgMethodWithInitGuess (
const op_type& A,
const V& D_inv,
const int numIters,
V& x);
735 cgMethod (
const op_type& A,
const V& D_inv,
const int numIters);
738 static MT maxNormInf (
const MV& X);
776 const ST zero = Teuchos::as<ST> (0);
777 const ST one = Teuchos::as<ST> (1);
778 const ST two = Teuchos::as<ST> (2);
780 MV pAux (B.getMap (), B.getNumVectors ());
781 MV dk (B.getMap (), B.getNumVectors ());
782 MV R (B.getMap (), B.getNumVectors ());
784 ST beta = Teuchos::as<ST> (1.1) * lambdaMax;
785 ST alpha = lambdaMax / eigRatio;
787 ST delta = (beta - alpha) / two;
788 ST theta = (beta + alpha) / two;
789 ST s1 = theta / delta;
800 if (lambdaMin == one && lambdaMin == lambdaMax) {
809 if (! zeroStartingSolution_) {
813 R.update (-one, pAux, one);
814 dk.elementWiseMultiply (one/theta, D_inv, R, zero);
815 X.update (one, dk, one);
817 dk.elementWiseMultiply (one/theta, D_inv, B, zero);
821 ST rhokp1, dtemp1, dtemp2;
822 for (
int k = 0; k < numIters-1; ++k) {
824 rhokp1 = one / (two*s1 - rhok);
825 dtemp1 = rhokp1*rhok;
826 dtemp2 = two*rhokp1/delta;
830 R.update (-one, pAux, one);
832 dk.elementWiseMultiply (dtemp2, D_inv, B, dtemp1);
833 X.update (one, dk, one);
Tpetra::Vector< typename MV::scalar_type, typename MV::local_ordinal_type, typename MV::global_ordinal_type, typename MV::node_type > V
Specialization of Tpetra::Vector.
Definition Ifpack2_Details_Chebyshev_decl.hpp:134
Tpetra::RowMatrix< typename MV::scalar_type, typename MV::local_ordinal_type, typename MV::global_ordinal_type, typename MV::node_type > row_matrix_type
Specialization of Tpetra::RowMatrix.
Definition Ifpack2_Details_Chebyshev_decl.hpp:129
Tpetra::Operator< typename MV::scalar_type, typename MV::local_ordinal_type, typename MV::global_ordinal_type, typename MV::node_type > op_type
Specialization of Tpetra::Operator.
Definition Ifpack2_Details_Chebyshev_decl.hpp:124