44 #include "Epetra_Map.h"
45 #include "Epetra_Comm.h"
76 BaseMap_( Source.BaseMap_ ),
77 Offset_( Source.Offset_ )
89 long long IndexOffset = GlobalBlockRow *
Offset_;
95 localIndex = this->Map().LID((IndexOffset +
BaseMap_.GID64(i)));
97 std::cout <<
"Error in BlockVector::GetBlock: " << i <<
" "
98 << IndexOffset <<
" " <<
BaseMap_.GID64(i) << std::endl;
101 BaseVector[i] = Values_[localIndex];
110 long long IndexOffset = GlobalBlockRow *
Offset_;
116 localIndex = this->Map().LID((IndexOffset +
BaseMap_.GID64(i)));
117 if (localIndex==-1) {
118 std::cout <<
"Error in BlockVector::GetBlock: " << i <<
" "
119 << IndexOffset <<
" " <<
BaseMap_.GID64(i) << std::endl;
122 (*this)[localIndex] = BaseVector[i];
128 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
130 int* Indices,
int GlobalBlockRow)
132 long long IndexOffset = GlobalBlockRow *
Offset_;
137 for (
int i=0; i<NumIndices; i++) {
138 localIndex = this->Map().LID((IndexOffset + Indices[i]));
139 if (localIndex==-1) {
140 std::cout <<
"Error in BlockVector::BlockSumIntoGlobalValues: " << i
141 <<
" " << IndexOffset <<
" " << Indices[i] << std::endl;
144 (*this)[localIndex] += theValues[i];
151 int* Indices,
int GlobalBlockRow)
153 long long IndexOffset = GlobalBlockRow *
Offset_;
158 for (
int i=0; i<NumIndices; i++) {
159 localIndex = this->Map().LID((IndexOffset + Indices[i]));
160 if (localIndex==-1) {
161 std::cout <<
"Error in BlockVector::BlockReplaceGlobalValues: " << i
162 <<
" " << IndexOffset <<
" " << Indices[i] << std::endl;
165 (*this)[localIndex] = theValues[i];
172 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
174 long long* Indices,
long long GlobalBlockRow)
176 long long IndexOffset = GlobalBlockRow *
Offset_;
181 for (
int i=0; i<NumIndices; i++) {
182 localIndex = this->Map().LID((IndexOffset + Indices[i]));
183 if (localIndex==-1) {
184 std::cout <<
"Error in BlockVector::BlockSumIntoGlobalValues: " << i
185 <<
" " << IndexOffset <<
" " << Indices[i] << std::endl;
188 (*this)[localIndex] += theValues[i];
195 long long* Indices,
long long GlobalBlockRow)
197 long long IndexOffset = GlobalBlockRow *
Offset_;
202 for (
int i=0; i<NumIndices; i++) {
203 localIndex = this->Map().LID((IndexOffset + Indices[i]));
204 if (localIndex==-1) {
205 std::cout <<
"Error in BlockVector::BlockReplaceGlobalValues: " << i
206 <<
" " << IndexOffset <<
" " << Indices[i] << std::endl;
209 (*this)[localIndex] = theValues[i];
216 Teuchos::RCP<const Epetra_Vector>
224 Teuchos::RCP<Epetra_Vector>
int BlockSumIntoGlobalValues(int NumIndices, double *Values, int *Indices, int BlockRow)
Load entries into BlockVector with base vector indices offset by BlockRow.
int BlockReplaceGlobalValues(int NumIndices, double *Values, int *Indices, int BlockRow)
Load entries into BlockVector with base vector indices offset by BlockRow.
virtual ~BlockVector()
Destructor.
int NumMyElements() const
int ExtractBlockValues(Epetra_Vector &BaseVec, long long BlockRow) const
Extract a single block from a Block Vector: block row is global, not a stencil value.
Epetra_Vector(const Epetra_BlockMap &Map, bool zeroOut=true)
int LoadBlockValues(const Epetra_Vector &BaseVec, long long BlockRow)
Load a single block into a Block Vector: block row is global, not a stencil value.
BlockVector(const Epetra_BlockMap &BaseMap, const Epetra_BlockMap &GlobalMap)
BlockVector constuctor with one block row per processor.
Teuchos::RCP< const Epetra_Vector > GetBlock(long long BlockRow) const
Return Epetra_Vector for given block row.
const Epetra_BlockMap & GetBaseMap() const
Return base map.