MatrixSpace: Add support for block conversion into VectorSpace

This commit is contained in:
Henry Weller 2016-03-30 18:16:47 +01:00
parent f77e26c5b9
commit a6901dd007

View File

@ -388,7 +388,17 @@ Foam::MatrixSpace<Form, Cmpt, Mrows, Ncols>::
Block<SubTensor, BRowStart, BColStart>::
operator()() const
{
return *this;
SubTensor st;
for (direction i=0; i<SubTensor::mRows; ++i)
{
for (direction j=0; j<SubTensor::nCols; ++j)
{
st[i*SubTensor::nCols + j] = operator()(i, j);
}
}
return st;
}