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>
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;
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);
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,
270 const Teuchos::Ptr<
const Tpetra::RowMatrix<scalar_type,local_ordinal_type,global_ordinal_type,node_type> > &Matrix_in = Teuchos::null);
314 bool ZeroStartingSolution_;
319 int PreconditionerType_;
334 mutable int NumApply_;
336 double InitializeTime_;
340 mutable double ApplyTime_;
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_;
virtual ~Krylov()
Krylov Destructor.
Definition: Ifpack2_Krylov_def.hpp:87
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
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to an FancyOStream object.
Definition: Ifpack2_Krylov_def.hpp:342
double getComputeTime() const
Returns the time spent in Compute().
Definition: Ifpack2_Krylov_def.hpp:168
int getNumInitialize() const
Returns the number of calls to Initialize().
Definition: Ifpack2_Krylov_def.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
Krylov(const Teuchos::RCP< const Tpetra::RowMatrix< scalar_type, local_ordinal_type, global_ordinal_type, node_type > > &A)
Krylov explicit constuctor with Tpetra::RowMatrix input.
Definition: Ifpack2_Krylov_def.hpp:57
const Teuchos::RCP< const Tpetra::Map< local_ordinal_type, global_ordinal_type, node_type > > & getRangeMap() const
Tpetra::Map representing the range of this operator.
Definition: Ifpack2_Krylov_def.hpp:131
std::string description() const
Return a simple one-line description of this object.
Definition: Ifpack2_Krylov_def.hpp:320
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
magnitude_type computeCondEst(CondestType CT=Cheap, local_ordinal_type MaxIters=1550, magnitude_type Tol=1e-9, const Teuchos::Ptr< const Tpetra::RowMatrix< scalar_type, local_ordinal_type, global_ordinal_type, node_type > > &Matrix_in=Teuchos::null)
Computes the estimated condition number and returns the value.
Definition: Ifpack2_Krylov_def.hpp:182
TEUCHOS_DEPRECATED typedef Teuchos::ScalarTraits< scalar_type >::magnitudeType magnitudeType
Preserved only for backwards compatibility. Please use "magnitude_type".
Definition: Ifpack2_Krylov_decl.hpp:151
const Teuchos::RCP< const Teuchos::Comm< int > > & getComm() const
Returns the Tpetra::BlockMap object associated with the range of this matrix operator.
Definition: Ifpack2_Krylov_def.hpp:109
void apply(const Tpetra::MultiVector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > &X, Tpetra::MultiVector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, scalar_type alpha=Teuchos::ScalarTraits< scalar_type >::one(), scalar_type beta=Teuchos::ScalarTraits< scalar_type >::zero()) const
Returns the result of a few iterations of CG/GMRES on a Tpetra::MultiVector X in Y.
Definition: Ifpack2_Krylov_def.hpp:271
void setParameters(const Teuchos::ParameterList ¶ms)
Set parameters for the preconditioner.
Definition: Ifpack2_Krylov_def.hpp:92
double getApplyTime() const
Returns the time spent in apply().
Definition: Ifpack2_Krylov_def.hpp:174
Teuchos::RCP< const Tpetra::RowMatrix< scalar_type, local_ordinal_type, global_ordinal_type, node_type > > getMatrix() const
Returns a reference to the matrix to be preconditioned.
Definition: Ifpack2_Krylov_def.hpp:116
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
const Teuchos::RCP< const Tpetra::Map< local_ordinal_type, global_ordinal_type, node_type > > & getDomainMap() const
Tpetra::Map representing the domain of this operator.
Definition: Ifpack2_Krylov_def.hpp:123
void compute()
Setup iteration.
Definition: Ifpack2_Krylov_def.hpp:249
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
bool hasTransposeApply() const
Whether this object's apply() method can apply the transpose (or conjugate transpose, if applicable).
Definition: Ifpack2_Krylov_def.hpp:138
A class for constructing and using a CG/GMRES smoother.
Definition: Ifpack2_Krylov_decl.hpp:110
int getNumApply() const
Returns the number of calls to apply().
Definition: Ifpack2_Krylov_def.hpp:156
static const EVerbosityLevel verbLevel_default
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
MatrixType::global_ordinal_type global_ordinal_type
The type of global indices in the input MatrixType.
Definition: Ifpack2_Krylov_decl.hpp:134
void initialize()
Initialize Krylov preconditioner object.
Definition: Ifpack2_Krylov_def.hpp:198
double getInitializeTime() const
Returns the time spent in Initialize().
Definition: Ifpack2_Krylov_def.hpp:162
Teuchos::ScalarTraits< scalar_type >::magnitudeType magnitude_type
The type of the magnitude (absolute value) of a matrix entry.
Definition: Ifpack2_Krylov_decl.hpp:148
int getNumCompute() const
Returns the number of calls to Compute().
Definition: Ifpack2_Krylov_def.hpp:150
TEUCHOS_DEPRECATED typedef MatrixType::scalar_type Scalar
Preserved only for backwards compatibility. Please use "scalar_type".
Definition: Ifpack2_Krylov_decl.hpp:123
cheap estimate
Definition: Ifpack2_CondestType.hpp:51