mirror of
https://github.com/OpenFOAM/OpenFOAM-6.git
synced 2025-12-08 06:57:46 +00:00
LLTMatrix, LUscalarMatrix, QRMatrix: Provided consistent construction, decomposition and solution interface
This commit is contained in:
@ -27,6 +27,11 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::LLTMatrix<Type>::LLTMatrix()
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::LLTMatrix<Type>::LLTMatrix(const SquareMatrix<Type>& M)
|
||||
{
|
||||
|
||||
@ -61,6 +61,9 @@ public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
LLTMatrix();
|
||||
|
||||
//- Construct from a square matrix and perform the decomposition
|
||||
LLTMatrix(const SquareMatrix<Type>& M);
|
||||
|
||||
|
||||
@ -39,6 +39,12 @@ namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::LUscalarMatrix::LUscalarMatrix()
|
||||
:
|
||||
comm_(Pstream::worldComm)
|
||||
{}
|
||||
|
||||
|
||||
Foam::LUscalarMatrix::LUscalarMatrix(const scalarSquareMatrix& matrix)
|
||||
:
|
||||
scalarSquareMatrix(matrix),
|
||||
@ -249,8 +255,6 @@ void Foam::LUscalarMatrix::convert
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//printDiagonalDominance();
|
||||
}
|
||||
|
||||
|
||||
@ -380,8 +384,6 @@ void Foam::LUscalarMatrix::convert
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//printDiagonalDominance();
|
||||
}
|
||||
|
||||
|
||||
@ -402,4 +404,12 @@ void Foam::LUscalarMatrix::printDiagonalDominance() const
|
||||
}
|
||||
|
||||
|
||||
void Foam::LUscalarMatrix::decompose(const scalarSquareMatrix& M)
|
||||
{
|
||||
scalarSquareMatrix::operator=(M);
|
||||
pivotIndices_.setSize(m());
|
||||
LUDecompose(*this, pivotIndices_);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -25,7 +25,7 @@ Class
|
||||
Foam::LUscalarMatrix
|
||||
|
||||
Description
|
||||
Foam::LUscalarMatrix
|
||||
Class to perform the LU decomposition on a symmetric matrix.
|
||||
|
||||
SourceFiles
|
||||
LUscalarMatrix.C
|
||||
@ -93,10 +93,14 @@ public:
|
||||
// Declare name of the class and its debug switch
|
||||
ClassName("LUscalarMatrix");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from scalarSquareMatrix and perform LU decomposition
|
||||
LUscalarMatrix(const scalarSquareMatrix&);
|
||||
//- Construct null
|
||||
LUscalarMatrix();
|
||||
|
||||
//- Construct from and perform LU decomposition of the matrix M
|
||||
LUscalarMatrix(const scalarSquareMatrix& M);
|
||||
|
||||
//- Construct from lduMatrix and perform LU decomposition
|
||||
LUscalarMatrix
|
||||
@ -109,6 +113,9 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Perform the LU decomposition of the matrix M
|
||||
void decompose(const scalarSquareMatrix& M);
|
||||
|
||||
//- Solve the matrix using the LU decomposition with pivoting
|
||||
// returning the solution in the source
|
||||
template<class T>
|
||||
|
||||
Reference in New Issue
Block a user