33template<
class MatrixType>
39 <<
"Number of columns " << nCols_ <<
" != 1"
47 f[i] = operator()(i, 0);
54template<
class MatrixType>
60 <<
"Number of columns " << nCols_ <<
" != 1"
68 f[i] = operator()(i, 0);
75template<
class MatrixType>
82 <<
"Block addresses " << what
83 <<
" outside matrix or invalid matrix components"
89template<
class MatrixType>
96 <<
"Block addresses " << what
97 <<
" outside matrix or invalid matrix components"
109 if (i < 0 || i >= mRows_)
112 <<
"Index " << i <<
" is out of range 0 ... " << mRows_ - 1
115 else if (j < 0 || j >= nCols_)
118 <<
"Index " << j <<
" is out of range 0 ... " << nCols_ - 1
130 if (i < 0 || i >= mRows_)
133 <<
"Index " << i <<
" is out of range 0 ... " << mRows_ - 1
136 else if (j < 0 || j >= nCols_)
139 <<
"Index " << j <<
" is out of range 0 ... " << nCols_ - 1
147template<
class MatrixType>
154 if (mRows_ != Mb.m() || nCols_ != Mb.n())
157 <<
"Attempt to assign blocks of different sizes: "
158 << mRows_ <<
"x" << nCols_ <<
" != "
159 << Mb.m() <<
"x" << Mb.n()
163 for (label i = 0; i < mRows_; ++i)
165 for (label j = 0; j < nCols_; ++j)
167 (*this)(i, j) = Mb(i, j);
173template<
class MatrixType>
181 if (mRows_ != Mb.m() || nCols_ != Mb.n())
184 <<
"Attempt to assign blocks of different sizes: "
185 << mRows_ <<
"x" << nCols_ <<
" != "
186 << Mb.m() <<
"x" << Mb.n()
190 for (label i = 0; i < mRows_; ++i)
192 for (label j = 0; j < nCols_; ++j)
194 (*this)(i, j) = Mb(i, j);
201template<
class MatrixType>
209 if (mRows_ != Mb.m() || nCols_ != Mb.n())
212 <<
"Attempt to assign blocks of different sizes: "
213 << mRows_ <<
"x" << nCols_ <<
" != "
214 << Mb.m() <<
"x" << Mb.n()
218 for (label i = 0; i < mRows_; ++i)
220 for (label j = 0; j < nCols_; ++j)
222 (*this)(i, j) = Mb(i, j);
229template<
class MatrixType>
230template<
class MatrixType2>
238 if (mRows_ != Mb.m() || nCols_ != Mb.n())
241 <<
"Attempt to assign blocks of different sizes: "
242 << mRows_ <<
"x" << nCols_ <<
" != "
243 << Mb.m() <<
"x" << Mb.n()
247 for (label i = 0; i < mRows_; ++i)
249 for (label j = 0; j < nCols_; ++j)
251 (*this)(i, j) = Mb(i, j);
258template<
class MatrixType>
259template<
class MatrixType2>
267 if (mRows_ != Mb.m() || nCols_ != Mb.n())
270 <<
"Attempt to assign blocks of different sizes: "
271 << mRows_ <<
"x" << nCols_ <<
" != "
272 << Mb.m() <<
"x" << Mb.n()
276 for (label i = 0; i < mRows_; ++i)
278 for (label j = 0; j < nCols_; ++j)
280 (*this)(i, j) = Mb(i, j);
287template<
class MatrixType>
290 template<
class, Foam::direction, Foam::direction>
class MSBlock,
297 const MSBlock<SubTensor, BRowStart, BColStart>& Mb
300 if (mRows_ != Mb.mRows || nCols_ != Mb.nCols)
303 <<
"Attempt to assign blocks of different sizes: "
304 << mRows_ <<
"x" << nCols_ <<
" != "
305 << Mb.mRows <<
"x" << Mb.nCols
313 operator()(i, j) = Mb(i, j);
319template<
class MatrixType>
322 template<
class, Foam::direction>
class VSBlock,
328 const VSBlock<SubVector, BStart>& Mb
331 if (mRows_ != Mb.nComponents || nCols_ != 1)
334 <<
"Attempt to assign blocks of different sizes: "
335 << mRows_ <<
"x" << nCols_ <<
" != "
336 << Mb.nComponents <<
"x" << 1
342 operator()(i, 0) = Mb[i];
347template<
class MatrixType>
348template<
class MSForm, Foam::direction Nrows, Foam::direction Ncols>
354 if (mRows_ != Nrows || nCols_ != Ncols)
357 <<
"Attempt to assign blocks of different sizes: "
358 << mRows_ <<
"x" << nCols_ <<
" != "
359 << Nrows <<
"x" << Ncols
363 for (label i = 0; i < mRows_; ++i)
365 for (label j = 0; j < nCols_; ++j)
367 (*this)(i, j) = ms(i, j);
373template<
class MatrixType>
374template<
class VSForm, Foam::direction Ncmpts>
380 if (mRows_ != Ncmpts || nCols_ != 1)
383 <<
"Attempt to assign blocks of different sizes: "
384 << mRows_ <<
"x" << nCols_ <<
" != "
385 << Ncmpts <<
"x" << 1
391 operator()(i, 0) = ms[i];
396template<
class MatrixType>
399 if (mRows_ !=
f.size() || nCols_ != 1)
402 <<
"Error: cannot assign blocks of different size (left is "
403 << mRows_ <<
"x" << nCols_ <<
" != "
404 <<
f.size() <<
"x" << 1
410 operator()(i, 0) =
f[i];
void checkIndex(const label i, const label j) const
Check if (i, j) is within range of row-column limits.
Generic templated field type.
A templated block of an (m x n) matrix of type <MatrixType>.
void checkIndex(const label i, const label j) const
Check if (i, j) is within range of row-column limits.
void operator=(const Matrix< Form, cmptType > &)
Assignment to a compatible matrix.
A templated (m x n) matrix of objects of <T>. The layout is (mRows x nCols) - row-major order:
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
errorManip< error > abort(error &err)
#define forAll(list, i)
Loop across all elements in list.