42 #ifndef TPETRA_BLOCKVECTOR_DEF_HPP
43 #define TPETRA_BLOCKVECTOR_DEF_HPP
47 template<
class Scalar,
class LO,
class GO,
class Node>
53 template<
class Scalar,
class LO,
class GO,
class Node>
56 const Teuchos::DataAccess copyOrView) :
60 template<
class Scalar,
class LO,
class GO,
class Node>
66 template<
class Scalar,
class LO,
class GO,
class Node>
71 base_type (meshMap, pointMap, blockSize, 1)
74 template<
class Scalar,
class LO,
class GO,
class Node>
81 TEUCHOS_TEST_FOR_EXCEPTION(
83 "Tpetra::BlockVector: Input MultiVector has "
87 template<
class Scalar,
class LO,
class GO,
class Node>
95 template<
class Scalar,
class LO,
class GO,
class Node>
100 const size_t offset) :
101 base_type (X, newMeshMap, newPointMap, offset)
104 template<
class Scalar,
class LO,
class GO,
class Node>
108 const size_t offset) :
112 template<
class Scalar,
class LO,
class GO,
class Node>
119 template<
class Scalar,
class LO,
class GO,
class Node>
123 return ((
const base_type*)
this)->replaceLocalValues (localRowIndex, 0, vals);
126 template<
class Scalar,
class LO,
class GO,
class Node>
130 return ((
const base_type*)
this)->replaceGlobalValues (globalRowIndex, 0, vals);
133 template<
class Scalar,
class LO,
class GO,
class Node>
137 return ((
const base_type*)
this)->sumIntoLocalValues (localRowIndex, 0, vals);
140 template<
class Scalar,
class LO,
class GO,
class Node>
144 return ((
const base_type*)
this)->sumIntoLocalValues (globalRowIndex, 0, vals);
147 template<
class Scalar,
class LO,
class GO,
class Node>
151 return ((
const base_type*)
this)->getLocalRowView (localRowIndex, 0, vals);
154 template<
class Scalar,
class LO,
class GO,
class Node>
158 return ((
const base_type*)
this)->getGlobalRowView (globalRowIndex, 0, vals);
161 template<
class Scalar,
class LO,
class GO,
class Node>
166 if (! this->isValidLocalMeshIndex (localRowIndex)) {
170 const size_t blockSize = this->getBlockSize ();
171 const size_t offset = localRowIndex * blockSize;
183 #define TPETRA_BLOCKVECTOR_INSTANT(S,LO,GO,NODE) \
184 template class BlockVector< S, LO, GO, NODE >;
186 #endif // TPETRA_BLOCKVECTOR_DEF_HPP
bool replaceGlobalValues(const GO globalRowIndex, const Scalar vals[]) const
Replace all values at the given mesh point, using a global index.
size_t getNumVectors() const
Number of columns in the multivector.
MultiVector for multiple degrees of freedom per mesh point.
bool getLocalRowView(const LO localRowIndex, Scalar *&vals) const
Get a writeable view of the entries at the given mesh point, using a local 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.
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.
Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVectorNonConst(const size_t j)
Return a Vector which is a nonconst view of column j.
bool replaceLocalValues(const LO localRowIndex, const Scalar vals[]) const
Replace all values 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.
BlockVector()
Default constructor.
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...
bool sumIntoGlobalValues(const GO globalRowIndex, const Scalar vals[]) const
Sum into all values at the given mesh point, using a global index.
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.