Thyra Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Thyra_EpetraOperatorWrapper.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Thyra: Interfaces and Support for Abstract Numerical Algorithms
4 //
5 // Copyright 2004 NTESS and the Thyra contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef THYRA_EPETRA_OPERATOR_WRAPPER_HPP
11 #define THYRA_EPETRA_OPERATOR_WRAPPER_HPP
12 
13 #include "Thyra_LinearOpBase.hpp"
14 #include "Epetra_Map.h"
15 #include "Epetra_Comm.h"
16 #include "Epetra_MultiVector.h"
17 #include "Epetra_Operator.h"
18 
19 
20 namespace Thyra {
21 
22 
31 class EpetraOperatorWrapper : public Epetra_Operator
32 {
33 public:
34 
37 
39  EpetraOperatorWrapper(const RCP<const LinearOpBase<double> > &thyraOp);
40 
43  {
44  return thyraOp_;
45  }
46 
48  void copyEpetraIntoThyra(const Epetra_MultiVector &x,
49  const Ptr<VectorBase<double> > &thyraVec) const;
50 
52  void copyThyraIntoEpetra(const VectorBase<double> &thyraVec,
53  Epetra_MultiVector &x) const;
54 
56 
59 
61  int SetUseTranspose(bool UseTranspose_in)
62  {
63  useTranspose_ = UseTranspose_in;
64  return 0;
65  }
66 
68  int Apply(const Epetra_MultiVector& X, Epetra_MultiVector& Y) const ;
69 
71  int ApplyInverse(const Epetra_MultiVector& X, Epetra_MultiVector& Y) const ;
72 
74  double NormInf() const ;
75 
77  const char* Label() const {return label_.c_str();}
78 
80  bool UseTranspose() const {return useTranspose_;}
81 
83  bool HasNormInf() const {return false;}
84 
86  const Epetra_Comm& Comm() const {return *comm_;}
87 
89  const Epetra_Map& OperatorDomainMap() const {return *domainMap_;}
90 
92  const Epetra_Map& OperatorRangeMap() const {return *rangeMap_;}
93 
95 
96 private:
97 
105 
106  std::string label_;
107 
108  static RCP<const Epetra_Comm> getEpetraComm(const LinearOpBase<double>& thyraOp);
109 
110 };
111 
112 
122 makeEpetraWrapper(const RCP<const LinearOpBase<double> > &thyraOp);
123 
124 
125 } // namespace Thyra
126 
127 
128 #endif // THYRA_EPETRA_OPERATOR_WRAPPER_HPP
129 
130 #if defined(Thyra_SHOW_DEPRECATED_WARNINGS)
131 #ifdef __GNUC__
132 #warning "The ThyraEpetraAdapters package is deprecated"
133 #endif
134 #endif
135 
void copyEpetraIntoThyra(const Epetra_MultiVector &x, const Ptr< VectorBase< double > > &thyraVec) const
EpetraOperatorWrapper(const RCP< const LinearOpBase< double > > &thyraOp)
static RCP< const Epetra_Comm > getEpetraComm(const LinearOpBase< double > &thyraOp)
const Epetra_Map & OperatorDomainMap() const
int SetUseTranspose(bool UseTranspose_in)
RCP< const LinearOpBase< double > > getThyraOp() const
int Apply(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
const Epetra_Map & OperatorRangeMap() const
Implements the Epetra_Operator interface with a Thyra LinearOperator.
RCP< const VectorSpaceBase< double > > range_
RCP< const VectorSpaceBase< double > > domain_
void copyThyraIntoEpetra(const VectorBase< double > &thyraVec, Epetra_MultiVector &x) const
int ApplyInverse(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
RCP< const LinearOpBase< double > > thyraOp_