Commit 3ac92339 authored by henry's avatar henry
Browse files

Changed the SquareMatrix construction from initial size and value and corrected usages of it.

parent 071b8ffe
......@@ -101,7 +101,7 @@ Foam::LUscalarMatrix::LUscalarMatrix
nCells += lduMatrices[i].size();
}
scalarSquareMatrix m(nCells, 0.0);
scalarSquareMatrix m(nCells, nCells, 0.0);
transfer(m);
convert(lduMatrices);
}
......@@ -109,7 +109,7 @@ Foam::LUscalarMatrix::LUscalarMatrix
else
{
label nCells = ldum.lduAddr().size();
scalarSquareMatrix m(nCells, 0.0);
scalarSquareMatrix m(nCells, nCells, 0.0);
transfer(m);
convert(ldum, interfaceCoeffs, interfaces);
}
......
......@@ -69,9 +69,10 @@ public:
// It checks that m == n.
inline SquareMatrix(const label m, const label n);
//- Construct with given number of rows/columns
//- Construct with given number of rows and rows
// and value for all elements.
inline SquareMatrix(const label n, const Type&);
// It checks that m == n.
inline SquareMatrix(const label m, const label n, const Type&);
//- Construct from Istream.
inline SquareMatrix(Istream&);
......
......@@ -53,10 +53,24 @@ inline Foam::SquareMatrix<Type>::SquareMatrix(const label m, const label n)
}
template<class Type>
inline Foam::SquareMatrix<Type>::SquareMatrix(const label n, const Type& t)
inline Foam::SquareMatrix<Type>::SquareMatrix
(
const label m,
const label n,
const Type& t
)
:
Matrix<SquareMatrix<Type>, Type>(n, t)
{}
Matrix<SquareMatrix<Type>, Type>(m, n, t)
{
if (m != n)
{
FatalErrorIn
(
"SquareMatrix<Type>::SquareMatrix"
"(const label m, const label n, const Type&)"
) << "m != n for constructing a square matrix" << exit(FatalError);
}
}
template<class Type>
inline Foam::SquareMatrix<Type>::SquareMatrix(Istream& is)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment