mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Changed the SquareMatrix construction from initial size and value and corrected usages of it.
This commit is contained in:
@ -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)
|
||||
|
||||
Reference in New Issue
Block a user