44 #include "Epetra_Map.h"
78 BaseMap_( Source.BaseMap_ ),
79 Offset_( Source.Offset_ )
91 long long IndexOffset = GlobalBlockRow *
Offset_;
97 localIndex = this->Map().LID((IndexOffset +
BaseMap_.GID64(i)));
99 std::cout <<
"Error in BlockMultiVector::GetBlock: " << i <<
" "
100 << IndexOffset <<
" " <<
BaseMap_.GID64(i) << std::endl;
103 for (
int j=0; j<NumVectors(); j++)
104 BaseVector[j][i] = (*
this)[j][localIndex];
113 long long IndexOffset = GlobalBlockRow *
Offset_;
119 localIndex = this->Map().LID((IndexOffset +
BaseMap_.GID64(i)));
120 if (localIndex==-1) {
121 std::cout <<
"Error in BlockMultiVector::GetBlock: " << i <<
" "
122 << IndexOffset <<
" " <<
BaseMap_.GID64(i) << std::endl;
125 for (
int j=0; j<NumVectors(); j++)
126 (*
this)[j][localIndex] = BaseVector[j][i];
133 Teuchos::RCP<const Epetra_MultiVector>
137 int numVecs = NumVectors();
138 double **pointers = Pointers();
139 double **block_pointers =
new double*[numVecs];
140 for (
int i=0; i<numVecs; i++)
141 block_pointers[i] = pointers[i]+offset;
142 Teuchos::RCP<Epetra_MultiVector> block =
145 delete [] block_pointers;
150 Teuchos::RCP<Epetra_MultiVector>
154 int numVecs = NumVectors();
155 double **pointers = Pointers();
156 double **block_pointers =
new double*[numVecs];
157 for (
int i=0; i<numVecs; i++)
158 block_pointers[i] = pointers[i]+offset;
159 Teuchos::RCP<Epetra_MultiVector> block =
162 delete [] block_pointers;
int ExtractBlockValues(Epetra_MultiVector &BaseVec, long long BlockRow) const
Extract a single block from a Block Vector: block row is global, not a stencil value.
virtual ~BlockMultiVector()
Destructor.
const Epetra_BlockMap & GetBaseMap() const
Return base map.
int NumMyElements() const
BlockMultiVector(const Epetra_BlockMap &BaseMap, const Epetra_BlockMap &GlobalMap, int NumVectors)
BlockMultiVector constuctor with one block row per processor.
int LoadBlockValues(const Epetra_MultiVector &BaseVec, long long BlockRow)
Load a single block into a Block Vector: block row is global, not a stencil value.
Teuchos::RCP< const Epetra_MultiVector > GetBlock(long long BlockRow) const
Return Epetra_MultiVector for given block row.