Classes | Public Member Functions | Friends | List of all members
lduMatrix Class Reference

lduMatrix is a general matrix class in which the coefficients are stored as three arrays, one for the upper triangle, one for the lower triangle and a third for the diagonal. More...

Inheritance diagram for lduMatrix:
Inheritance graph
[legend]

Classes

class  preconditioner
 Abstract base-class for lduMatrix preconditioners. More...
 
class  smoother
 Abstract base-class for lduMatrix smoothers. More...
 
class  solver
 Abstract base-class for lduMatrix solvers. More...
 

Public Member Functions

 ClassName ("lduMatrix")
 
 lduMatrix (const lduMesh &)
 Construct given an LDU addressed mesh. More...
 
 lduMatrix (const lduMatrix &)
 Construct as copy. More...
 
 lduMatrix (lduMatrix &, bool reUse)
 Construct as copy or re-use as specified. More...
 
 lduMatrix (const lduMesh &, Istream &)
 Construct given an LDU addressed mesh and an Istream. More...
 
 ~lduMatrix ()
 Destructor. More...
 
const lduMeshmesh () const
 Return the LDU mesh from which the addressing is obtained. More...
 
const lduAddressinglduAddr () const
 Return the LDU addressing. More...
 
const lduSchedulepatchSchedule () const
 Return the patch evaluation schedule. More...
 
scalarFieldlower ()
 
scalarFielddiag ()
 
scalarFieldupper ()
 
scalarFieldlower (const label size)
 
scalarFielddiag (const label nCoeffs)
 
scalarFieldupper (const label nCoeffs)
 
const scalarFieldlower () const
 
const scalarFielddiag () const
 
const scalarFieldupper () const
 
bool hasDiag () const
 
bool hasUpper () const
 
bool hasLower () const
 
bool diagonal () const
 
bool symmetric () const
 
bool asymmetric () const
 
void sumDiag ()
 
void negSumDiag ()
 
void sumMagOffDiag (scalarField &sumOff) const
 
void Amul (scalarField &, const tmp< scalarField > &, const FieldField< Field, scalar > &, const lduInterfaceFieldPtrsList &, const direction cmpt) const
 Matrix multiplication with updated interfaces. More...
 
void Tmul (scalarField &, const tmp< scalarField > &, const FieldField< Field, scalar > &, const lduInterfaceFieldPtrsList &, const direction cmpt) const
 Matrix transpose multiplication with updated interfaces. More...
 
void sumA (scalarField &, const FieldField< Field, scalar > &, const lduInterfaceFieldPtrsList &) const
 Sum the coefficients on each row of the matrix. More...
 
void residual (scalarField &rA, const scalarField &psi, const scalarField &source, const FieldField< Field, scalar > &interfaceBouCoeffs, const lduInterfaceFieldPtrsList &interfaces, const direction cmpt) const
 
tmp< scalarFieldresidual (const scalarField &psi, const scalarField &source, const FieldField< Field, scalar > &interfaceBouCoeffs, const lduInterfaceFieldPtrsList &interfaces, const direction cmpt) const
 
void initMatrixInterfaces (const FieldField< Field, scalar > &interfaceCoeffs, const lduInterfaceFieldPtrsList &interfaces, const scalarField &psiif, scalarField &result, const direction cmpt) const
 Initialise the update of interfaced interfaces. More...
 
void updateMatrixInterfaces (const FieldField< Field, scalar > &interfaceCoeffs, const lduInterfaceFieldPtrsList &interfaces, const scalarField &psiif, scalarField &result, const direction cmpt) const
 Update interfaced interfaces for matrix operations. More...
 
template<class Type >
tmp< Field< Type > > H (const Field< Type > &) const
 
template<class Type >
tmp< Field< Type > > H (const tmp< Field< Type > > &) const
 
tmp< scalarFieldH1 () const
 
template<class Type >
tmp< Field< Type > > faceH (const Field< Type > &) const
 
template<class Type >
tmp< Field< Type > > faceH (const tmp< Field< Type > > &) const
 
InfoProxy< lduMatrixinfo () const
 Return info proxy. More...
 
void operator= (const lduMatrix &)
 
void negate ()
 
void operator+= (const lduMatrix &)
 
void operator-= (const lduMatrix &)
 
void operator*= (const scalarField &)
 
void operator*= (scalar)
 
template<class Type >
Foam::tmp< Foam::Field< Type > > H (const Field< Type > &psi) const
 
template<class Type >
Foam::tmp< Foam::Field< Type > > H (const tmp< Field< Type > > &tpsi) const
 
template<class Type >
Foam::tmp< Foam::Field< Type > > faceH (const Field< Type > &psi) const
 
template<class Type >
Foam::tmp< Foam::Field< Type > > faceH (const tmp< Field< Type > > &tpsi) const
 

