Class to perform the LU decomposition on a symmetric matrix. More...
Public Member Functions | |
ClassName ("LUscalarMatrix") | |
LUscalarMatrix () | |
Construct null. More... | |
LUscalarMatrix (const label n) | |
Construct given number of rows/columns. More... | |
LUscalarMatrix (const scalarSquareMatrix &M) | |
Construct from and perform LU decomposition of the matrix M. More... | |
LUscalarMatrix (const lduMatrix &, const FieldField< Field, scalar > &interfaceCoeffs, const lduInterfaceFieldPtrsList &interfaces) | |
Construct from lduMatrix and perform LU decomposition. More... | |
void | decompose () |
Perform the LU decomposition of the matrix. More... | |
void | decompose (const scalarSquareMatrix &M) |
Perform the LU decomposition of the matrix M. More... | |
template<class Type > | |
void | solve (Field< Type > &x, const Field< Type > &source) const |
Solve the linear system with the given source. More... | |
template<class Type > | |
tmp< Field< Type > > | solve (const Field< Type > &source) const |
Solve the linear system with the given source. More... | |
void | inv (scalarSquareMatrix &M) const |
Set M to the inverse of this square matrix. More... | |
template<class Type > | |
Foam::tmp< Foam::Field< Type > > | solve (const Field< Type > &source) const |
Public Member Functions inherited from SquareMatrix< scalar > | |
SquareMatrix () | |
Null constructor. More... | |
SquareMatrix (const label n) | |
Construct given number of rows/columns. More... | |
SquareMatrix (const ConstMatrixBlock< MatrixType > &) | |
Construct from a block of another matrix. More... | |
SquareMatrix (const MatrixBlock< MatrixType > &) | |
Construct from a block of another matrix. More... | |
SquareMatrix (const label n, const zero) | |
Construct given number of rows/columns. More... | |
SquareMatrix (const label m, const label n, const zero) | |
Construct given number of rows and columns (checked to be equal) More... | |
SquareMatrix (const label n, const Identity< scalar >) | |
Construct given number of rows/columns. More... | |
SquareMatrix (const label n, const scalar &) | |
Construct with given number of rows and rows. More... | |
SquareMatrix (const RectangularMatrix< scalar > &) | |
Construct as copy of a RectangularMatrix. More... | |
SquareMatrix (Istream &) | |
Construct from Istream. More... | |
autoPtr< SquareMatrix< scalar > > | clone () const |
Clone. More... | |
void | setSize (const label m) |
Resize the matrix preserving the elements. More... | |
void | shallowResize (const label m) |
Resize the matrix without reallocating storage (unsafe) More... | |
void | operator= (const zero) |
Assignment of all elements to zero. More... | |
void | operator= (const Identity< scalar >) |
Assignment elements to the. More... | |
Public Member Functions inherited from Matrix< SquareMatrix< scalar >, scalar > | |
Matrix () | |
Null constructor. More... | |
Matrix (const label m, const label n) | |
Construct given number of rows and columns. More... | |
Matrix (const label m, const label n, const zero) | |
Construct with given number of rows and columns. More... | |
Matrix (const label m, const label n, const scalar &) | |
Construct with given number of rows and columns. More... | |
Matrix (const mType &) | |
Copy constructor. More... | |
Matrix (const Matrix< Form2, scalar > &) | |
Copy constructor from matrix of a different form. More... | |
Matrix (const ConstMatrixBlock< MatrixType > &) | |
Construct from a block of another matrix. More... | |
Matrix (const MatrixBlock< MatrixType > &) | |
Construct from a block of another matrix. More... | |
Matrix (Istream &) | |
Construct from Istream. More... | |
autoPtr< mType > | clone () const |
Clone. More... | |
~Matrix () | |
Destructor. More... | |
label | m () const |
Return the number of rows. More... | |
label | n () const |
Return the number of columns. More... | |
label | size () const |
Return the number of elements in matrix (m*n) More... | |
const scalar * | v () const |
Return element vector of the constant Matrix. More... | |
scalar * | v () |
Return element vector of the Matrix. More... | |
ConstMatrixBlock< mType > | block (const label m, const label n, const label mStart, const label nStart) const |
ConstMatrixBlock< mType > | block (const label mStart, const label nStart) const |
MatrixBlock< mType > | block (const label m, const label n, const label mStart, const label nStart) |
MatrixBlock< mType > | block (const label mStart, const label nStart) |
Foam::ConstMatrixBlock< Foam::Matrix< SquareMatrix< scalar >, scalar > > | block (const label mStart, const label nStart) const |
Foam::MatrixBlock< Foam::Matrix< SquareMatrix< scalar >, scalar > > | block (const label mStart, const label nStart) |
ConstMatrixBlock< mType > | col (const label m, const label rowStart) const |
ConstMatrixBlock< mType > | col (const label m, const label mStart, const label nStart) const |
MatrixBlock< mType > | col (const label m, const label rowStart) |
MatrixBlock< mType > | col (const label m, const label mStart, const label nStart) |
void | checki (const label i) const |
Check index i is within valid range (0 ... m-1). More... | |
void | checkj (const label j) const |
Check index j is within valid range (0 ... n-1). More... | |
void | clear () |
Clear the Matrix, i.e. set sizes to zero. More... | |
void | transfer (mType &) |
Transfer the contents of the argument Matrix into this Matrix. More... | |
void | setSize (const label m, const label n) |
Resize the matrix preserving the elements. More... | |
void | shallowResize (const label m, const label n) |
Resize the matrix without reallocating storage (unsafe) More... | |
SquareMatrix< scalar > | T () const |
Return the transpose of the matrix. More... | |
scalar * | operator[] (const label) |
Return subscript-checked row of Matrix. More... | |
const scalar * | operator[] (const label) const |
Return subscript-checked row of constant Matrix. More... | |
const scalar & | operator() (const label i, const label j) const |
(i, j) const element access operator More... | |
scalar & | operator() (const label i, const label j) |
(i, j) element access operator More... | |
void | operator= (const mType &) |
Assignment operator. Takes linear time. More... | |
void | operator= (const ConstMatrixBlock< MatrixType > &) |
Assignment to a block of another matrix. More... | |
void | operator= (const MatrixBlock< MatrixType > &) |
Assignment to a block of another matrix. More... | |
void | operator= (const zero) |
Assignment of all elements to zero. More... | |
void | operator= (const scalar &) |
Assignment of all elements to the given value. More... | |
Additional Inherited Members | |
Public Types inherited from Matrix< SquareMatrix< scalar >, scalar > | |
typedef Matrix< SquareMatrix< scalar >, scalar > | mType |
Matrix type. More... | |
typedef scalar | cmptType |
Component type. More... | |
Static Public Member Functions inherited from SquareMatrix< scalar > | |
static word | typeName () |
Return the instantiated type name. More... | |
Static Public Member Functions inherited from Matrix< SquareMatrix< scalar >, scalar > | |
static const mType & | null () |
Return a null Matrix. More... | |
Class to perform the LU decomposition on a symmetric matrix.
Definition at line 54 of file LUscalarMatrix.H.
LUscalarMatrix | ( | ) |
Construct null.
Definition at line 42 of file LUscalarMatrix.C.
Referenced by LUscalarMatrix::LUscalarMatrix().
LUscalarMatrix | ( | const label | n | ) |
Construct given number of rows/columns.
Definition at line 48 of file LUscalarMatrix.C.
LUscalarMatrix | ( | const scalarSquareMatrix & | M | ) |
Construct from and perform LU decomposition of the matrix M.
Definition at line 56 of file LUscalarMatrix.C.
References Foam::LUDecompose(), and LUscalarMatrix::LUscalarMatrix().
LUscalarMatrix | ( | const lduMatrix & | ldum, |
const FieldField< Field, scalar > & | interfaceCoeffs, | ||
const lduInterfaceFieldPtrsList & | interfaces | ||
) |
Construct from lduMatrix and perform LU decomposition.
Definition at line 67 of file LUscalarMatrix.C.
References UPtrList< T >::begin(), UList< T >::begin(), lduMatrix::diag(), Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, UPstream::firstSlave(), forAll, Foam::Info, UPstream::lastSlave(), lduMatrix::lduAddr(), lduMatrix::lower(), lduAddressing::lowerAddr(), Foam::LUDecompose(), Matrix< SquareMatrix< scalar >, scalar >::m(), Foam::mag(), UPstream::master(), UPstream::masterNo(), UPstream::msgType(), Matrix< SquareMatrix< scalar >, scalar >::n(), cyclicLduInterface::nbrPatchID(), UPstream::nProcs(), Matrix< SquareMatrix< scalar >, scalar >::operator[](), UPstream::parRun(), Foam::Pout, UPstream::scheduled, UPtrList< T >::set(), PtrList< T >::set(), List< T >::setSize(), UPtrList< T >::size(), procLduMatrix::size(), List< T >::size(), lduAddressing::size(), Foam::sum(), Matrix< SquareMatrix< scalar >, scalar >::transfer(), lduMatrix::upper(), and lduAddressing::upperAddr().
ClassName | ( | "LUscalarMatrix" | ) |
void decompose | ( | ) |
Perform the LU decomposition of the matrix.
Definition at line 415 of file LUscalarMatrix.C.
References Foam::LUDecompose(), Matrix< SquareMatrix< scalar >, scalar >::m(), and List< T >::setSize().
void decompose | ( | const scalarSquareMatrix & | M | ) |
Perform the LU decomposition of the matrix M.
Definition at line 422 of file LUscalarMatrix.C.
References Foam::LUDecompose(), Matrix< SquareMatrix< scalar >, scalar >::m(), SquareMatrix< scalar >::operator=(), and List< T >::setSize().
Solve the linear system with the given source.
and returning the solution in the Field argument x. This function may be called with the same field for x and source.
Definition at line 33 of file LUscalarMatrixTemplates.C.
References UList< Type >::begin(), UList< Type >::byteSize(), Foam::LUBacksubstitute(), Foam::blockMeshTools::read(), List< Type >::size(), source(), and Foam::vtkWriteOps::write().
Solve the linear system with the given source.
returning the solution
void inv | ( | scalarSquareMatrix & | M | ) | const |
Set M to the inverse of this square matrix.
Definition at line 430 of file LUscalarMatrix.C.
References Foam::LUBacksubstitute(), Matrix< SquareMatrix< scalar >, scalar >::m(), M, source(), and Foam::Zero.
Referenced by ISAT< ThermoType >::~ISAT().
Foam::tmp<Foam::Field<Type> > solve | ( | const Field< Type > & | source | ) | const |
Definition at line 143 of file LUscalarMatrixTemplates.C.
References tmp< T >::ref(), and solve().