12 #include "../general/array.hpp"
31 numBlocks(bOffsets.Size()-1),
32 blockOffsets(bOffsets.GetData()),
45 numBlocks(v.numBlocks),
46 blockOffsets(v.blockOffsets),
58 Vector(data, bOffsets.Last()),
59 numBlocks(bOffsets.Size()-1),
60 blockOffsets(bOffsets.GetData()),
77 for (
int i =
numBlocks; i < oldNumBlocks; ++i)
83 for (
int i = oldNumBlocks; i <
numBlocks; ++i)
86 blockOffsets[i+1]-blockOffsets[i]);
94 mfem_error(
"Number of Blocks don't match in BlockVector::operator=");
100 mfem_error(
"Size of Blocks don't match in BlockVector::operator=");
103 for (
int i = 0; i < original.
size; i++)
120 for (
int i = 0; i <
tmp_block.Size(); ++i)
~BlockVector()
Destructor.
int Size() const
Logical size of the array.
Vector()
Default constructor for Vector. Sets size = 0 and data = NULL.
void NewDataAndSize(double *d, int s)
Set the Vector data and size, deleting the old data, if owned.
void GetBlockView(int i, Vector &blockView)
Get the i-th vector in the block.
BlockVector()
empty constructor
const int * blockOffsets
Offset for each block start. (length numBlocks+1)
T * GetData()
Returns the data.
void Update(double *data, const Array< int > &bOffsets)
Update method.
Vector & operator=(const double *v)
Array< Vector * > tmp_block
array of Vector objects used to extract blocks without allocating memory.
int numBlocks
Number of blocks in the blockVector.
BlockVector & operator=(const BlockVector &original)
Assignment operator. this and original must have the same block structure.
void mfem_error(const char *msg)
T & Last()
Return the last element in the array.
Vector & GetBlock(int i)
Get the i-th vector in the block.