Teko  Version of the Day
 All Classes Files Functions Variables Pages
Teko_MLLinearOp.hpp
1 #ifndef __Teko_MLLinearOp_hpp__
2 #define __Teko_MLLinearOp_hpp__
3 
4 #include "Teko_Utilities.hpp"
5 #include "Teko_BlockImplicitLinearOp.hpp"
6 
7 // forward declarations!
8 namespace ML_Epetra {
9 class MultiLevelPreconditioner;
10 }
11 
12 namespace Teko {
13 
14 namespace Epetra {
15 class MappingStrategy;
16 class EpetraOperatorWrapper;
17 }
18 
19 class MLLinearOp : public BlockImplicitLinearOp {
20 public:
21  MLLinearOp(const Teuchos::RCP<ML_Epetra::MultiLevelPreconditioner> & mlPrecOp);
22 
24  virtual VectorSpace range() const { return productRange_; }
25 
27  virtual VectorSpace domain() const { return productDomain_; }
28 
41  virtual void implicitApply(const BlockedMultiVector & x, BlockedMultiVector & y,
42  const double alpha = 1.0, const double beta = 0.0) const;
43 
44  virtual void describe(Teuchos::FancyOStream & out_arg,
45  const Teuchos::EVerbosityLevel verbLevel) const;
46 
47  Teuchos::RCP<const ML_Epetra::MultiLevelPreconditioner> getMLPreconditioner() const;
48  Teuchos::RCP<ML_Epetra::MultiLevelPreconditioner> getMLPreconditioner();
49 
50 protected:
51 
52  void extractConversionInformation(ML_Epetra::MultiLevelPreconditioner & mlPrec);
53 
54  Teuchos::RCP<const Thyra::ProductVectorSpaceBase<double> > productRange_;
55  Teuchos::RCP<const Thyra::ProductVectorSpaceBase<double> > productDomain_;
56 
57  Teuchos::RCP<ML_Epetra::MultiLevelPreconditioner> mlPrecOp_;
58  Teuchos::RCP<Epetra::EpetraOperatorWrapper> Amat_;
59  Teuchos::RCP<const Epetra::MappingStrategy> mappingStrategy_;
60 
61  mutable Teuchos::RCP<Epetra_MultiVector> eX_, eY_; // storage to avoid repeated reallocation
62 
63 private:
64  // hide me!
65  MLLinearOp();
66  MLLinearOp(const MLLinearOp &);
67 };
68 
69 Teuchos::RCP<const ML_Epetra::MultiLevelPreconditioner> getMLPreconditioner(const Teko::LinearOp & lo);
70 
71 }
72 
73 #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.