12 #include "../general/array.hpp"
40 numBlocks(bOffsets.Size()-1),
41 blockOffsets(bOffsets.GetData())
50 numBlocks(v.numBlocks),
51 blockOffsets(v.blockOffsets)
59 Vector(data, bOffsets.Last()),
60 numBlocks(bOffsets.Size()-1),
61 blockOffsets(bOffsets.GetData())
88 for (
int i = 0;
true; i++)
114 mfem_error(
"Number of Blocks don't match in BlockVector::operator=");
120 mfem_error(
"Size of Blocks don't match in BlockVector::operator=");
~BlockVector()
Destructor.
int Size() const
Logical size of the array.
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.
void SetSize(int s)
Resize the vector to size s.
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.
double * GetData() const
Return a pointer to the beginning of the Vector data.
Vector & operator=(const double *v)
Copy Size() entries from v.
void mfem_error(const char *msg)
Function called when an error is encountered. Used by the macros MFEM_ABORT, MFEM_ASSERT, MFEM_VERIFY.
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 Destroy()
Destroy a vector.
T & Last()
Return the last element in the array.
Vector * blocks
array of Vector objects used to extract blocks without allocating memory.