50 #ifndef IFPACK2_KRYLOV_DECL_HPP 51 #define IFPACK2_KRYLOV_DECL_HPP 53 #include "Ifpack2_ConfigDefs.hpp" 54 #ifdef HAVE_IFPACK2_DEPRECATED_CODE 59 #include "BelosSolverManager.hpp" 60 #include "BelosTpetraAdapter.hpp" 61 #include "Teuchos_ScalarTraits.hpp" 62 #include <type_traits> 81 template <
typename ScalarType>
82 struct BelosScalarType {
83 typedef ScalarType type;
100 template<
class MatrixType>
101 class IFPACK2_DEPRECATED Krylov :
103 typename MatrixType::local_ordinal_type,
104 typename MatrixType::global_ordinal_type,
105 typename MatrixType::node_type>,
107 typename MatrixType::local_ordinal_type,
108 typename MatrixType::global_ordinal_type,
109 typename MatrixType::node_type> >
116 typedef typename MatrixType::scalar_type scalar_type;
119 typedef typename BelosScalarType<scalar_type>::type belos_scalar_type;
122 typedef typename MatrixType::local_ordinal_type local_ordinal_type;
125 typedef typename MatrixType::global_ordinal_type global_ordinal_type;
128 typedef typename MatrixType::node_type node_type;
131 typedef typename Teuchos::ScalarTraits<scalar_type>::magnitudeType magnitude_type;
134 typedef Tpetra::RowMatrix<scalar_type,
137 node_type> row_matrix_type;
139 static_assert(std::is_same<MatrixType, row_matrix_type>::value,
"Ifpack2::Krylov: The template parameter MatrixType must be a Tpetra::RowMatrix specialization. Please don't use Tpetra::CrsMatrix (a subclass of Tpetra::RowMatrix) here anymore. The constructor can take either a RowMatrix or a CrsMatrix just fine.");
145 node_type> prec_type;
152 explicit Krylov (
const Teuchos::RCP<const row_matrix_type>& A);
175 void setParameters (
const Teuchos::ParameterList& params);
181 inline bool isInitialized ()
const {
182 return IsInitialized_;
189 inline bool isComputed()
const {
219 virtual void setMatrix (
const Teuchos::RCP<const row_matrix_type>& A);
227 apply (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
228 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
229 Teuchos::ETransp mode = Teuchos::NO_TRANS,
230 scalar_type alpha = Teuchos::ScalarTraits<scalar_type>::one(),
231 scalar_type beta = Teuchos::ScalarTraits<scalar_type>::zero())
const;
234 Teuchos::RCP<const Tpetra::Map<local_ordinal_type,global_ordinal_type,node_type> > getDomainMap()
const;
237 Teuchos::RCP<const Tpetra::Map<local_ordinal_type,global_ordinal_type,node_type> > getRangeMap()
const;
240 bool hasTransposeApply()
const;
247 Teuchos::RCP<const Teuchos::Comm<int> > getComm()
const;
250 Teuchos::RCP<const Tpetra::RowMatrix<scalar_type,local_ordinal_type,global_ordinal_type,node_type> > getMatrix()
const;
253 int getNumInitialize()
const;
256 int getNumCompute()
const;
259 int getNumApply()
const;
262 double getInitializeTime()
const;
265 double getComputeTime()
const;
268 double getApplyTime()
const;
274 std::string description()
const;
277 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default)
const;
282 typedef Teuchos::ScalarTraits<scalar_type> STS;
283 typedef Teuchos::ScalarTraits<magnitude_type> STM;
286 Krylov (
const Krylov<MatrixType>& RHS);
289 Krylov<MatrixType>& operator= (
const Krylov<MatrixType>& RHS);
295 Teuchos::RCP<const row_matrix_type> A_;
302 std::string iterationType_;
308 magnitude_type resTol_;
314 bool ZeroStartingSolution_;
321 int PreconditionerType_;
327 Teuchos::ParameterList precParams_;
338 mutable int NumApply_;
340 double InitializeTime_;
344 mutable double ApplyTime_;
347 Teuchos::RCP<Belos::LinearProblem<belos_scalar_type,
348 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>,
349 Tpetra::Operator<scalar_type,local_ordinal_type,global_ordinal_type,node_type> > > belosProblem_;
352 Teuchos::RCP<Belos::SolverManager<belos_scalar_type,
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_;
357 Teuchos::RCP<prec_type> ifpack2_prec_;
363 #endif // HAVE_IFPACK2_DEPRECATED_CODE 364 #endif // IFPACK2_KRYLOV_DECL_HPP Mix-in interface for preconditioners that can change their matrix after construction.
Definition: Ifpack2_Details_CanChangeMatrix.hpp:93
Interface for all Ifpack2 preconditioners.
Definition: Ifpack2_Preconditioner.hpp:107
Declaration of interface for preconditioners that can change their matrix after construction.
Ifpack2 features that have been DEPRECATED and may DISAPPEAR AT ANY TIME. USE AT YOUR OWN RISK...
Definition: Ifpack2_Container.hpp:774
Preconditioners and smoothers for Tpetra sparse matrices.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:72