Thyra
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
core
src
support
operator_vector
adapter_support
Thyra_DefaultClusteredSpmdProductVectorSpace_decl.hpp
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_DEFAULT_CLUSTERED_SPMD_PRODUCT_VECTOR_SPACE_DECL_HPP
43
#define THYRA_DEFAULT_CLUSTERED_SPMD_PRODUCT_VECTOR_SPACE_DECL_HPP
44
45
#include "Thyra_VectorSpaceBase_decl.hpp"
46
#include "Thyra_ProductVectorSpaceBase.hpp"
47
#include "Thyra_VectorSpaceDefaultBase.hpp"
48
#include "Teuchos_Comm.hpp"
49
50
51
namespace
Thyra {
52
53
84
template
<
class
Scalar>
85
class
DefaultClusteredSpmdProductVectorSpace
86
:
public
ProductVectorSpaceBase
<Scalar>
87
,
protected
VectorSpaceDefaultBase
<Scalar>
88
{
89
public
:
90
93
95
DefaultClusteredSpmdProductVectorSpace
();
96
98
DefaultClusteredSpmdProductVectorSpace
(
99
const
RCP
<
const
Teuchos::Comm<Ordinal>
> &
intraClusterComm
100
,
const
int
clusterRootRank
101
,
const
RCP
<
const
Teuchos::Comm<Ordinal>
> &
interClusterComm
102
,
const
int
numBlocks
103
,
const
RCP
<
const
VectorSpaceBase<Scalar>
> vecSpaces[]
104
);
105
126
void
initialize
(
127
const
RCP
<
const
Teuchos::Comm<Ordinal>
> &
intraClusterComm
128
,
const
int
clusterRootRank
129
,
const
RCP
<
const
Teuchos::Comm<Ordinal>
> &
interClusterComm
130
,
const
int
numBlocks
131
,
const
RCP
<
const
VectorSpaceBase<Scalar>
> vecSpaces[]
132
);
133
135
RCP<const Teuchos::Comm<Ordinal>
>
intraClusterComm
()
const
;
136
138
int
clusterRootRank
()
const
;
139
141
RCP<const Teuchos::Comm<Ordinal>
>
interClusterComm
()
const
;
142
146
int
clusterSubDim
()
const
;
147
151
int
clusterOffset
()
const
;
152
154
157
158
std::string
description
()
const
;
160
163
164
Ordinal
dim
()
const
;
166
bool
isCompatible
(
const
VectorSpaceBase<Scalar>
& vecSpc)
const
;
168
RCP< const VectorSpaceFactoryBase<Scalar>
>
smallVecSpcFcty
()
const
;
170
Scalar
scalarProd
(
const
VectorBase<Scalar>
& x,
const
VectorBase<Scalar>
& y )
const
;
172
void
scalarProdsImpl
(
173
const
MultiVectorBase<Scalar>
& X,
const
MultiVectorBase<Scalar>
& Y,
174
const
ArrayView<Scalar>
&
scalarProds
)
const
;
176
bool
isEuclidean
()
const
;
178
bool
hasInCoreView
(
179
const
Range1D
& rng,
const
EViewType
viewType,
const
EStrideType
strideType
180
)
const
;
182
RCP< const VectorSpaceBase<Scalar>
>
clone
()
const
;
184
187
189
int
numBlocks
()
const
;
191
RCP<const VectorSpaceBase<Scalar>
>
getBlock
(
const
int
k)
const
;
192
194
195
protected
:
196
199
201
RCP<VectorBase<Scalar>
>
createMember
()
const
;
203
RCP<MultiVectorBase<Scalar>
>
createMembers
(
int
numMembers)
const
;
204
206
207
private
:
208
209
// //////////////////////////////////////
210
// Private types
211
212
typedef
std::vector<RCP<const VectorSpaceBase<Scalar> > > vecSpaces_t;
213
214
// //////////////////////////////////////
215
// Private data members
216
217
RCP<const Teuchos::Comm<Ordinal>
> intraClusterComm_;
218
int
clusterRootRank_;
219
RCP<const Teuchos::Comm<Ordinal>
> interClusterComm_;
220
vecSpaces_t vecSpaces_;
// size == numBlocks
221
bool
isEuclidean_;
222
Ordinal globalDim_;
// The global dimension of all of the block vectors in
223
// all of the clusters.
224
Ordinal clusterSubDim_;
// The some of the dimensions of the block vector
225
// spaces in this cluster
226
Ordinal clusterOffset_;
// The offset of the first element in the first
227
// constituent vector in this cluster in the
228
// w.r.t. the global vector.
229
230
};
231
232
233
// ///////////////////////////
234
// Inline defintions
235
236
237
template
<
class
Scalar>
238
RCP<const Teuchos::Comm<Ordinal>
>
239
DefaultClusteredSpmdProductVectorSpace<Scalar>::intraClusterComm
()
const
240
{
241
return
intraClusterComm_;
242
}
243
244
245
template
<
class
Scalar>
246
int
DefaultClusteredSpmdProductVectorSpace<Scalar>::clusterRootRank
()
const
247
{
248
return
clusterRootRank_;
249
}
250
251
252
template
<
class
Scalar>
253
RCP<const Teuchos::Comm<Ordinal>
>
254
DefaultClusteredSpmdProductVectorSpace<Scalar>::interClusterComm
()
const
255
{
256
return
interClusterComm_;
257
}
258
259
260
template
<
class
Scalar>
261
int
DefaultClusteredSpmdProductVectorSpace<Scalar>::clusterSubDim
()
const
262
{
263
return
clusterSubDim_;
264
}
265
266
267
template
<
class
Scalar>
268
int
DefaultClusteredSpmdProductVectorSpace<Scalar>::clusterOffset
()
const
269
{
270
return
clusterOffset_;
271
}
272
273
274
}
// end namespace Thyra
275
276
277
#endif
// THYRA_DEFAULT_CLUSTERED_SPMD_PRODUCT_VECTOR_SPACE_DECL_HPP
Teuchos::ArrayView
Teuchos::Comm
Teuchos::RCP
Thyra::DefaultClusteredSpmdProductVectorSpace::description
std::string description() const
Definition
Thyra_DefaultClusteredSpmdProductVectorSpace_def.hpp:131
Thyra::DefaultClusteredSpmdProductVectorSpace::clusterOffset
int clusterOffset() const
Definition
Thyra_DefaultClusteredSpmdProductVectorSpace_decl.hpp:268
Thyra::DefaultClusteredSpmdProductVectorSpace::clone
RCP< const VectorSpaceBase< Scalar > > clone() const
Definition
Thyra_DefaultClusteredSpmdProductVectorSpace_def.hpp:231
Thyra::DefaultClusteredSpmdProductVectorSpace::clusterSubDim
int clusterSubDim() const
Definition
Thyra_DefaultClusteredSpmdProductVectorSpace_decl.hpp:261
Thyra::DefaultClusteredSpmdProductVectorSpace::scalarProdsImpl
void scalarProdsImpl(const MultiVectorBase< Scalar > &X, const MultiVectorBase< Scalar > &Y, const ArrayView< Scalar > &scalarProds) const
Definition
Thyra_DefaultClusteredSpmdProductVectorSpace_def.hpp:196
Thyra::DefaultClusteredSpmdProductVectorSpace::clusterRootRank
int clusterRootRank() const
Definition
Thyra_DefaultClusteredSpmdProductVectorSpace_decl.hpp:246
Thyra::DefaultClusteredSpmdProductVectorSpace::numBlocks
int numBlocks() const
Definition
Thyra_DefaultClusteredSpmdProductVectorSpace_def.hpp:239
Thyra::DefaultClusteredSpmdProductVectorSpace::intraClusterComm
RCP< const Teuchos::Comm< Ordinal > > intraClusterComm() const
Definition
Thyra_DefaultClusteredSpmdProductVectorSpace_decl.hpp:239
Thyra::DefaultClusteredSpmdProductVectorSpace::DefaultClusteredSpmdProductVectorSpace
DefaultClusteredSpmdProductVectorSpace()
Definition
Thyra_DefaultClusteredSpmdProductVectorSpace_def.hpp:60
Thyra::DefaultClusteredSpmdProductVectorSpace::interClusterComm
RCP< const Teuchos::Comm< Ordinal > > interClusterComm() const
Definition
Thyra_DefaultClusteredSpmdProductVectorSpace_decl.hpp:254
Thyra::DefaultClusteredSpmdProductVectorSpace::smallVecSpcFcty
RCP< const VectorSpaceFactoryBase< Scalar > > smallVecSpcFcty() const
Definition
Thyra_DefaultClusteredSpmdProductVectorSpace_def.hpp:178
Thyra::DefaultClusteredSpmdProductVectorSpace::isCompatible
bool isCompatible(const VectorSpaceBase< Scalar > &vecSpc) const
Definition
Thyra_DefaultClusteredSpmdProductVectorSpace_def.hpp:151
Thyra::DefaultClusteredSpmdProductVectorSpace::initialize
void initialize(const RCP< const Teuchos::Comm< Ordinal > > &intraClusterComm, const int clusterRootRank, const RCP< const Teuchos::Comm< Ordinal > > &interClusterComm, const int numBlocks, const RCP< const VectorSpaceBase< Scalar > > vecSpaces[])
Initalize.
Definition
Thyra_DefaultClusteredSpmdProductVectorSpace_def.hpp:80
Thyra::DefaultClusteredSpmdProductVectorSpace::scalarProd
Scalar scalarProd(const VectorBase< Scalar > &x, const VectorBase< Scalar > &y) const
Definition
Thyra_DefaultClusteredSpmdProductVectorSpace_def.hpp:186
Thyra::DefaultClusteredSpmdProductVectorSpace::getBlock
RCP< const VectorSpaceBase< Scalar > > getBlock(const int k) const
Definition
Thyra_DefaultClusteredSpmdProductVectorSpace_def.hpp:246
Thyra::DefaultClusteredSpmdProductVectorSpace::hasInCoreView
bool hasInCoreView(const Range1D &rng, const EViewType viewType, const EStrideType strideType) const
Definition
Thyra_DefaultClusteredSpmdProductVectorSpace_def.hpp:222
Thyra::DefaultClusteredSpmdProductVectorSpace::dim
Ordinal dim() const
Definition
Thyra_DefaultClusteredSpmdProductVectorSpace_def.hpp:145
Thyra::DefaultClusteredSpmdProductVectorSpace::createMembers
RCP< MultiVectorBase< Scalar > > createMembers(int numMembers) const
Definition
Thyra_DefaultClusteredSpmdProductVectorSpace_def.hpp:265
Thyra::DefaultClusteredSpmdProductVectorSpace::isEuclidean
bool isEuclidean() const
Definition
Thyra_DefaultClusteredSpmdProductVectorSpace_def.hpp:216
Thyra::DefaultClusteredSpmdProductVectorSpace::createMember
RCP< VectorBase< Scalar > > createMember() const
Definition
Thyra_DefaultClusteredSpmdProductVectorSpace_def.hpp:257
Thyra::MultiVectorBase
Interface for a collection of column vectors called a multi-vector.
Definition
Thyra_MultiVectorBase_decl.hpp:496
Thyra::ProductVectorSpaceBase
Definition
Thyra_ProductVectorSpaceBase.hpp:95
Thyra::VectorBase
Abstract interface for finite-dimensional dense vectors.
Definition
Thyra_VectorBase.hpp:147
Thyra::VectorSpaceBase
Abstract interface for objects that represent a space for vectors.
Definition
Thyra_VectorSpaceBase_decl.hpp:299
Thyra::VectorSpaceBase::scalarProds
void scalarProds(const MultiVectorBase< Scalar > &X, const MultiVectorBase< Scalar > &Y, const ArrayView< Scalar > &scalarProds_out) const
Return the scalar product of each column in two multi-vectors in the vector space.
Definition
Thyra_VectorSpaceBase_decl.hpp:387
Thyra::VectorSpaceDefaultBase
Node VectorSpaceBase subclass that provides default implementations for many functions using a defaul...
Definition
Thyra_VectorSpaceDefaultBase_decl.hpp:73
Thyra::EStrideType
EStrideType
Determine if data is unit stride or non-unit stride.
Definition
Thyra_OperatorVectorTypes.hpp:319
Thyra::EViewType
EViewType
Determines if a view is a direct view of data or a detached copy of data.
Definition
Thyra_OperatorVectorTypes.hpp:309
Thyra::Range1D
Teuchos::Range1D Range1D
Definition
Thyra_OperatorVectorTypes.hpp:97
Generated by
1.17.0