Thyra
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
adapters
tpetra
src
Thyra_TpetraVectorSpace_decl.hpp
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_TPETRA_VECTOR_SPACE_DECL_HPP
11
#define THYRA_TPETRA_VECTOR_SPACE_DECL_HPP
12
13
14
#include "Thyra_SpmdVectorSpaceDefaultBase.hpp"
15
#include "Tpetra_Map.hpp"
16
#include "Tpetra_MultiVector.hpp"
17
18
19
namespace
Thyra {
20
21
26
template
<
class
Scalar,
class
LocalOrdinal,
class
GlobalOrdinal,
class
Node>
27
class
TpetraVectorSpace :
public
SpmdVectorSpaceDefaultBase
<Scalar>
28
{
29
public
:
30
32
typedef
TpetraVectorSpace<Scalar,LocalOrdinal,GlobalOrdinal,Node>
this_t
;
33
36
38
static
RCP<TpetraVectorSpace<Scalar,LocalOrdinal,GlobalOrdinal,Node>
>
create
();
39
41
void
initialize
(
42
const
RCP
<
const
Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node> > &tpetraMap
43
);
44
46
48
49
54
RCP<TpetraVectorSpace<Scalar,LocalOrdinal,GlobalOrdinal,Node>
>
55
createLocallyReplicatedVectorSpace
(
int
size)
const
;
56
58
61
64
bool
hasInCoreView
(
65
const
Range1D
& rng,
const
EViewType
viewType,
const
EStrideType
strideType
66
)
const
;
68
RCP< const VectorSpaceBase<Scalar>
>
clone
()
const
;
69
71
RCP<const Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node>
>
72
getTpetraMap
()
const
;
73
75
76
protected
:
77
80
82
RCP<VectorBase<Scalar>
>
83
createMember
()
const
;
85
RCP<MultiVectorBase<Scalar>
>
86
createMembers
(
int
numMembers)
const
;
87
88
public
:
89
90
RCP<MultiVectorBase<Scalar>
>
91
createCachedMembersView
(
const
RTOpPack::SubMultiVectorView<Scalar>
&raw_mv,
bool
initialize
=
true
)
const
;
92
93
RCP<const MultiVectorBase<Scalar>
>
94
createCachedMembersView
(
const
RTOpPack::ConstSubMultiVectorView<Scalar>
&raw_mv )
const
;
95
97
98
public
:
99
102
104
RCP<const Teuchos::Comm<Ordinal>
>
getComm
()
const
;
106
Ordinal
localSubDim
()
const
;
107
109
110
private
:
111
112
// //////////////////////////////////////
113
// Private data members
114
115
RCP<const Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node>
> tpetraMap_;
116
mutable
RCP<TpetraVectorSpace<Scalar,LocalOrdinal,GlobalOrdinal,Node>
> tpetraDomainSpace_;
117
mutable
RCP<Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>
> tpetraMV_;
118
// The only reason Thyra needs this comm_ object is because Thyra
119
// uses Ordinal as the Comm template parameter, while Tpetra uses
120
// int. Ordinal is some 64-bit type, which doesn't make any sense,
121
// given that MPI implementations currently only allow 32-bit
122
// process ranks. This is why Thyra does not just use the Map's
123
// stored communicator.
124
RCP<const Teuchos::Comm<Ordinal>
> comm_;
125
RCP<this_t>
weakSelfPtr_;
126
127
// /////////////////////////////////////
128
// Private member functions
129
130
TpetraVectorSpace();
131
132
};
// end class TpetraVectorSpace
133
134
139
template
<
class
Scalar,
class
LocalOrdinal,
class
GlobalOrdinal,
class
Node>
140
RCP<TpetraVectorSpace<Scalar,LocalOrdinal,GlobalOrdinal,Node>
>
141
tpetraVectorSpace
(
142
const
RCP
<
const
Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node> > &tpetraMap
143
)
144
{
145
RCP<TpetraVectorSpace<Scalar,LocalOrdinal,GlobalOrdinal,Node>
> vs =
146
TpetraVectorSpace<Scalar,LocalOrdinal,GlobalOrdinal,Node>::create
();
147
vs->initialize(tpetraMap);
148
return
vs;
149
}
150
151
152
}
// end namespace Thyra
153
154
155
#endif
// THYRA_TPETRA_VECTOR_SPACE_DECL_HPP
RTOpPack::ConstSubMultiVectorView
RTOpPack::SubMultiVectorView
Teuchos::RCP
Thyra::SpmdVectorSpaceDefaultBase::SpmdVectorSpaceDefaultBase
SpmdVectorSpaceDefaultBase()
Definition
Thyra_SpmdVectorSpaceDefaultBase_def.hpp:24
Thyra::TpetraVectorSpace::this_t
TpetraVectorSpace< Scalar, LocalOrdinal, GlobalOrdinal, Node > this_t
Definition
Thyra_TpetraVectorSpace_decl.hpp:32
Thyra::TpetraVectorSpace::createLocallyReplicatedVectorSpace
RCP< TpetraVectorSpace< Scalar, LocalOrdinal, GlobalOrdinal, Node > > createLocallyReplicatedVectorSpace(int size) const
Create Tpetra locally replicated vector space.
Definition
Thyra_TpetraVectorSpace_def.hpp:53
Thyra::TpetraVectorSpace::getTpetraMap
RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getTpetraMap() const
Get the embedded Tpetra::Map.
Definition
Thyra_TpetraVectorSpace_def.hpp:252
Thyra::TpetraVectorSpace::tpetraVectorSpace
RCP< TpetraVectorSpace< Scalar, LocalOrdinal, GlobalOrdinal, Node > > tpetraVectorSpace(const RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > &tpetraMap)
Nonmember constructor that creats a serial vector space.
Definition
Thyra_TpetraVectorSpace_decl.hpp:141
Thyra::TpetraVectorSpace::hasInCoreView
bool hasInCoreView(const Range1D &rng, const EViewType viewType, const EStrideType strideType) const
Returns true if all the elements in rng are in this process.
Definition
Thyra_TpetraVectorSpace_def.hpp:229
Thyra::TpetraVectorSpace::localSubDim
Ordinal localSubDim() const
Definition
Thyra_TpetraVectorSpace_def.hpp:269
Thyra::TpetraVectorSpace::initialize
void initialize(const RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > &tpetraMap)
Initialize a serial space.
Definition
Thyra_TpetraVectorSpace_def.hpp:35
Thyra::TpetraVectorSpace::clone
RCP< const VectorSpaceBase< Scalar > > clone() const
Definition
Thyra_TpetraVectorSpace_def.hpp:245
Thyra::TpetraVectorSpace::createMember
RCP< VectorBase< Scalar > > createMember() const
Definition
Thyra_TpetraVectorSpace_def.hpp:66
Thyra::TpetraVectorSpace::createCachedMembersView
RCP< MultiVectorBase< Scalar > > createCachedMembersView(const RTOpPack::SubMultiVectorView< Scalar > &raw_mv, bool initialize=true) const
Create a (possibly) cached multi-vector member that is a non-const view of raw multi-vector data....
Definition
Thyra_TpetraVectorSpace_def.hpp:124
Thyra::TpetraVectorSpace::createMembers
RCP< MultiVectorBase< Scalar > > createMembers(int numMembers) const
Definition
Thyra_TpetraVectorSpace_def.hpp:79
Thyra::TpetraVectorSpace::getComm
RCP< const Teuchos::Comm< Ordinal > > getComm() const
Definition
Thyra_TpetraVectorSpace_def.hpp:262
Thyra::TpetraVectorSpace::create
static RCP< TpetraVectorSpace< Scalar, LocalOrdinal, GlobalOrdinal, Node > > create()
Create with weak ownership to self.
Definition
Thyra_TpetraVectorSpace_def.hpp:26
Thyra::EStrideType
EStrideType
Determine if data is unit stride or non-unit stride.
Definition
Thyra_OperatorVectorTypes.hpp:287
Thyra::EViewType
EViewType
Determines if a view is a direct view of data or a detached copy of data.
Definition
Thyra_OperatorVectorTypes.hpp:277
Thyra::Range1D
Teuchos::Range1D Range1D
Definition
Thyra_OperatorVectorTypes.hpp:65
Generated by
1.17.0