diff --git a/src/OpenFOAM/matrices/LLTMatrix/LLTMatrix.C b/src/OpenFOAM/matrices/LLTMatrix/LLTMatrix.C index 021d733a0d..e160180240 100644 --- a/src/OpenFOAM/matrices/LLTMatrix/LLTMatrix.C +++ b/src/OpenFOAM/matrices/LLTMatrix/LLTMatrix.C @@ -25,12 +25,25 @@ License #include "LLTMatrix.H" -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template -void Foam::LLTMatrix::decompose() +Foam::LLTMatrix::LLTMatrix(const SquareMatrix& M) +{ + decompose(M); +} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +template +void Foam::LLTMatrix::decompose(const SquareMatrix& M) { SquareMatrix& LLT = *this; + + // Initialize the LLT decomposition matrix to M + LLT = M; + const label m = LLT.m(); for (label i=0; i::decompose() } -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template -Foam::LLTMatrix::LLTMatrix(const SquareMatrix& M) -: - SquareMatrix(M) -{ - decompose(); -} - - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - template void Foam::LLTMatrix::solve ( diff --git a/src/OpenFOAM/matrices/LLTMatrix/LLTMatrix.H b/src/OpenFOAM/matrices/LLTMatrix/LLTMatrix.H index 119ea726f6..9a48c38cd7 100644 --- a/src/OpenFOAM/matrices/LLTMatrix/LLTMatrix.H +++ b/src/OpenFOAM/matrices/LLTMatrix/LLTMatrix.H @@ -56,10 +56,6 @@ class LLTMatrix : public SquareMatrix { - // Private Member Functions - - //- Perform the Cholesky decomposition of the matrix - void decompose(); public: @@ -71,6 +67,9 @@ public: // Member Functions + //- Perform the Cholesky decomposition of the matrix + void decompose(const SquareMatrix& M); + //- Solve the linear system with the given source // and returning the solution in the Field argument x void solve(Field& x, const Field& source) const;