Tpetra parallel linear algebra Version of the Day
Loading...
Searching...
No Matches
Tpetra_BlockVector_decl.hpp
1// @HEADER
2// *****************************************************************************
3// Tpetra: Templated Linear Algebra Services Package
4//
5// Copyright 2008 NTESS and the Tpetra contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
10#ifndef TPETRA_BLOCKVECTOR_DECL_HPP
11#define TPETRA_BLOCKVECTOR_DECL_HPP
12
14#include "Tpetra_BlockMultiVector.hpp"
15#include "Tpetra_Vector.hpp"
16
17namespace Tpetra {
18
44template <class Scalar,
45 class LO,
46 class GO,
47 class Node>
48class BlockVector : public BlockMultiVector<Scalar, LO, GO, Node> {
49 private:
51 typedef Teuchos::ScalarTraits<Scalar> STS;
52
53 public:
55
56
58 typedef typename base_type::scalar_type scalar_type;
60 typedef typename base_type::impl_scalar_type impl_scalar_type;
62 typedef typename base_type::local_ordinal_type local_ordinal_type;
64 typedef typename base_type::global_ordinal_type global_ordinal_type;
66 typedef typename base_type::node_type node_type;
68 typedef typename Node::device_type device_type;
69
76
91 typedef typename base_type::little_vec_type
93 typedef typename base_type::little_host_vec_type
94 little_host_vec_type;
95
100 typedef typename base_type::const_little_vec_type
102 typedef typename base_type::const_little_host_vec_type
103 const_little_host_vec_type;
104
106
108
113 BlockVector();
114
117
120
124
128
131 const Teuchos::DataAccess copyOrView);
132
162 BlockVector(const map_type& meshMap, const LO blockSize);
163
169 const map_type& pointMap,
170 const LO blockSize);
171
185 BlockVector(const mv_type& X_mv,
186 const map_type& meshMap,
187 const LO blockSize);
188
202 const map_type& meshMap,
203 const LO blockSize);
204
210 const map_type& newMeshMap,
211 const map_type& newPointMap,
212 const size_t offset = 0);
213
219 const map_type& newMeshMap,
220 const size_t offset = 0);
221
223
225
231
233
235
251 bool replaceLocalValues(const LO localRowIndex, const Scalar vals[]);
252
262 bool replaceGlobalValues(const GO globalRowIndex, const Scalar vals[]);
263
273 bool sumIntoLocalValues(const LO localRowIndex, const Scalar vals[]);
274
284 bool sumIntoGlobalValues(const GO globalRowIndex, const Scalar vals[]);
285
295 const_little_host_vec_type getLocalBlockHost(const LO localRowIndex,
296 Access::ReadOnlyStruct) const;
297 little_host_vec_type getLocalBlockHost(const LO localRowIndex,
298 Access::OverwriteAllStruct);
299 little_host_vec_type getLocalBlockHost(const LO localRowIndex,
300 Access::ReadWriteStruct);
302};
303
304} // namespace Tpetra
305
306#endif // TPETRA_BLOCKMULTIVECTOR_DECL_HPP
Forward declaration of Tpetra::BlockVector.
MultiVector for multiple degrees of freedom per mesh point.
Vector for multiple degrees of freedom per mesh point.
const_little_host_vec_type getLocalBlockHost(const LO localRowIndex, Access::ReadOnlyStruct) const
Get a view of the degrees of freedom at the given mesh point, using a local index.
base_type::scalar_type scalar_type
The type of entries in the vector.
BlockVector< Scalar, LO, GO, Node > & operator=(BlockVector< Scalar, LO, GO, Node > &&)=default
Move assigment (shallow move).
BlockVector(const BlockVector< Scalar, LO, GO, Node > &)=default
Copy constructor (shallow copy).
base_type::little_vec_type little_vec_type
"Block view" of all degrees of freedom at a mesh point.
base_type::local_ordinal_type local_ordinal_type
The type of local indices.
Tpetra::MultiVector< Scalar, LO, GO, Node > mv_type
The specialization of Tpetra::MultiVector that this class uses.
Tpetra::Map< LO, GO, Node > map_type
The specialization of Tpetra::Map that this class uses.
base_type::node_type node_type
The Kokkos Node type.
bool sumIntoGlobalValues(const GO globalRowIndex, const Scalar vals[])
Sum into all values at the given mesh point, using a global index.
BlockVector< Scalar, LO, GO, Node > & operator=(const BlockVector< Scalar, LO, GO, Node > &)=default
Copy assigment (shallow copy).
Tpetra::Vector< Scalar, LO, GO, Node > vec_type
The specialization of Tpetra::Vector that this class uses.
bool replaceGlobalValues(const GO globalRowIndex, const Scalar vals[])
Replace all values at the given mesh point, using a global index.
base_type::const_little_vec_type const_little_vec_type
"Const block view" of all degrees of freedom at a mesh point.
BlockVector()
Default constructor.
bool sumIntoLocalValues(const LO localRowIndex, const Scalar vals[])
Sum into all values at the given mesh point, using a local index.
vec_type getVectorView()
Get a Tpetra::Vector that views this BlockVector's data.
base_type::impl_scalar_type impl_scalar_type
The implementation type of entries in the vector.
bool replaceLocalValues(const LO localRowIndex, const Scalar vals[])
Replace all values at the given mesh point, using a local index.
BlockVector(BlockVector< Scalar, LO, GO, Node > &&)=default
Move constructor (shallow move).
Node::device_type device_type
The Kokkos Device type.
base_type::global_ordinal_type global_ordinal_type
The type of global indices.
Struct that holds views of the contents of a CrsMatrix.
A distributed dense vector.
Namespace Tpetra contains the class and methods constituting the Tpetra library.