Tpetra parallel linear algebra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 
17 namespace Tpetra {
18 
44 template<class Scalar,
45  class LO,
46  class GO,
47  class Node>
48 class BlockVector : public BlockMultiVector<Scalar, LO, GO, Node> {
49 private:
51  typedef Teuchos::ScalarTraits<Scalar> STS;
52 
53 public:
55 
56 
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 
168  BlockVector (const map_type& meshMap,
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 
201  BlockVector (const vec_type& X_vec,
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
Node node_type
The Kokkos Node type; a legacy thing that will go away at some point.
BlockVector< Scalar, LO, GO, Node > & operator=(const BlockVector< Scalar, LO, GO, Node > &)=default
Copy assigment (shallow copy).
base_type::little_vec_type little_vec_type
&quot;Block view&quot; of all degrees of freedom at a mesh point.
Kokkos::View< const impl_scalar_type *, device_type > const_little_vec_type
&quot;Const block view&quot; of all degrees of freedom at a mesh point, for a single column of the MultiVector...
bool sumIntoGlobalValues(const GO globalRowIndex, const Scalar vals[])
Sum into all values at the given mesh point, using a global index.
base_type::node_type node_type
The Kokkos Node type.
LO local_ordinal_type
The type of local indices.
base_type::scalar_type scalar_type
The type of entries in the vector.
Kokkos::View< impl_scalar_type *, device_type > little_vec_type
&quot;Block view&quot; of all degrees of freedom at a mesh point, for a single column of the MultiVector...
bool sumIntoLocalValues(const LO localRowIndex, const Scalar vals[])
Sum into all values at the given mesh point, using a local index.
GO global_ordinal_type
The type of global indices.
base_type::impl_scalar_type impl_scalar_type
The implementation type of entries in the vector.
base_type::const_little_vec_type const_little_vec_type
&quot;Const block view&quot; of all degrees of freedom at a mesh point.
MultiVector for multiple degrees of freedom per mesh point.
vec_type getVectorView()
Get a Tpetra::Vector that views this BlockVector&#39;s data.
Tpetra::Vector< Scalar, LO, GO, Node > vec_type
The specialization of Tpetra::Vector that this class uses.
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.
Tpetra::MultiVector< Scalar, LO, GO, Node > mv_type
The specialization of Tpetra::MultiVector that this class uses.
Scalar scalar_type
The type of entries in the object.
bool replaceLocalValues(const LO localRowIndex, const Scalar vals[])
Replace all values at the given mesh point, using a local index.
A distributed dense vector.
base_type::local_ordinal_type local_ordinal_type
The type of local indices.
bool replaceGlobalValues(const GO globalRowIndex, const Scalar vals[])
Replace all values at the given mesh point, using a global index.
Forward declaration of Tpetra::BlockVector.
typename mv_type::impl_scalar_type impl_scalar_type
The implementation type of entries in the object.
BlockVector()
Default constructor.
Vector for multiple degrees of freedom per mesh point.
Tpetra::Map< LO, GO, Node > map_type
The specialization of Tpetra::Map that this class uses.
base_type::global_ordinal_type global_ordinal_type
The type of global indices.
Node::device_type device_type
The Kokkos Device type.