Teko Version of the Day
Loading...
Searching...
No Matches
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!
17namespace ML_Epetra {
18class MultiLevelPreconditioner;
19}
20
21namespace Teko {
22
23namespace Epetra {
24class MappingStrategy;
26} // namespace Epetra
27
28class 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
80Teuchos::RCP<const ML_Epetra::MultiLevelPreconditioner> getMLPreconditioner(
81 const Teko::LinearOp &lo);
82
83} // namespace Teko
84
85#endif
A virtual class that simplifies the construction of custom operators.
virtual VectorSpace range() const =0
Range space of this operator.
virtual VectorSpace domain() const =0
Domain space of this operator.
Implements the Epetra_Operator interface with a Thyra LinearOperator. This enables the use of absrtac...
Abstract Mapping strategy for an EpetraOperatorWrapper.