49 #ifndef IFPACK2_KRYLOV_DECL_HPP 50 #define IFPACK2_KRYLOV_DECL_HPP 52 #include "Ifpack2_ConfigDefs.hpp" 53 #include "Ifpack2_Preconditioner.hpp" 54 #include "Ifpack2_Condest.hpp" 55 #include "Ifpack2_Heap.hpp" 56 #include "Ifpack2_Parameters.hpp" 57 #include "Ifpack2_Relaxation.hpp" 58 #include "Ifpack2_Chebyshev.hpp" 59 #include "Ifpack2_ILUT.hpp" 60 #include "Ifpack2_AdditiveSchwarz.hpp" 64 #include <BelosTpetraAdapter.hpp> 68 #include <Teuchos_Assert.hpp> 69 #include <Teuchos_RCP.hpp> 70 #include <Teuchos_Time.hpp> 71 #include <Teuchos_TypeNameTraits.hpp> 72 #include <Teuchos_ScalarTraits.hpp> 96 template <
typename ScalarType>
98 typedef ScalarType type;
109 template<
class MatrixType,
class PrecType>
110 class Krylov:
virtual public Ifpack2::Preconditioner<typename MatrixType::scalar_type,typename MatrixType::local_ordinal_type,typename MatrixType::global_ordinal_type,typename MatrixType::node_type> {
123 TEUCHOS_DEPRECATED
typedef typename MatrixType::scalar_type
Scalar;
130 TEUCHOS_DEPRECATED
typedef typename MatrixType::local_ordinal_type
LocalOrdinal;
137 TEUCHOS_DEPRECATED
typedef typename MatrixType::global_ordinal_type
GlobalOrdinal;
144 TEUCHOS_DEPRECATED
typedef typename MatrixType::node_type
Node;
148 typedef typename Teuchos::ScalarTraits<scalar_type>::magnitudeType
magnitude_type;
151 TEUCHOS_DEPRECATED
typedef typename Teuchos::ScalarTraits<scalar_type>::magnitudeType
magnitudeType;
154 typedef typename Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>
TMV;
155 typedef typename Tpetra::Operator<scalar_type,local_ordinal_type,global_ordinal_type,node_type> TOP;
162 explicit Krylov(
const Teuchos::RCP<
const Tpetra::RowMatrix<scalar_type,local_ordinal_type,global_ordinal_type,node_type> > &A);
179 void setParameters(
const Teuchos::ParameterList& params);
188 return(IsInitialized_);
219 const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
220 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
221 Teuchos::ETransp mode = Teuchos::NO_TRANS,
222 scalar_type alpha = Teuchos::ScalarTraits<scalar_type>::one(),
223 scalar_type beta = Teuchos::ScalarTraits<scalar_type>::zero())
const;
226 const Teuchos::RCP<const Tpetra::Map<local_ordinal_type,global_ordinal_type,node_type> >& getDomainMap()
const;
229 const Teuchos::RCP<const Tpetra::Map<local_ordinal_type,global_ordinal_type,node_type> >& getRangeMap()
const;
232 bool hasTransposeApply()
const;
243 const Teuchos::RCP<const Teuchos::Comm<int> > & getComm()
const;
246 Teuchos::RCP<const Tpetra::RowMatrix<scalar_type,local_ordinal_type,global_ordinal_type,node_type> > getMatrix()
const;
249 int getNumInitialize()
const;
252 int getNumCompute()
const;
255 int getNumApply()
const;
258 double getInitializeTime()
const;
261 double getComputeTime()
const;
264 double getApplyTime()
const;
268 local_ordinal_type MaxIters = 1550,
269 magnitude_type Tol = 1e-9,
270 const Teuchos::Ptr<
const Tpetra::RowMatrix<scalar_type,local_ordinal_type,global_ordinal_type,node_type> > &Matrix_in = Teuchos::null);
276 std::string description()
const;
279 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default)
const;
298 const Teuchos::RCP<const Tpetra::RowMatrix<scalar_type,local_ordinal_type,global_ordinal_type,node_type> > A_;
300 const Teuchos::RCP<const Teuchos::Comm<int> > Comm_;
310 magnitude_type ResidualTolerance_;
314 bool ZeroStartingSolution_;
319 int PreconditionerType_;
321 Teuchos::ParameterList params_;
324 magnitude_type Condest_;
334 mutable int NumApply_;
336 double InitializeTime_;
340 mutable double ApplyTime_;
342 mutable Teuchos::Time Time_;
344 local_ordinal_type NumMyRows_;
346 global_size_t NumGlobalNonzeros_;
350 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>,
351 Tpetra::Operator<scalar_type,local_ordinal_type,global_ordinal_type,node_type> > > belosProblem_;
353 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>,
354 Tpetra::Operator<scalar_type,local_ordinal_type,global_ordinal_type,node_type> > > belosSolver_;
355 Teuchos::RCP<Teuchos::ParameterList> belosList_;
356 Teuchos::RCP<PrecType> ifpack2_prec_;
CondestType
Ifpack2::CondestType: enum to define the type of condition number estimate.
Definition: Ifpack2_CondestType.hpp:50
TEUCHOS_DEPRECATED typedef MatrixType::node_type Node
Preserved only for backwards compatibility. Please use "node_type".
Definition: Ifpack2_Krylov_decl.hpp:144
MatrixType::node_type node_type
The type of the Kokkos Node used by the input MatrixType.
Definition: Ifpack2_Krylov_decl.hpp:141
A traits class for determining the scalar type to use for Belos.
Definition: Ifpack2_Krylov_decl.hpp:97
bool isInitialized() const
Returns true if the preconditioner has been successfully initialized.
Definition: Ifpack2_Krylov_decl.hpp:187
TEUCHOS_DEPRECATED typedef MatrixType::local_ordinal_type LocalOrdinal
Preserved only for backwards compatibility. Please use "local_ordinal_type".
Definition: Ifpack2_Krylov_decl.hpp:130
TEUCHOS_DEPRECATED typedef Teuchos::ScalarTraits< scalar_type >::magnitudeType magnitudeType
Preserved only for backwards compatibility. Please use "magnitude_type".
Definition: Ifpack2_Krylov_decl.hpp:151
BelosScalarType< scalar_type >::type belos_scalar_type
The scalar type used by Belos (which may not be scalar_type)
Definition: Ifpack2_Krylov_decl.hpp:120
Tpetra::MultiVector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > TMV
Tpetra MultiVector/Operator.
Definition: Ifpack2_Krylov_decl.hpp:154
magnitude_type getCondEst() const
Returns the computed estimated condition number, or -1.0 if no computed.
Definition: Ifpack2_Krylov_decl.hpp:235
MatrixType::local_ordinal_type local_ordinal_type
The type of local indices in the input MatrixType.
Definition: Ifpack2_Krylov_decl.hpp:127
MatrixType::scalar_type scalar_type
The type of the entries of the input MatrixType.
Definition: Ifpack2_Krylov_decl.hpp:117
Base class for all Ifpack2 preconditioners.
Definition: Ifpack2_Preconditioner.hpp:130
A class for constructing and using a CG/GMRES smoother.
Definition: Ifpack2_Krylov_decl.hpp:110
TEUCHOS_DEPRECATED typedef MatrixType::global_ordinal_type GlobalOrdinal
Preserved only for backwards compatibility. Please use "global_ordinal_type".
Definition: Ifpack2_Krylov_decl.hpp:137
bool isComputed() const
If compute() is completed, this query returns true, otherwise it returns false.
Definition: Ifpack2_Krylov_decl.hpp:202
Definition: Ifpack2_BlockRelaxation_decl.hpp:64
MatrixType::global_ordinal_type global_ordinal_type
The type of global indices in the input MatrixType.
Definition: Ifpack2_Krylov_decl.hpp:134
Teuchos::ScalarTraits< scalar_type >::magnitudeType magnitude_type
The type of the magnitude (absolute value) of a matrix entry.
Definition: Ifpack2_Krylov_decl.hpp:148
TEUCHOS_DEPRECATED typedef MatrixType::scalar_type Scalar
Preserved only for backwards compatibility. Please use "scalar_type".
Definition: Ifpack2_Krylov_decl.hpp:123
Ifpack2::Container: a pure virtual class for creating and solving local linear problems.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:67
cheap estimate
Definition: Ifpack2_CondestType.hpp:51