Xpetra
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
Xpetra_BlockedVector_decl.hpp
Go to the documentation of this file.
1
// @HEADER
2
//
3
// ***********************************************************************
4
//
5
// Xpetra: A linear algebra interface package
6
// Copyright 2012 Sandia Corporation
7
//
8
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9
// the U.S. Government retains certain rights in this software.
10
//
11
// Redistribution and use in source and binary forms, with or without
12
// modification, are permitted provided that the following conditions are
13
// met:
14
//
15
// 1. Redistributions of source code must retain the above copyright
16
// notice, this list of conditions and the following disclaimer.
17
//
18
// 2. Redistributions in binary form must reproduce the above copyright
19
// notice, this list of conditions and the following disclaimer in the
20
// documentation and/or other materials provided with the distribution.
21
//
22
// 3. Neither the name of the Corporation nor the names of the
23
// contributors may be used to endorse or promote products derived from
24
// this software without specific prior written permission.
25
//
26
// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37
//
38
// Questions? Contact
39
// Jonathan Hu (jhu@sandia.gov)
40
// Andrey Prokopenko (aprokop@sandia.gov)
41
// Tobias Wiesner (tawiesn@sandia.gov)
42
// Ray Tuminaro (rstumin@sandia.gov)
43
//
44
// ***********************************************************************
45
//
46
// @HEADER
47
#ifndef XPETRA_BLOCKEDVECTOR_DECL_HPP
48
#define XPETRA_BLOCKEDVECTOR_DECL_HPP
49
50
/* this file is automatically generated - do not edit (see script/interfaces.py) */
51
52
#include "
Xpetra_ConfigDefs.hpp
"
53
54
#include "
Xpetra_BlockedMap_decl.hpp
"
55
#include "
Xpetra_BlockedMultiVector_decl.hpp
"
56
#include "
Xpetra_Map_decl.hpp
"
57
#include "
Xpetra_Vector.hpp
"
58
59
60
61
namespace
Xpetra
{
62
63
64
65
template
<
class
Scalar,
66
class
LocalOrdinal,
67
class
GlobalOrdinal,
68
class
Node = Tpetra::KokkosClassic::DefaultNode::DefaultNodeType>
69
class
BlockedVector
70
:
public
virtual
Xpetra::Vector
<Scalar, LocalOrdinal, GlobalOrdinal, Node>
71
,
public
virtual
Xpetra::BlockedMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>
72
{
73
public
:
74
using
scalar_type
= Scalar;
75
using
local_ordinal_type
= LocalOrdinal;
76
using
global_ordinal_type
= GlobalOrdinal;
77
using
node_type
= Node;
78
79
using
Xpetra::Vector
<Scalar, LocalOrdinal, GlobalOrdinal, Node>
::dot
;
// overloading, not hiding
80
using
Xpetra::Vector
<Scalar, LocalOrdinal, GlobalOrdinal, Node>
::norm1
;
// overloading, not hiding
81
using
Xpetra::Vector
<Scalar, LocalOrdinal, GlobalOrdinal, Node>
::norm2
;
// overloading, not hiding
82
using
Xpetra::Vector
<Scalar, LocalOrdinal, GlobalOrdinal, Node>
::normInf
;
// overloading, not hiding
83
using
Xpetra::Vector
<Scalar, LocalOrdinal, GlobalOrdinal, Node>
::meanValue
;
// overloading, not hiding
84
using
Xpetra::Vector
<Scalar, LocalOrdinal, GlobalOrdinal, Node>
::replaceGlobalValue
;
// overloading, not hiding
85
using
Xpetra::Vector
<Scalar, LocalOrdinal, GlobalOrdinal, Node>
::sumIntoGlobalValue
;
// overloading, not hiding
86
using
Xpetra::Vector
<Scalar, LocalOrdinal, GlobalOrdinal, Node>
::replaceLocalValue
;
// overloading, not hiding
87
using
Xpetra::Vector
<Scalar, LocalOrdinal, GlobalOrdinal, Node>
::sumIntoLocalValue
;
// overloading, not hiding
88
89
90
private
:
91
#undef XPETRA_BLOCKEDVECTOR_SHORT
92
#include "
Xpetra_UseShortNames.hpp
"
93
94
public
:
95
//! @name Constructor/Destructor Methods
96
97
99
100
102
108
BlockedVector(
const
Teuchos::RCP<const BlockedMap>
& map,
bool
zeroOut =
true
);
109
110
122
BlockedVector(
Teuchos::RCP
<
const
Xpetra::BlockedMap<LocalOrdinal, GlobalOrdinal, Node>
> bmap,
123
Teuchos::RCP
<
Xpetra::Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node>
> v);
124
125
137
BlockedVector(
Teuchos::RCP
<
const
Xpetra::MapExtractor<Scalar, LocalOrdinal, GlobalOrdinal, Node>> mapExtractor,
138
Teuchos::RCP
<
Xpetra::Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node>
> v);
139
140
142
virtual
~BlockedVector
();
143
144
152
BlockedVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>
&
153
operator=
(
const
Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>
& rhs);
154
155
157
159
160
162
virtual
void
replaceGlobalValue
(GlobalOrdinal globalRow,
size_t
vectorIndex,
const
Scalar& value);
163
165
virtual
void
sumIntoGlobalValue
(GlobalOrdinal globalRow,
size_t
vectorIndex,
const
Scalar& value);
166
168
virtual
void
replaceLocalValue
(LocalOrdinal myRow,
size_t
vectorIndex,
const
Scalar& value);
169
171
virtual
void
sumIntoLocalValue
(LocalOrdinal myRow,
size_t
vectorIndex,
const
Scalar& value);
172
174
virtual
void
replaceGlobalValue
(GlobalOrdinal globalRow,
const
Scalar& value);
175
177
virtual
void
sumIntoGlobalValue(GlobalOrdinal globalRow,
const
Scalar& value);
178
180
virtual
void
replaceLocalValue(LocalOrdinal myRow,
const
Scalar& value);
181
182
183
virtual
void
sumIntoLocalValue(LocalOrdinal myRow,
const
Scalar& value);
184
185
187
virtual
void
putScalar
(
const
Scalar& value);
188
189
190
//@}
191
192
194
195
196
198
virtual
Teuchos::RCP<const Xpetra::Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node>
>
199
getVector(
size_t
j)
const
;
200
202
virtual
Teuchos::RCP<Xpetra::Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node>
>
203
getVectorNonConst(
size_t
j);
204
206
virtual
Teuchos::ArrayRCP<const Scalar>
getData(
size_t
j)
const
;
207
209
virtual
Teuchos::ArrayRCP<Scalar>
getDataNonConst(
size_t
j);
210
212
213
//! @name Mathematical methods
214
215
217
virtual
void
dot(
const
Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>
& A,
218
const
Teuchos::ArrayView<Scalar>
& dots)
const
;
219
220
virtual
Scalar dot(
const
Xpetra::Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node>
& A)
const
;
221
222
224
virtual
void
abs(
const
Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>
& A);
225
227
virtual
void
reciprocal(
const
Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>
& A);
228
230
virtual
void
scale(
const
Scalar& alpha);
231
233
virtual
void
scale(
Teuchos::ArrayView<const Scalar>
alpha);
234
235
virtual
void
update(
const
Scalar& alpha,
236
const
Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>
& A,
237
const
Scalar& beta);
238
239
241
virtual
void
update(
const
Scalar& alpha,
242
const
Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>
& A,
243
const
Scalar& beta,
244
const
Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>
& B,
245
const
Scalar& gamma);
246
248
virtual
typename
Teuchos::ScalarTraits<Scalar>::magnitudeType
norm1()
const
;
249
251
virtual
typename
Teuchos::ScalarTraits<Scalar>::magnitudeType
norm2()
const
;
252
253
254
virtual
typename
Teuchos::ScalarTraits<Scalar>::magnitudeType
normInf()
const
;
255
257
virtual
void
norm1(
const
Teuchos::ArrayView
<
typename
Teuchos::ScalarTraits<Scalar>::magnitudeType
>& norms)
const
;
258
260
virtual
void
norm2(
const
Teuchos::ArrayView
<
typename
Teuchos::ScalarTraits<Scalar>::magnitudeType
>& norms)
const
;
261
262
263
virtual
void
normInf(
const
Teuchos::ArrayView
<
typename
Teuchos::ScalarTraits<Scalar>::magnitudeType
>& norms)
const
;
264
267
virtual
void
meanValue(
const
Teuchos::ArrayView<Scalar>
&
/* means */
)
const
;
268
269
virtual
Scalar meanValue()
const
;
270
272
virtual
void
multiply(
Teuchos::ETransp
/* transA */
,
273
Teuchos::ETransp
/* transB */
,
274
const
Scalar&
/* alpha */
,
275
const
Xpetra::Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node>
&
/* A */
,
276
const
Xpetra::Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node>
&
/* B */
,
277
const
Scalar&
/* beta */
);
278
279
virtual
void
multiply(
Teuchos::ETransp
/* transA */
,
280
Teuchos::ETransp
/* transB */
,
281
const
Scalar&
/* alpha */
,
282
const
Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>
&
/* A */
,
283
const
Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>
&
/* B */
,
284
const
Scalar&
/* beta */
);
285
286
287
virtual
void
elementWiseMultiply(Scalar
/* scalarAB */
,
288
const
Xpetra::Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node>
&
/* A */
,
289
const
Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>
&
/* B */
,
290
Scalar
/* scalarThis */
);
291
293
virtual
void
elementWiseMultiply(Scalar
/* scalarAB */
,
294
const
Xpetra::Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node>
& A,
295
const
Xpetra::Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node>
& B,
296
Scalar
/* scalarThis */
);
297
298
300
301
303
304
305
307
virtual
size_t
getNumVectors()
const
;
308
310
virtual
size_t
getLocalLength()
const
;
311
313
virtual
global_size_t
getGlobalLength()
const
;
314
316
virtual
bool
isSameSize(
const
Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>
&
/* vec */
)
const
;
317
319
321
322
324
virtual
std::string description()
const
;
325
327
virtual
void
describe(
Teuchos::FancyOStream
& out,
328
const
Teuchos::EVerbosityLevel
verbLevel =
Teuchos::Describable::verbLevel_default
)
const
;
329
330
virtual
void
replaceMap(
const
RCP<const Map>
& map);
331
333
virtual
void
doImport(
const
DistObject<Scalar, LocalOrdinal, GlobalOrdinal, Node>
&
/* source */
,
334
const
Import
&
/* importer */
,
335
CombineMode
/* CM */
);
336
338
virtual
void
doExport(
const
DistObject<Scalar, LocalOrdinal, GlobalOrdinal, Node>
&
/* dest */
,
339
const
Import
&
/* importer */
,
340
CombineMode
/* CM */
);
341
343
virtual
void
doImport(
const
DistObject<Scalar, LocalOrdinal, GlobalOrdinal, Node>
&
/* source */
,
344
const
Export
&
/* exporter */
,
345
CombineMode
/* CM */
);
346
348
virtual
void
doExport(
const
DistObject<Scalar, LocalOrdinal, GlobalOrdinal, Node>
&
/* dest */
,
349
const
Export
&
/* exporter */
,
350
CombineMode
/* CM */
);
351
352
354
355
357
358
359
361
virtual
void
setSeed(
unsigned
int
seed);
362
363
364
virtual
void
randomize(
bool
bUseXpetraImplementation =
false
);
365
366
virtual
void
randomize(
const
Scalar& minVal,
const
Scalar& maxVal,
bool
bUseXpetraImplementation =
false
);
367
369
virtual
void
Xpetra_randomize();
370
372
virtual
void
Xpetra_randomize(
const
Scalar& minVal,
const
Scalar& maxVal);
373
375
376
378
Teuchos::RCP<const Map>
getMap()
const
;
379
381
Teuchos::RCP< Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>
>
382
getMultiVector(
size_t
r)
const
;
383
385
Teuchos::RCP< Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>
>
386
getMultiVector(
size_t
r,
bool
bThyraMode)
const
;
387
389
void
390
setMultiVector(
size_t
r,
391
Teuchos::RCP
<
const
Xpetra::Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node>
> v,
392
bool
bThyraMode);
393
395
Teuchos::RCP< Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>
>
396
Merge()
const
;
397
398
399
protected
:
406
virtual
void
assign(
const
Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>
& rhs);
407
408
// virtual void assign (const MultiVector& rhs);
409
410
//private:
411
// Teuchos::RCP<const BlockedMap> map_; ///< blocked map containing the sub block maps (either thyra or xpetra mode)
412
// std::vector<Teuchos::RCP<Vector> > vv_; ///< array containing RCPs of the partial vectors
413
414
415
};
// BlockedVector class
416
417
418
419
}
// namespace Xpetra
420
421
#define XPETRA_BLOCKEDVECTOR_SHORT
422
#endif
// XPETRA_BLOCKEDVECTOR_DECL_HPP
423
Xpetra_BlockedMap_decl.hpp
Xpetra_BlockedMultiVector_decl.hpp
Xpetra_ConfigDefs.hpp
Xpetra_Map_decl.hpp
Xpetra_UseShortNames.hpp
Xpetra_Vector.hpp
Teuchos::ArrayRCP
Teuchos::ArrayView
Teuchos::Describable::verbLevel_default
static const EVerbosityLevel verbLevel_default
Teuchos::RCP
Xpetra::BlockedMap
Definition
Xpetra_BlockedMap_decl.hpp:65
Xpetra::BlockedVector::operator=
BlockedVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > & operator=(const Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &rhs)
Assignment operator: Does a deep copy.
Definition
Xpetra_BlockedVector_def.hpp:93
Xpetra::BlockedVector::dot
virtual void dot(const Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const Teuchos::ArrayView< Scalar > &dots) const
Compute dot product of each corresponding pair of vectors, dots[i] = this[i].dot(A[i]).
Definition
Xpetra_BlockedVector_def.hpp:212
Xpetra::BlockedVector::norm2
virtual Teuchos::ScalarTraits< Scalar >::magnitudeType norm2() const
Compute 2-norm of vector.
Definition
Xpetra_BlockedVector_def.hpp:302
Xpetra::BlockedVector::global_ordinal_type
GlobalOrdinal global_ordinal_type
Definition
Xpetra_BlockedVector_decl.hpp:76
Xpetra::BlockedVector::sumIntoLocalValue
virtual void sumIntoLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using local (row) index.
Definition
Xpetra_BlockedVector_def.hpp:130
Xpetra::BlockedVector::node_type
Node node_type
Definition
Xpetra_BlockedVector_decl.hpp:77
Xpetra::BlockedVector::putScalar
virtual void putScalar(const Scalar &value)
Set all values in the vector with the given value.
Definition
Xpetra_BlockedVector_def.hpp:172
Xpetra::BlockedVector::BlockedVector
BlockedVector(const Teuchos::RCP< const BlockedMap > &map, bool zeroOut=true)
Constructor.
Definition
Xpetra_BlockedVector_def.hpp:63
Xpetra::BlockedVector::norm1
virtual Teuchos::ScalarTraits< Scalar >::magnitudeType norm1() const
Compute 1-norm of vector.
Definition
Xpetra_BlockedVector_def.hpp:291
Xpetra::BlockedVector::replaceLocalValue
virtual void replaceLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Replace value, using local (row) index.
Definition
Xpetra_BlockedVector_def.hpp:121
Xpetra::BlockedVector::sumIntoGlobalValue
virtual void sumIntoGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using global (row) index.
Definition
Xpetra_BlockedVector_def.hpp:112
Xpetra::BlockedVector::local_ordinal_type
LocalOrdinal local_ordinal_type
Definition
Xpetra_BlockedVector_decl.hpp:75
Xpetra::BlockedVector::replaceGlobalValue
virtual void replaceGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Replace value, using global (row) index.
Definition
Xpetra_BlockedVector_def.hpp:103
Xpetra::BlockedVector::scalar_type
Scalar scalar_type
Definition
Xpetra_BlockedVector_decl.hpp:74
Xpetra::BlockedVector::meanValue
virtual void meanValue(const Teuchos::ArrayView< Scalar > &) const
Definition
Xpetra_BlockedVector_def.hpp:353
Xpetra::BlockedVector::normInf
virtual Teuchos::ScalarTraits< Scalar >::magnitudeType normInf() const
Compute Inf-norm in vector.
Definition
Xpetra_BlockedVector_def.hpp:314
Xpetra::DistObject
Definition
Xpetra_DistObject.hpp:66
Xpetra::Export
Definition
Xpetra_Export.hpp:64
Xpetra::Import
Definition
Xpetra_Import.hpp:64
Xpetra::MultiVector
Definition
Xpetra_MultiVector_decl.hpp:80
Xpetra::Vector
Definition
Xpetra_Vector.hpp:62
Teuchos::FancyOStream
basic_FancyOStream< char > FancyOStream
Teuchos::EVerbosityLevel
EVerbosityLevel
Teuchos::ETransp
ETransp
Xpetra
Xpetra namespace
Definition
Xpetra_BlockedCrsMatrix.hpp:89
Xpetra::global_size_t
size_t global_size_t
Global size_t object.
Definition
Xpetra_ConfigDefs.hpp:174
Xpetra::CombineMode
CombineMode
Xpetra::Combine Mode enumerable type.
Definition
Xpetra_ConfigDefs.hpp:212
Xpetra::BlockedVector::Xpetra::ScalarTraits::magnitudeType
T magnitudeType
src
BlockedVector
Xpetra_BlockedVector_decl.hpp
Generated by
1.17.0