Thyra Package Browser (Single Doxygen Collection)
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
adapters
epetra
src
Thyra_EpetraOperatorWrapper.hpp
Go to the documentation of this file.
1
// @HEADER
2
// ***********************************************************************
3
//
4
// Thyra: Interfaces and Support for Abstract Numerical Algorithms
5
// Copyright (2004) Sandia Corporation
6
//
7
// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8
// license for use of this work by or on behalf of the U.S. Government.
9
//
10
// Redistribution and use in source and binary forms, with or without
11
// modification, are permitted provided that the following conditions are
12
// met:
13
//
14
// 1. Redistributions of source code must retain the above copyright
15
// notice, this list of conditions and the following disclaimer.
16
//
17
// 2. Redistributions in binary form must reproduce the above copyright
18
// notice, this list of conditions and the following disclaimer in the
19
// documentation and/or other materials provided with the distribution.
20
//
21
// 3. Neither the name of the Corporation nor the names of the
22
// contributors may be used to endorse or promote products derived from
23
// this software without specific prior written permission.
24
//
25
// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36
//
37
// Questions? Contact Roscoe A. Bartlett (bartlettra@ornl.gov)
38
//
39
// ***********************************************************************
40
// @HEADER
41
42
#ifndef THYRA_EPETRA_OPERATOR_WRAPPER_HPP
43
#define THYRA_EPETRA_OPERATOR_WRAPPER_HPP
44
45
#include "Thyra_LinearOpBase.hpp"
46
#include "Epetra_Map.h"
47
#include "Epetra_Comm.h"
48
#include "Epetra_MultiVector.h"
49
#include "Epetra_Operator.h"
50
51
52
namespace
Thyra
{
53
54
63
class
EpetraOperatorWrapper
:
public
Epetra_Operator
64
{
65
public
:
66
69
71
EpetraOperatorWrapper
(
const
RCP
<
const
LinearOpBase<double> > &thyraOp);
72
74
RCP<const LinearOpBase<double>
>
getThyraOp
()
const
75
{
76
return
thyraOp_
;
77
}
78
80
void
copyEpetraIntoThyra
(
const
Epetra_MultiVector &x,
81
const
Ptr<VectorBase<double> > &thyraVec)
const
;
82
84
void
copyThyraIntoEpetra
(
const
VectorBase<double> &thyraVec,
85
Epetra_MultiVector &x)
const
;
86
88
91
93
int
SetUseTranspose
(
bool
UseTranspose_in)
94
{
95
useTranspose_
= UseTranspose_in;
96
return
0;
97
}
98
100
int
Apply
(
const
Epetra_MultiVector& X, Epetra_MultiVector& Y)
const
;
101
103
int
ApplyInverse
(
const
Epetra_MultiVector& X, Epetra_MultiVector& Y)
const
;
104
106
double
NormInf
()
const
;
107
109
const
char
*
Label
()
const
{
return
label_
.c_str();}
110
112
bool
UseTranspose
()
const
{
return
useTranspose_
;}
113
115
bool
HasNormInf
()
const
{
return
false
;}
116
118
const
Epetra_Comm&
Comm
()
const
{
return
*
comm_
;}
119
121
const
Epetra_Map&
OperatorDomainMap
()
const
{
return
*
domainMap_
;}
122
124
const
Epetra_Map&
OperatorRangeMap
()
const
{
return
*
rangeMap_
;}
125
127
128
private
:
129
130
bool
useTranspose_
;
131
RCP<const LinearOpBase<double>
>
thyraOp_
;
132
RCP<const VectorSpaceBase<double>
>
range_
;
133
RCP<const VectorSpaceBase<double>
>
domain_
;
134
RCP<const Epetra_Comm>
comm_
;
135
RCP<const Epetra_Map>
rangeMap_
;
136
RCP<const Epetra_Map>
domainMap_
;
137
138
std::string
label_
;
139
140
static
RCP<const Epetra_Comm>
getEpetraComm
(
const
LinearOpBase<double>& thyraOp);
141
142
};
143
144
153
RCP<const LinearOpBase<double>
>
154
makeEpetraWrapper
(
const
RCP
<
const
LinearOpBase<double> > &thyraOp);
155
156
157
}
// namespace Thyra
158
159
160
#endif
// THYRA_EPETRA_OPERATOR_WRAPPER_HPP
Teuchos::RCP
Thyra::EpetraOperatorWrapper::copyEpetraIntoThyra
void copyEpetraIntoThyra(const Epetra_MultiVector &x, const Ptr< VectorBase< double > > &thyraVec) const
Definition
Thyra_EpetraOperatorWrapper.cpp:82
Thyra::EpetraOperatorWrapper::OperatorRangeMap
const Epetra_Map & OperatorRangeMap() const
Definition
Thyra_EpetraOperatorWrapper.hpp:124
Thyra::EpetraOperatorWrapper::SetUseTranspose
int SetUseTranspose(bool UseTranspose_in)
Definition
Thyra_EpetraOperatorWrapper.hpp:93
Thyra::EpetraOperatorWrapper::getEpetraComm
static RCP< const Epetra_Comm > getEpetraComm(const LinearOpBase< double > &thyraOp)
Definition
Thyra_EpetraOperatorWrapper.cpp:202
Thyra::EpetraOperatorWrapper::ApplyInverse
int ApplyInverse(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Definition
Thyra_EpetraOperatorWrapper.cpp:181
Thyra::EpetraOperatorWrapper::rangeMap_
RCP< const Epetra_Map > rangeMap_
Definition
Thyra_EpetraOperatorWrapper.hpp:135
Thyra::EpetraOperatorWrapper::OperatorDomainMap
const Epetra_Map & OperatorDomainMap() const
Definition
Thyra_EpetraOperatorWrapper.hpp:121
Thyra::EpetraOperatorWrapper::HasNormInf
bool HasNormInf() const
Definition
Thyra_EpetraOperatorWrapper.hpp:115
Thyra::EpetraOperatorWrapper::UseTranspose
bool UseTranspose() const
Definition
Thyra_EpetraOperatorWrapper.hpp:112
Thyra::EpetraOperatorWrapper::makeEpetraWrapper
RCP< const LinearOpBase< double > > makeEpetraWrapper(const RCP< const LinearOpBase< double > > &thyraOp)
Wrap a Thyra operator in the Epetra_Operator interface, and then wrap it again in a Thyra operator in...
Thyra::EpetraOperatorWrapper::getThyraOp
RCP< const LinearOpBase< double > > getThyraOp() const
Definition
Thyra_EpetraOperatorWrapper.hpp:74
Thyra::EpetraOperatorWrapper::Label
const char * Label() const
Definition
Thyra_EpetraOperatorWrapper.hpp:109
Thyra::EpetraOperatorWrapper::EpetraOperatorWrapper
EpetraOperatorWrapper(const RCP< const LinearOpBase< double > > &thyraOp)
Definition
Thyra_EpetraOperatorWrapper.cpp:68
Thyra::EpetraOperatorWrapper::useTranspose_
bool useTranspose_
Definition
Thyra_EpetraOperatorWrapper.hpp:130
Thyra::EpetraOperatorWrapper::domainMap_
RCP< const Epetra_Map > domainMap_
Definition
Thyra_EpetraOperatorWrapper.hpp:136
Thyra::EpetraOperatorWrapper::label_
std::string label_
Definition
Thyra_EpetraOperatorWrapper.hpp:138
Thyra::EpetraOperatorWrapper::comm_
RCP< const Epetra_Comm > comm_
Definition
Thyra_EpetraOperatorWrapper.hpp:134
Thyra::EpetraOperatorWrapper::Comm
const Epetra_Comm & Comm() const
Definition
Thyra_EpetraOperatorWrapper.hpp:118
Thyra::EpetraOperatorWrapper::copyThyraIntoEpetra
void copyThyraIntoEpetra(const VectorBase< double > &thyraVec, Epetra_MultiVector &x) const
Definition
Thyra_EpetraOperatorWrapper.cpp:120
Thyra::EpetraOperatorWrapper::NormInf
double NormInf() const
Definition
Thyra_EpetraOperatorWrapper.cpp:190
Thyra::EpetraOperatorWrapper::thyraOp_
RCP< const LinearOpBase< double > > thyraOp_
Definition
Thyra_EpetraOperatorWrapper.hpp:131
Thyra::EpetraOperatorWrapper::Apply
int Apply(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Definition
Thyra_EpetraOperatorWrapper.cpp:159
Thyra::EpetraOperatorWrapper::range_
RCP< const VectorSpaceBase< double > > range_
Definition
Thyra_EpetraOperatorWrapper.hpp:132
Thyra::EpetraOperatorWrapper::domain_
RCP< const VectorSpaceBase< double > > domain_
Definition
Thyra_EpetraOperatorWrapper.hpp:133
Thyra
Definition
Thyra_DiagonalEpetraLinearOpWithSolveFactory.cpp:53
Generated by
1.17.0