Skip to content
Snippets Groups Projects
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
Branches
Tags
No related merge requests found
...@@ -101,7 +101,7 @@ Foam::LUscalarMatrix::LUscalarMatrix ...@@ -101,7 +101,7 @@ Foam::LUscalarMatrix::LUscalarMatrix
nCells += lduMatrices[i].size(); nCells += lduMatrices[i].size();
} }
scalarSquareMatrix m(nCells, 0.0); scalarSquareMatrix m(nCells, nCells, 0.0);
transfer(m); transfer(m);
convert(lduMatrices); convert(lduMatrices);
} }
...@@ -109,7 +109,7 @@ Foam::LUscalarMatrix::LUscalarMatrix ...@@ -109,7 +109,7 @@ Foam::LUscalarMatrix::LUscalarMatrix
else else
{ {
label nCells = ldum.lduAddr().size(); label nCells = ldum.lduAddr().size();
scalarSquareMatrix m(nCells, 0.0); scalarSquareMatrix m(nCells, nCells, 0.0);
transfer(m); transfer(m);
convert(ldum, interfaceCoeffs, interfaces); convert(ldum, interfaceCoeffs, interfaces);
} }
......
...@@ -69,9 +69,10 @@ public: ...@@ -69,9 +69,10 @@ public:
// It checks that m == n. // It checks that m == n.
inline SquareMatrix(const label m, const label 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. // 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. //- Construct from Istream.
inline SquareMatrix(Istream&); inline SquareMatrix(Istream&);
......
...@@ -53,10 +53,24 @@ inline Foam::SquareMatrix<Type>::SquareMatrix(const label m, const label n) ...@@ -53,10 +53,24 @@ inline Foam::SquareMatrix<Type>::SquareMatrix(const label m, const label n)
} }
template<class Type> 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> template<class Type>
inline Foam::SquareMatrix<Type>::SquareMatrix(Istream& is) inline Foam::SquareMatrix<Type>::SquareMatrix(Istream& is)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment