42 #ifndef TPETRA_EXPERIMENTAL_BLOCKVECTOR_DEF_HPP 43 #define TPETRA_EXPERIMENTAL_BLOCKVECTOR_DEF_HPP 45 #include "Tpetra_Experimental_BlockVector_decl.hpp" 48 namespace Experimental {
50 template<
class Scalar,
class LO,
class GO,
class Node>
56 template<
class Scalar,
class LO,
class GO,
class Node>
61 base_type (meshMap, pointMap, blockSize, 1)
64 template<
class Scalar,
class LO,
class GO,
class Node>
71 TEUCHOS_TEST_FOR_EXCEPTION(
73 "Tpetra::Experimental::BlockVector: Input MultiVector has " 77 template<
class Scalar,
class LO,
class GO,
class Node>
82 const size_t offset) :
83 base_type (X, newMeshMap, newPointMap, offset)
86 template<
class Scalar,
class LO,
class GO,
class Node>
90 const size_t offset) :
94 template<
class Scalar,
class LO,
class GO,
class Node>
98 template<
class Scalar,
class LO,
class GO,
class Node>
102 vPtr->setCopyOrView (Teuchos::View);
106 template<
class Scalar,
class LO,
class GO,
class Node>
110 return ((
const base_type*)
this)->replaceLocalValues (localRowIndex, 0, vals);
113 template<
class Scalar,
class LO,
class GO,
class Node>
117 return ((
const base_type*)
this)->replaceGlobalValues (globalRowIndex, 0, vals);
121 template<
class Scalar,
class LO,
class GO,
class Node>
125 return ((
const base_type*)
this)->sumIntoLocalValues (localRowIndex, 0, vals);
128 template<
class Scalar,
class LO,
class GO,
class Node>
132 return ((
const base_type*)
this)->sumIntoLocalValues (globalRowIndex, 0, vals);
135 template<
class Scalar,
class LO,
class GO,
class Node>
139 return ((
const base_type*)
this)->getLocalRowView (localRowIndex, 0, vals);
142 template<
class Scalar,
class LO,
class GO,
class Node>
146 return ((
const base_type*)
this)->getGlobalRowView (globalRowIndex, 0, vals);
160 template<
class Scalar,
class LO,
class GO,
class Node>
170 const size_t offset = localRowIndex * blockSize * strideX;
183 #define TPETRA_EXPERIMENTAL_BLOCKVECTOR_INSTANT(S,LO,GO,NODE) \ 184 template class Experimental::BlockVector< S, LO, GO, NODE >; 186 #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. ...
Namespace Tpetra contains the class and methods constituting the Tpetra library.
mv_type mv_
The Tpetra::MultiVector used to represent the data.
MultiVector for multiple degrees of freedom per mesh point.
Vector for multiple degrees of freedom per mesh point.
LO getBlockSize() const
Get the number of degrees of freedom per mesh point.
bool sumIntoGlobalValues(const GO globalRowIndex, const Scalar vals[]) const
Sum into all values at the given mesh point, using a global index.
impl_scalar_type * getRawPtr() const
Raw pointer to the MultiVector's data.
LittleVector< impl_scalar_type, LO > little_vec_type
"Block view" of all degrees of freedom at a mesh point.
Nonowning view of a set of degrees of freedom corresponding to a mesh point in a block vector or mult...
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.
bool isValidLocalMeshIndex(const LO meshLocalIndex) const
True if and only if meshLocalIndex is a valid local index in the mesh Map.
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.
size_t getNumVectors() const
Number of columns in the multivector.
Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > > getVectorNonConst(const size_t j)
Return a Vector which is a nonconst view of column j.
size_t getStrideX() const
Stride between consecutive local entries in the same column.
BlockVector()
Default constructor.
bool replaceLocalValues(const LO localRowIndex, const Scalar vals[]) const
Replace all values at the given mesh point, using a local index.