42 #ifndef TPETRA_EXPERIMENTAL_BLOCKVECTOR_DEF_HPP 43 #define TPETRA_EXPERIMENTAL_BLOCKVECTOR_DEF_HPP 46 namespace Experimental {
49 template<
class Scalar,
class LO,
class GO,
class Node>
55 template<
class Scalar,
class LO,
class GO,
class Node>
60 base_type (meshMap, pointMap, blockSize, 1)
63 template<
class Scalar,
class LO,
class GO,
class Node>
70 TEUCHOS_TEST_FOR_EXCEPTION(
72 "Tpetra::Experimental::BlockVector: Input MultiVector has " 76 template<
class Scalar,
class LO,
class GO,
class Node>
81 const size_t offset) :
82 base_type (X, newMeshMap, newPointMap, offset)
85 template<
class Scalar,
class LO,
class GO,
class Node>
89 const size_t offset) :
93 template<
class Scalar,
class LO,
class GO,
class Node>
97 template<
class Scalar,
class LO,
class GO,
class Node>
101 vPtr->setCopyOrView (Teuchos::View);
105 template<
class Scalar,
class LO,
class GO,
class Node>
109 return ((
const base_type*)
this)->replaceLocalValues (localRowIndex, 0, vals);
112 template<
class Scalar,
class LO,
class GO,
class Node>
116 return ((
const base_type*)
this)->replaceGlobalValues (globalRowIndex, 0, vals);
120 template<
class Scalar,
class LO,
class GO,
class Node>
124 return ((
const base_type*)
this)->sumIntoLocalValues (localRowIndex, 0, vals);
127 template<
class Scalar,
class LO,
class GO,
class Node>
131 return ((
const base_type*)
this)->sumIntoLocalValues (globalRowIndex, 0, vals);
134 template<
class Scalar,
class LO,
class GO,
class Node>
138 return ((
const base_type*)
this)->getLocalRowView (localRowIndex, 0, vals);
141 template<
class Scalar,
class LO,
class GO,
class Node>
145 return ((
const base_type*)
this)->getGlobalRowView (globalRowIndex, 0, vals);
159 template<
class Scalar,
class LO,
class GO,
class Node>
168 const size_t offset = localRowIndex * blockSize;
182 #define TPETRA_EXPERIMENTAL_BLOCKVECTOR_INSTANT(S,LO,GO,NODE) \ 183 namespace Experimental { \ 184 namespace Classes { \ 185 template class BlockVector< S, LO, GO, NODE >; \ 189 #endif // TPETRA_EXPERIMENTAL_BLOCKVECTOR_DEF_HPP Namespace Tpetra contains the class and methods constituting the Tpetra library.
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.
impl_scalar_type * getRawPtr() const
Raw pointer to the MultiVector's data.
A distributed dense vector.
One or more distributed dense vectors.
BlockVector()
Default constructor.
bool getGlobalRowView(const GO globalRowIndex, Scalar *&vals) const
Get a writeable view of the entries at the given mesh point, using a global index.
MultiVector for multiple degrees of freedom per mesh point.
Vector for multiple degrees of freedom per mesh point.
size_t getNumVectors() const
Number of columns in the multivector.
bool sumIntoLocalValues(const LO localRowIndex, const Scalar vals[]) const
Sum into all values at the given mesh point, using a local index.
LO getBlockSize() const
Get the number of 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. ...
bool replaceLocalValues(const LO localRowIndex, const Scalar vals[]) const
Replace all values at the given mesh point, using a local index.
bool sumIntoGlobalValues(const GO globalRowIndex, const Scalar vals[]) const
Sum into all values 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.
Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVectorNonConst(const size_t j)
Return a Vector which is a nonconst view of column j.
bool replaceGlobalValues(const GO globalRowIndex, const Scalar vals[]) const
Replace all values at the given mesh point, using a global index.
A parallel distribution of indices over processes.
vec_type getVectorView()
Get a Tpetra::Vector that views this BlockVector's data.
bool isValidLocalMeshIndex(const LO meshLocalIndex) const
True if and only if meshLocalIndex is a valid local index in the mesh Map.
mv_type mv_
The Tpetra::MultiVector used to represent the data.