A simple square matrix solver with scalar coefficients. More...
#include <OpenFOAM/simpleMatrix.H>
A simple square matrix solver with scalar coefficients.
Definition at line 63 of file simpleMatrix.H.
Public Member Functions | |
simpleMatrix (const label) | |
Construct given size. | |
simpleMatrix (const label, const scalar, const Type &) | |
Construct given size and initial values for the. | |
simpleMatrix (const scalarSquareMatrix &, const Field< Type > &) | |
Construct from components. | |
simpleMatrix (Istream &) | |
Construct from Istream. | |
simpleMatrix (const simpleMatrix< Type > &) | |
Construct as copy. | |
Field< Type > & | source () |
Return access to the source. | |
const Field< Type > & | source () const |
Return const-access to the source. | |
Field< Type > | solve () const |
Solve the matrix using Gaussian elimination with pivoting. | |
Field< Type > | LUsolve () const |
Solve the matrix using LU decomposition with pivoting. | |
void | operator= (const simpleMatrix< Type > &) |
![]() | |
SquareMatrix () | |
Null constructor. | |
SquareMatrix (const label n) | |
Construct given number of rows/columns. | |
SquareMatrix (const label m, const label n) | |
Construct given number of rows and columns,. | |
SquareMatrix (const label m, const label n, const Type &) | |
Construct with given number of rows and rows. | |
SquareMatrix (Istream &) | |
Construct from Istream. | |
autoPtr< SquareMatrix< Type > > | clone () const |
Clone. | |
![]() | |
Matrix () | |
Null constructor. | |
Matrix (const label n, const label m) | |
Construct given number of rows and columns. | |
Matrix (const label n, const label m, const Type &) | |
Construct with given number of rows and columns. | |
Matrix (const Matrix< SquareMatrix< Type >, Type > &) | |
Copy constructor. | |
Matrix (Istream &) | |
Construct from Istream. | |
~Matrix () | |
label | n () const |
Return the number of rows. | |
label | m () const |
Return the number of columns. | |
label | size () const |
Return the number of elements in matrix (n*m) | |
void | checki (const label i) const |
Check index i is within valid range (0 ... n-1). | |
void | checkj (const label j) const |
Check index j is within valid range (0 ... m-1). | |
void | clear () |
Clear the Matrix, i.e. set sizes to zero. | |
void | transfer (Matrix< SquareMatrix< Type >, Type > &) |
Transfer the contents of the argument Matrix into this Matrix. | |
SquareMatrix< Type > | T () const |
Return the transpose of the matrix. | |
Type * | operator[] (const label) |
Return subscript-checked row of Matrix. | |
const Type * | operator[] (const label) const |
Return subscript-checked row of constant Matrix. | |
void | operator= (const Matrix< SquareMatrix< Type >, Type > &) |
Assignment operator. Takes linear time. | |
void | operator= (const Type &) |
Assignment of all entries to the given value. |
Friends | |
Ostream & | operator (Ostream &, const simpleMatrix< Type > &) |
simpleMatrix | ( | const label | mSize | ) |
Construct given size.
Note: this does not initialise the coefficients or the source.
Definition at line 31 of file simpleMatrix.C.
simpleMatrix | ( | const label | mSize, |
const scalar | coeffVal, | ||
const Type & | sourceVal | ||
) |
Construct given size and initial values for the.
coefficients and source
Definition at line 40 of file simpleMatrix.C.
simpleMatrix | ( | const scalarSquareMatrix & | matrix, |
const Field< Type > & | source | ||
) |
Construct from components.
Definition at line 53 of file simpleMatrix.C.
simpleMatrix | ( | Istream & | is | ) |
Construct from Istream.
Definition at line 64 of file simpleMatrix.C.
simpleMatrix | ( | const simpleMatrix< Type > & | ) |
Construct as copy.
|
inline |
Return access to the source.
Definition at line 99 of file simpleMatrix.H.
Referenced by EulerImplicit< CompType, ThermoType >::solve().
|
inline |
Return const-access to the source.
Definition at line 105 of file simpleMatrix.H.
Foam::Field< Type > solve | ( | ) | const |
Solve the matrix using Gaussian elimination with pivoting.
and return the solution
Definition at line 74 of file simpleMatrix.C.
References Foam::solve().
Foam::Field< Type > LUsolve | ( | ) | const |
Solve the matrix using LU decomposition with pivoting.
and return the solution
Definition at line 86 of file simpleMatrix.C.
References Foam::LUsolve().
Referenced by EulerImplicit< CompType, ThermoType >::solve().
void operator= | ( | const simpleMatrix< Type > & | m | ) |
Definition at line 100 of file simpleMatrix.C.
References Foam::abort(), Foam::FatalError, FatalErrorIn, Matrix< SquareMatrix< Type >, Type >::n(), and Matrix< SquareMatrix< scalar >, scalar >::operator=().
|
friend |