Friends

Ostreamoperator<< (Ostream &, const lduMatrix &)
 
Ostreamoperator<< (Ostream &, const InfoProxy< lduMatrix > &)
 

Detailed Description

lduMatrix is a general matrix class in which the coefficients are stored as three arrays, one for the upper triangle, one for the lower triangle and a third for the diagonal.

Addressing arrays must be supplied for the upper and lower triangles.

It might be better if this class were organised as a hierachy starting from an empty matrix, then deriving diagonal, symmetric and asymmetric matrices.

Source files

Definition at line 77 of file lduMatrix.H.

Constructor & Destructor Documentation

lduMatrix ( const lduMesh mesh)

Construct given an LDU addressed mesh.

The coefficients are initially empty for subsequent setting.

Definition at line 40 of file lduMatrix.C.

Referenced by lduMatrix::preconditioner::preconditionT().

Here is the caller graph for this function:

lduMatrix ( const lduMatrix A)

Construct as copy.

Definition at line 49 of file lduMatrix.C.

lduMatrix ( lduMatrix A,
bool  reUse 
)

Construct as copy or re-use as specified.

Definition at line 73 of file lduMatrix.C.

lduMatrix ( const lduMesh mesh,
Istream is 
)

Construct given an LDU addressed mesh and an Istream.

from which the coefficients are read

Definition at line 120 of file lduMatrix.C.

References lduMatrix::hasDiag().

Here is the call graph for this function:

~lduMatrix ( )

Destructor.

Definition at line 146 of file lduMatrix.C.

Referenced by lduMatrix::preconditioner::preconditionT().

Here is the caller graph for this function:

Member Function Documentation

ClassName ( "lduMatrix"  )

Referenced by lduMatrix::preconditioner::preconditionT().

Here is the caller graph for this function:

const lduMesh& mesh ( ) const
inline

Return the LDU mesh from which the addressing is obtained.

Definition at line 544 of file lduMatrix.H.

Referenced by algebraicPairGAMGAgglomeration::algebraicPairGAMGAgglomeration(), GAMGAgglomeration::New(), PCG::solve(), PBiCG::solve(), and smoothSolver::solve().

Here is the caller graph for this function:

const lduAddressing& lduAddr ( ) const
inline
const lduSchedule& patchSchedule ( ) const
inline

Return the patch evaluation schedule.

Definition at line 556 of file lduMatrix.H.

References lduMatrix::diag(), lduMatrix::lduAddr(), lduMatrix::lower(), lduAddressing::patchSchedule(), and lduMatrix::upper().

Here is the call graph for this function:

Foam::scalarField & lower ( )
Foam::scalarField & diag ( )
Foam::scalarField & upper ( )
Foam::scalarField & lower ( const label  size)

Definition at line 212 of file lduMatrix.C.

Foam::scalarField & diag ( const label  nCoeffs)

Definition at line 230 of file lduMatrix.C.

Foam::scalarField & upper ( const label  nCoeffs)

Definition at line 241 of file lduMatrix.C.

const Foam::scalarField & lower ( ) const

Definition at line 259 of file lduMatrix.C.

References Foam::abort(), Foam::FatalError, and FatalErrorIn.

Here is the call graph for this function:

const Foam::scalarField & diag ( ) const

Definition at line 279 of file lduMatrix.C.

References Foam::abort(), Foam::FatalError, and FatalErrorIn.

Here is the call graph for this function:

const Foam::scalarField & upper ( ) const

Definition at line 292 of file lduMatrix.C.

References Foam::abort(), Foam::FatalError, and FatalErrorIn.

Here is the call graph for this function:

bool hasDiag ( ) const
inline

Definition at line 580 of file lduMatrix.H.

Referenced by lduMatrix::lduMatrix(), and Foam::operator<<().

Here is the caller graph for this function:

bool hasUpper ( ) const
inline

Definition at line 585 of file lduMatrix.H.

Referenced by Foam::checkMethod(), and Foam::operator<<().

Here is the caller graph for this function:

bool hasLower ( ) const
inline

Definition at line 590 of file lduMatrix.H.

Referenced by Foam::checkMethod(), and Foam::operator<<().

Here is the caller graph for this function:

bool diagonal ( ) const
inline

Definition at line 595 of file lduMatrix.H.

Referenced by lduMatrix::solver::New(), lduMatrix::operator+=(), and lduMatrix::operator-=().

Here is the caller graph for this function:

bool symmetric ( ) const
inline
bool asymmetric ( ) const
inline
void sumDiag ( )

Definition at line 33 of file lduMatrixOperations.C.

References lduMatrix::diag(), lduMatrix::lduAddr(), lduMatrix::lower(), lduAddressing::lowerAddr(), UList< T >::size(), lduMatrix::upper(), and lduAddressing::upperAddr().

