Public Member Functions | Friends | List of all members
simpleMatrix< Type > Class Template Reference

A simple square matrix solver with scalar coefficients. More...

Inheritance diagram for simpleMatrix< Type >:
Inheritance graph
[legend]
Collaboration diagram for simpleMatrix< Type >:
Collaboration graph
[legend]

Public Member Functions

 simpleMatrix (const label)
 Construct given size. More...
 
 simpleMatrix (const label, const scalar, const Type &)
 Construct given size and initial values for coefficients and source. More...
 
 simpleMatrix (const scalarSquareMatrix &, const Field< Type > &)
 Construct from components. More...
 
 simpleMatrix (Istream &)
 Construct from Istream. More...
 
 simpleMatrix (const simpleMatrix< Type > &)
 Construct as copy. More...
 
Field< Type > & source ()
 Return access to the source. More...
 
const Field< Type > & source () const
 Return const-access to the source. More...
 
Field< Type > solve () const
 Solve the matrix using Gaussian elimination with pivoting. More...
 
Field< Type > LUsolve () const
 Solve the matrix using LU decomposition with pivoting. More...
 
void operator= (const simpleMatrix< Type > &)
 
- Public Member Functions inherited from SquareMatrix< Type >
 SquareMatrix ()
 Null constructor. More...
 
 SquareMatrix (const label n)
 Construct given number of rows/columns. More...
 
 SquareMatrix (const label m, const label n)
 Construct given number of rows and columns,. More...
 
 SquareMatrix (const label m, const label n, const Type &)
 Construct with given number of rows and rows. More...
 
 SquareMatrix (Istream &)
 Construct from Istream. More...
 
autoPtr< SquareMatrix< Type > > clone () const
 Clone. More...
 
- Public Member Functions inherited from Matrix< SquareMatrix< Type >, Type >
 Matrix ()
 Null constructor. More...
 
 Matrix (const label n, const label m)
 Construct given number of rows and columns. More...
 
 Matrix (const label n, const label m, const Type &)
 Construct with given number of rows and columns. More...
 
 Matrix (const Matrix< SquareMatrix< Type >, Type > &)
 Copy constructor. More...
 
 Matrix (Istream &)
 Construct from Istream. More...
 
autoPtr< Matrix< SquareMatrix< Type >, Type > > clone () const
 Clone. More...
 
 ~Matrix ()
 Destructor. More...
 
label n () const
 Return the number of rows. More...
 
label m () const
 Return the number of columns. More...
 
label size () const
 Return the number of elements in matrix (n*m) More...
 
void checki (const label i) const
 Check index i is within valid range (0 ... n-1). More...
 
void checkj (const label j) const
 Check index j is within valid range (0 ... m-1). More...
 
void clear ()
 Clear the Matrix, i.e. set sizes to zero. More...
 
void transfer (Matrix< SquareMatrix< Type >, Type > &)
 Transfer the contents of the argument Matrix into this Matrix. More...
 
SquareMatrix< Type > T () const
 Return the transpose of the matrix. More...
 
Type * operator[] (const label)
 Return subscript-checked row of Matrix. More...
 
const Type * operator[] (const label) const
 Return subscript-checked row of constant Matrix. More...
 
void operator= (const Matrix< SquareMatrix< Type >, Type > &)
 Assignment operator. Takes linear time. More...
 
void operator= (const Type &)
 Assignment of all entries to the given value. More...
 

Friends

Ostreamoperator (Ostream &, const simpleMatrix< Type > &)
 

Additional Inherited Members

- Static Public Member Functions inherited from Matrix< SquareMatrix< Type >, Type >
static const Matrix< SquareMatrix< Type >, Type > & null ()
 Return a null Matrix. More...
 

Detailed Description

template<class Type>
class Foam::simpleMatrix< Type >

A simple square matrix solver with scalar coefficients.

Source files

Definition at line 47 of file simpleMatrix.H.

Constructor & Destructor Documentation

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.

Referenced by simpleMatrix< Type >::simpleMatrix().

Here is the caller graph for this function:

simpleMatrix ( const label  mSize,
const scalar  coeffVal,
const Type &  sourceVal 
)

Construct given size and initial values for coefficients and source.

Definition at line 40 of file simpleMatrix.C.

References simpleMatrix< Type >::simpleMatrix().

Here is the call graph for this function:

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.

Member Function Documentation

Field<Type>& source ( )
inline

Return access to the source.

Definition at line 97 of file simpleMatrix.H.

Referenced by EulerImplicit< ChemistryModel >::solve().

Here is the caller graph for this function:

const Field<Type>& source ( ) const
inline

Return const-access to the source.

Definition at line 103 of file simpleMatrix.H.

References simpleMatrix< Type >::LUsolve(), simpleMatrix< Type >::operator=(), and simpleMatrix< Type >::solve().

Here is the call graph for this function:

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().

Referenced by simpleMatrix< Type >::source().

Here is the call graph for this function:

Here is the caller graph for this function:

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< ChemistryModel >::solve(), and simpleMatrix< Type >::source().

Here is the call graph for this function:

Here is the caller graph for this function:

void operator= ( const simpleMatrix< Type > &  m)

Definition at line 100 of file simpleMatrix.C.

References Foam::abort(), Foam::FatalError, FatalErrorIn, Matrix< SquareMatrix< Type >, Type >::m(), Matrix< SquareMatrix< Type >, Type >::n(), Foam::nl, Matrix< SquareMatrix< scalar >, scalar >::operator=(), and s().

Referenced by simpleMatrix< Type >::source().

Here is the call graph for this function:

Here is the caller graph for this function:

Friends And Related Function Documentation

Ostream& operator ( Ostream ,
const simpleMatrix< Type > &   
)
friend

The documentation for this class was generated from the following files: