42 #ifndef TPETRA_EXPERIMENTAL_BLOCKVECTOR_DEF_HPP
43 #define TPETRA_EXPERIMENTAL_BLOCKVECTOR_DEF_HPP
46 namespace Experimental {
48 template<
class Scalar,
class LO,
class GO,
class Node>
54 template<
class Scalar,
class LO,
class GO,
class Node>
59 base_type (meshMap, pointMap, blockSize, 1)
62 template<
class Scalar,
class LO,
class GO,
class Node>
69 TEUCHOS_TEST_FOR_EXCEPTION(
71 "Tpetra::Experimental::BlockVector: Input MultiVector has "
75 template<
class Scalar,
class LO,
class GO,
class Node>
83 template<
class Scalar,
class LO,
class GO,
class Node>
88 const size_t offset) :
89 base_type (X, newMeshMap, newPointMap, offset)
92 template<
class Scalar,
class LO,
class GO,
class Node>
96 const size_t offset) :
100 template<
class Scalar,
class LO,
class GO,
class Node>
104 template<
class Scalar,
class LO,
class GO,
class Node>
108 vPtr->setCopyOrView (Teuchos::View);
112 template<
class Scalar,
class LO,
class GO,
class Node>
116 return ((
const base_type*)
this)->replaceLocalValues (localRowIndex, 0, vals);
119 template<
class Scalar,
class LO,
class GO,
class Node>
123 return ((
const base_type*)
this)->replaceGlobalValues (globalRowIndex, 0, vals);
127 template<
class Scalar,
class LO,
class GO,
class Node>
131 return ((
const base_type*)
this)->sumIntoLocalValues (localRowIndex, 0, vals);
134 template<
class Scalar,
class LO,
class GO,
class Node>
138 return ((
const base_type*)
this)->sumIntoLocalValues (globalRowIndex, 0, vals);
141 template<
class Scalar,
class LO,
class GO,
class Node>
145 return ((
const base_type*)
this)->getLocalRowView (localRowIndex, 0, vals);
148 template<
class Scalar,
class LO,
class GO,
class Node>
152 return ((
const base_type*)
this)->getGlobalRowView (globalRowIndex, 0, vals);
166 template<
class Scalar,
class LO,
class GO,
class Node>
171 if (! this->isValidLocalMeshIndex (localRowIndex)) {
174 const size_t blockSize = this->getBlockSize ();
175 const size_t offset = localRowIndex * blockSize;
188 #define TPETRA_EXPERIMENTAL_BLOCKVECTOR_INSTANT(S,LO,GO,NODE) \
189 namespace Experimental { \
190 template class BlockVector< S, LO, GO, NODE >; \
193 #endif // TPETRA_EXPERIMENTAL_BLOCKVECTOR_DEF_HPP
bool getLocalRowView(const LO localRowIndex, Scalar *&vals) const
Get a writeable view of the entries at the given mesh point, using a local index. ...
size_t getNumVectors() const
Number of columns in the multivector.
MultiVector for multiple degrees of freedom per mesh point.
Vector for multiple degrees of freedom per mesh point.
Kokkos::View< impl_scalar_type *, Kokkos::LayoutRight, device_type, Kokkos::MemoryTraits< Kokkos::Unmanaged > > little_vec_type
"Block view" of all degrees of freedom at a mesh point, for a single column of the MultiVector...
Kokkos::View< impl_scalar_type *, Kokkos::LayoutRight, device_type, Kokkos::MemoryTraits< Kokkos::Unmanaged > > little_vec_type
"Block view" of all degrees of freedom at a mesh point.
bool sumIntoGlobalValues(const GO globalRowIndex, const Scalar vals[]) const
Sum into all values at the given mesh point, using a global index.
Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVectorNonConst(const size_t j)
Return a Vector which is a nonconst view of column j.
vec_type getVectorView()
Get a Tpetra::Vector that views this BlockVector's data.
bool getGlobalRowView(const GO globalRowIndex, Scalar *&vals) const
Get a writeable view of the entries at the given mesh point, using a global index.
little_vec_type getLocalBlock(const LO localRowIndex) const
Get a view of the degrees of freedom at the given mesh point, using a local index.
bool sumIntoLocalValues(const LO localRowIndex, const Scalar vals[]) const
Sum into all values at the given mesh point, using a local index.
A distributed dense vector.
bool replaceGlobalValues(const GO globalRowIndex, const Scalar vals[]) const
Replace all values at the given mesh point, using a global index.
BlockVector()
Default constructor.
bool replaceLocalValues(const LO localRowIndex, const Scalar vals[]) const
Replace all values at the given mesh point, using a local index.