Teko  Version of the Day
 All Classes Files Functions Variables Pages
Teko_MLLinearOp.hpp
1 // @HEADER
2 // *****************************************************************************
3 // Teko: A package for block and physics based preconditioning
4 //
5 // Copyright 2010 NTESS and the Teko contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef __Teko_MLLinearOp_hpp__
11 #define __Teko_MLLinearOp_hpp__
12 
13 #include "Teko_Utilities.hpp"
14 #include "Teko_BlockImplicitLinearOp.hpp"
15 
16 // forward declarations!
17 namespace ML_Epetra {
18 class MultiLevelPreconditioner;
19 }
20 
21 namespace Teko {
22 
23 namespace Epetra {
24 class MappingStrategy;
25 class EpetraOperatorWrapper;
26 } // namespace Epetra
27 
28 class MLLinearOp : public BlockImplicitLinearOp {
29  public:
30  MLLinearOp(const Teuchos::RCP<ML_Epetra::MultiLevelPreconditioner> &mlPrecOp);
31 
33  virtual VectorSpace range() const { return productRange_; }
34 
36  virtual VectorSpace domain() const { return productDomain_; }
37 
50  virtual void implicitApply(const BlockedMultiVector &x, BlockedMultiVector &y,
51  const double alpha = 1.0, const double beta = 0.0) const;
52 
53  virtual void describe(Teuchos::FancyOStream &out_arg,
54  const Teuchos::EVerbosityLevel verbLevel) const;
55 
56  Teuchos::RCP<const ML_Epetra::MultiLevelPreconditioner> getMLPreconditioner() const;
57  Teuchos::RCP<ML_Epetra::MultiLevelPreconditioner> getMLPreconditioner();
58 
59  protected:
60  void extractConversionInformation(ML_Epetra::MultiLevelPreconditioner &mlPrec);
61 
62  Teuchos::RCP<const Thyra::ProductVectorSpaceBase<double> >
63  productRange_;
64  Teuchos::RCP<const Thyra::ProductVectorSpaceBase<double> >
65  productDomain_;
66 
67  Teuchos::RCP<ML_Epetra::MultiLevelPreconditioner> mlPrecOp_;
68  Teuchos::RCP<Epetra::EpetraOperatorWrapper> Amat_;
69  Teuchos::RCP<const Epetra::MappingStrategy>
70  mappingStrategy_;
71 
72  mutable Teuchos::RCP<Epetra_MultiVector> eX_, eY_; // storage to avoid repeated reallocation
73 
74  private:
75  // hide me!
76  MLLinearOp();
77  MLLinearOp(const MLLinearOp &);
78 };
79 
80 Teuchos::RCP<const ML_Epetra::MultiLevelPreconditioner> getMLPreconditioner(
81  const Teko::LinearOp &lo);
82 
83 } // namespace Teko
84 
85 #endif
virtual void implicitApply(const Thyra::EOpTransp M_trans, const BlockedMultiVector &x, BlockedMultiVector &y, const double alpha=1.0, const double beta=0.0) const
Perform a matrix vector multiply with this implicitly defined blocked operator.