Referenced by lduMatrix::asymmetric().

Here is the call graph for this function:

Here is the caller graph for this function:

void negSumDiag ( )
void sumMagOffDiag ( scalarField sumOff) const

Definition at line 68 of file lduMatrixOperations.C.

References lduMatrix::lduAddr(), lduMatrix::lower(), lduAddressing::lowerAddr(), Foam::mag(), UList< T >::size(), lduMatrix::upper(), and lduAddressing::upperAddr().

Referenced by lduMatrix::asymmetric(), lduMatrix::negSumDiag(), and fvMatrix< Type >::relax().

Here is the call graph for this function:

Here is the caller graph for this function:

void Amul ( scalarField Apsi,
const tmp< scalarField > &  tpsi,
const FieldField< Field, scalar > &  interfaceBouCoeffs,
const lduInterfaceFieldPtrsList interfaces,
const direction  cmpt 
) const

Matrix multiplication with updated interfaces.

Definition at line 35 of file lduMatrixATmul.C.

References UList< T >::begin(), tmp< T >::clear(), Foam::diag(), psi, and lduMatrix::Tmul().

Referenced by lduMatrix::asymmetric().

Here is the call graph for this function:

Here is the caller graph for this function:

void Tmul ( scalarField Tpsi,
const tmp< scalarField > &  tpsi,
const FieldField< Field, scalar > &  interfaceIntCoeffs,
const lduInterfaceFieldPtrsList interfaces,
const direction  cmpt 
) const

Matrix transpose multiplication with updated interfaces.

Definition at line 96 of file lduMatrixATmul.C.

References UList< T >::begin(), tmp< T >::clear(), Foam::diag(), psi, and lduMatrix::sumA().

Referenced by lduMatrix::Amul(), and lduMatrix::asymmetric().

Here is the call graph for this function:

Here is the caller graph for this function:

void sumA ( scalarField sumA,
const FieldField< Field, scalar > &  interfaceBouCoeffs,
const lduInterfaceFieldPtrsList interfaces 
) const

Sum the coefficients on each row of the matrix.

Definition at line 155 of file lduMatrixATmul.C.

References UList< T >::begin(), Foam::diag(), forAll, lduMatrix::residual(), and UPtrList< T >::set().

Referenced by lduMatrix::asymmetric(), and lduMatrix::Tmul().

Here is the call graph for this function:

Here is the caller graph for this function:

void residual ( scalarField rA,
const scalarField psi,
const scalarField source,
const FieldField< Field, scalar > &  interfaceBouCoeffs,
const lduInterfaceFieldPtrsList interfaces,
const direction  cmpt 
) const

Definition at line 204 of file lduMatrixATmul.C.

References UList< T >::begin(), Foam::diag(), forAll, patchi, UPtrList< T >::set(), and PtrList< Field< Type > >::size().

Referenced by lduMatrix::asymmetric(), fvMatrix< Type >::residual(), and lduMatrix::sumA().

Here is the call graph for this function:

Here is the caller graph for this function:

Foam::tmp< Foam::scalarField > residual ( const scalarField psi,
const scalarField source,
const FieldField< Field, scalar > &  interfaceBouCoeffs,
const lduInterfaceFieldPtrsList interfaces,
const direction  cmpt 
) const

Definition at line 284 of file lduMatrixATmul.C.

References scalarField(), and List< T >::size().

Here is the call graph for this function:

void initMatrixInterfaces ( const FieldField< Field, scalar > &  interfaceCoeffs,
const lduInterfaceFieldPtrsList interfaces,
const scalarField psiif,
scalarField result,
const direction  cmpt 
) const

Initialise the update of interfaced interfaces.

for matrix operations

Definition at line 31 of file lduMatrixUpdateMatrixInterfaces.C.

References Foam::exit(), Foam::FatalError, FatalErrorIn, forAll, UPtrList< T >::set(), List< T >::size(), UPtrList< T >::size(), and lduMatrix::updateMatrixInterfaces().

Referenced by lduMatrix::asymmetric(), symGaussSeidelSmoother::smooth(), GaussSeidelSmoother::smooth(), and nonBlockingGaussSeidelSmoother::smooth().

Here is the call graph for this function:

Here is the caller graph for this function:

void updateMatrixInterfaces ( const FieldField< Field, scalar > &  interfaceCoeffs,
const lduInterfaceFieldPtrsList interfaces,
const scalarField psiif,
scalarField result,
const direction  cmpt 
) const

Update interfaced interfaces for matrix operations.

Definition at line 97 of file lduMatrixUpdateMatrixInterfaces.C.

References Foam::exit(), Foam::FatalError, FatalErrorIn, forAll, UPtrList< T >::set(), List< T >::size(), and UPtrList< T >::size().

Referenced by lduMatrix::asymmetric(), lduMatrix::initMatrixInterfaces(), symGaussSeidelSmoother::smooth(), GaussSeidelSmoother::smooth(), and nonBlockingGaussSeidelSmoother::smooth().

Here is the call graph for this function:

Here is the caller graph for this function:

tmp<Field<Type> > H ( const Field< Type > &  ) const

Referenced by lduMatrix::asymmetric(), lduMatrix::H(), and fvMatrix< Type >::H().

Here is the caller graph for this function:

tmp<Field<Type> > H ( const tmp< Field< Type > > &  ) const
Foam::tmp< Foam::scalarField > H1 ( ) const

Definition at line 298 of file lduMatrixATmul.C.

References UList< T >::begin(), lduMatrix::lduAddr(), lduMatrix::lower(), lduAddressing::lowerAddr(), List< T >::size(), lduMatrix::upper(), and lduAddressing::upperAddr().

Referenced by lduMatrix::asymmetric(), and fvMatrix< Type >::H1().

Here is the call graph for this function:

Here is the caller graph for this function:

tmp<Field<Type> > faceH ( const Field< Type > &  ) const

Referenced by lduMatrix::asymmetric(), lduMatrix::faceH(), and fvMatrix< Type >::flux().

Here is the caller graph for this function:

tmp<Field<Type> > faceH ( const tmp< Field< Type > > &  ) const
InfoProxy<lduMatrix> info ( ) const
inline

Return info proxy.

Used to print matrix information to a stream

Definition at line 709 of file lduMatrix.H.

Referenced by lduMatrix::asymmetric().

Here is the caller graph for this function:

void operator= ( const lduMatrix A)

Definition at line 88 of file lduMatrixOperations.C.

References Foam::abort(), lduMatrix::diag(), Foam::FatalError, lduMatrix::lower(), and lduMatrix::upper().

Referenced by lduMatrix::asymmetric(), and fvMatrix< Type >::operator=().

Here is the call graph for this function:

Here is the caller graph for this function:

void negate ( )

Definition at line 125 of file lduMatrixOperations.C.

References Field< Type >::negate().

Referenced by lduMatrix::asymmetric(), and fvMatrix< Type >::negate().

Here is the call graph for this function:

Here is the caller graph for this function:

void operator+= ( const lduMatrix A)

Definition at line 144 of file lduMatrixOperations.C.

References lduMatrix::asymmetric(), lduMatrix::diag(), lduMatrix::diagonal(), Foam::endl(), lduMatrix::lower(), Foam::nl, lduMatrix::symmetric(), lduMatrix::upper(), and WarningIn.

Referenced by lduMatrix::asymmetric(), and fvMatrix< Type >::operator+=().

Here is the call graph for this function:

Here is the caller graph for this function:

void operator-= ( const lduMatrix A)

Definition at line 223 of file lduMatrixOperations.C.

References lduMatrix::asymmetric(), lduMatrix::diag(), lduMatrix::diagonal(), Foam::endl(), lduMatrix::lower(), Foam::nl, lduMatrix::symmetric(), lduMatrix::upper(), and WarningIn.

Referenced by lduMatrix::asymmetric(), and fvMatrix< Type >::operator-=().

Here is the call graph for this function:

Here is the caller graph for this function:

void operator*= ( const scalarField sf)

Definition at line 302 of file lduMatrixOperations.C.

References lduMatrix::asymmetric(), lduMatrix::lduAddr(), lduMatrix::lower(), lduAddressing::lowerAddr(), sf(), List< T >::size(), lduMatrix::symmetric(), lduMatrix::upper(), and lduAddressing::upperAddr().

Referenced by lduMatrix::asymmetric(), and fvMatrix< Type >::operator*=().

Here is the call graph for this function:

Here is the caller graph for this function:

void operator*= ( scalar  s)

Definition at line 332 of file lduMatrixOperations.C.

References s().

Here is the call graph for this function:

Foam::tmp<Foam::Field<Type> > H ( const Field< Type > &  psi) const
Foam::tmp<Foam::Field<Type> > H ( const tmp< Field< Type > > &  tpsi) const

Definition at line 69 of file lduMatrixTemplates.C.

References lduMatrix::H().

Here is the call graph for this function:

Foam::tmp<Foam::Field<Type> > faceH ( const Field< Type > &  psi) const
Foam::tmp<Foam::Field<Type> > faceH ( const tmp< Field< Type > > &  tpsi) const

Definition at line 115 of file lduMatrixTemplates.C.

References lduMatrix::faceH().

Here is the call graph for this function:

Friends And Related Function Documentation

Ostream& operator<< ( Ostream ,
const lduMatrix  
)
friend

Referenced by lduMatrix::asymmetric().

Ostream& operator<< ( Ostream ,
const InfoProxy< lduMatrix > &   
)
friend

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