Classes | Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
faMatrix Class Reference

A special matrix type and solver, designed for finite area solutions of scalar equations. Face addressing is used to make all matrix assembly and solution loops vectorise. More...

Inheritance diagram for faMatrix:
Inheritance graph
[legend]

Classes

class  faSolver
 

Public Types

typedef GeometricField< Type, faPatchField, areaMeshpsiFieldType
 
typedef GeometricField< Type, faePatchField, edgeMeshfaceFluxFieldType
 
typedef GeometricField< Type, faePatchField, edgeMesh > * faceFluxFieldPtrType
 

Public Member Functions

 ClassName ("faMatrix")
 
 faMatrix (const GeometricField< Type, faPatchField, areaMesh > &psi, const dimensionSet &ds)
 
 faMatrix (const faMatrix< Type > &)
 
 faMatrix (const GeometricField< Type, faPatchField, areaMesh > &psi, Istream &is)
 
tmp< faMatrix< Type > > clone () const
 
virtual ~faMatrix ()
 
const GeometricField< Type, faPatchField, areaMesh > & psi () const
 
const dimensionSetdimensions () const
 
Field< Type > & source ()
 
const Field< Type > & source () const
 
const FieldField< Field, Type > & internalCoeffs () const
 
FieldField< Field, Type > & internalCoeffs ()
 
const FieldField< Field, Type > & boundaryCoeffs () const
 
FieldField< Field, Type > & boundaryCoeffs ()
 
faceFluxFieldPtrTypefaceFluxCorrectionPtr ()
 
bool hasFaceFluxCorrection () const noexcept
 
void setValues (const labelUList &faceLabels, const Type &value)
 
void setValues (const labelUList &faceLabels, const UList< Type > &values)
 
void setValues (const labelUList &faceLabels, const UIndirectList< Type > &values)
 
void setReference (const label facei, const Type &value, const bool forceReference=false)
 
void setReferences (const labelUList &faceLabels, const Type &value, const bool forceReference=false)
 
void setReferences (const labelUList &faceLabels, const UList< Type > &values, const bool forceReference=false)
 
void setComponentReference (const label patchi, const label facei, const direction cmpt, const scalar value)
 
void relax (const scalar alpha)
 
void relax ()
 
SolverPerformance< Type > solve (const dictionary &)
 
SolverPerformance< Type > solve ()
 
tmp< Field< Type > > residual () const
 
tmp< scalarFieldD () const
 
tmp< areaScalarFieldA () const
 
tmp< GeometricField< Type, faPatchField, areaMesh > > H () const
 
tmp< GeometricField< Type, faePatchField, edgeMesh > > flux () const
 
void operator= (const faMatrix< Type > &)
 
void operator= (const tmp< faMatrix< Type >> &)
 
void negate ()
 
void operator+= (const faMatrix< Type > &)
 
void operator+= (const tmp< faMatrix< Type >> &)
 
void operator-= (const faMatrix< Type > &)
 
void operator-= (const tmp< faMatrix< Type >> &)
 
void operator+= (const GeometricField< Type, faPatchField, areaMesh > &)
 
void operator+= (const tmp< GeometricField< Type, faPatchField, areaMesh >> &)
 
void operator-= (const GeometricField< Type, faPatchField, areaMesh > &)
 
void operator-= (const tmp< GeometricField< Type, faPatchField, areaMesh >> &)
 
void operator+= (const dimensioned< Type > &)
 
void operator-= (const dimensioned< Type > &)
 
void operator*= (const areaScalarField &)
 
void operator*= (const tmp< areaScalarField > &)
 
void operator*= (const dimensioned< scalar > &)
 
void setComponentReference (const label patchI, const label edgeI, const direction, const scalar value)
 
Foam::solverPerformance solve (const dictionary &solverControls)
 
Foam::tmp< Foam::scalarFieldresidual () const
 
Foam::tmp< Foam::areaScalarFieldH () const
 
void setComponentReference (const label patchi, const label facei, const direction, const scalar value)
 
SolverPerformance< scalar > solve (const dictionary &)
 
tmp< scalarFieldresidual () const
 
tmp< areaScalarFieldH () const
 

Protected Member Functions

template<class Type2 >
void addToInternalField (const labelUList &addr, const Field< Type2 > &pf, Field< Type2 > &intf) const
 
template<class Type2 >
void addToInternalField (const labelUList &addr, const tmp< Field< Type2 >> &tpf, Field< Type2 > &intf) const
 
template<class Type2 >
void subtractFromInternalField (const labelUList &addr, const Field< Type2 > &pf, Field< Type2 > &intf) const
 
template<class Type2 >
void subtractFromInternalField (const labelUList &addr, const tmp< Field< Type2 >> &tpf, Field< Type2 > &intf) const
 
void addBoundaryDiag (scalarField &diag, const direction cmpt) const
 
void addCmptAvBoundaryDiag (scalarField &diag) const
 
void addBoundarySource (Field< Type > &source, const bool couples=true) const
 
template<template< class > class ListType>
void setValuesFromList (const labelUList &faceLabels, const ListType< Type > &values)
 

Friends

class faSolver
 
Ostreamoperator (Ostream &, const faMatrix< Type > &)
 

Detailed Description

A special matrix type and solver, designed for finite area solutions of scalar equations. Face addressing is used to make all matrix assembly and solution loops vectorise.

Finite-Area matrix.

Author Zeljko Tukovic, FMENA Hrvoje Jasak, Wikki Ltd.

Source files
Author Zeljko Tukovic, FMENA Hrvoje Jasak, Wikki Ltd.

Definition at line 37 of file faMatricesFwd.H.

Member Typedef Documentation

◆ psiFieldType

Definition at line 79 of file faMatrix.H.

◆ faceFluxFieldType

Definition at line 84 of file faMatrix.H.

◆ faceFluxFieldPtrType

Definition at line 301 of file faMatrix.H.

Constructor & Destructor Documentation

◆ faMatrix() [1/3]

faMatrix ( const GeometricField< Type, faPatchField, areaMesh > &  psi,
const dimensionSet ds 
)

Definition at line 178 of file faMatrix.C.

◆ faMatrix() [2/3]

faMatrix ( const faMatrix< Type > &  )

◆ faMatrix() [3/3]

faMatrix ( const GeometricField< Type, faPatchField, areaMesh > &  psi,
Istream is 
)

Definition at line 258 of file faMatrix.C.

◆ ~faMatrix()

~faMatrix ( )
virtual

Definition at line 312 of file faMatrix.C.

Member Function Documentation

◆ addToInternalField() [1/2]

void addToInternalField ( const labelUList addr,
const Field< Type2 > &  pf,
Field< Type2 > &  intf 
) const
protected

Definition at line 35 of file faMatrix.C.

◆ addToInternalField() [2/2]

void addToInternalField ( const labelUList addr,
const tmp< Field< Type2 >> &  tpf,
Field< Type2 > &  intf 
) const
protected

Definition at line 59 of file faMatrix.C.

◆ subtractFromInternalField() [1/2]

void subtractFromInternalField ( const labelUList addr,
const Field< Type2 > &  pf,
Field< Type2 > &  intf 
) const
protected

Definition at line 73 of file faMatrix.C.

◆ subtractFromInternalField() [2/2]

void subtractFromInternalField ( const labelUList addr,
const tmp< Field< Type2 >> &  tpf,
Field< Type2 > &  intf 
) const
protected

Definition at line 97 of file faMatrix.C.

◆ addBoundaryDiag()

void addBoundaryDiag ( scalarField diag,
const direction  cmpt 
) const
protected

Definition at line 110 of file faMatrix.C.

Referenced by faMatrix< Type >::residual().

Here is the caller graph for this function:

◆ addCmptAvBoundaryDiag()

void addCmptAvBoundaryDiag ( scalarField diag) const
protected

Definition at line 128 of file faMatrix.C.

◆ addBoundarySource()

void addBoundarySource ( Field< Type > &  source,
const bool  couples = true 
) const
protected

Definition at line 144 of file faMatrix.C.

Referenced by faMatrix< Type >::residual().

Here is the caller graph for this function:

◆ setValuesFromList()

void setValuesFromList ( const labelUList faceLabels,
const ListType< Type > &  values 
)
protected

Definition at line 326 of file faMatrix.C.

◆ ClassName()

ClassName ( "faMatrix"  )

◆ clone()

Foam::tmp< Foam::faMatrix< Type > > clone ( ) const

Definition at line 302 of file faMatrix.C.

◆ psi()

const GeometricField<Type, faPatchField, areaMesh>& psi ( ) const
inline

◆ dimensions()

const dimensionSet& dimensions ( ) const
inline

Definition at line 256 of file faMatrix.H.

Referenced by Foam::checkMethod().

Here is the caller graph for this function:

◆ source() [1/2]

Field<Type>& source ( )
inline

Definition at line 261 of file faMatrix.H.

◆ source() [2/2]

const Field<Type>& source ( ) const
inline

Definition at line 266 of file faMatrix.H.

◆ internalCoeffs() [1/2]

const FieldField<Field, Type>& internalCoeffs ( ) const
inline

Definition at line 273 of file faMatrix.H.

◆ internalCoeffs() [2/2]

FieldField<Field, Type>& internalCoeffs ( )
inline

Definition at line 280 of file faMatrix.H.

◆ boundaryCoeffs() [1/2]

const FieldField<Field, Type>& boundaryCoeffs ( ) const
inline

Definition at line 287 of file faMatrix.H.

◆ boundaryCoeffs() [2/2]

FieldField<Field, Type>& boundaryCoeffs ( )
inline

Definition at line 294 of file faMatrix.H.

◆ faceFluxCorrectionPtr()

faceFluxFieldPtrType& faceFluxCorrectionPtr ( )
inline

Definition at line 304 of file faMatrix.H.

Referenced by gaussLaplacianScheme< Type >::famLaplacian().

Here is the caller graph for this function:

◆ hasFaceFluxCorrection()

bool hasFaceFluxCorrection ( ) const
inlinenoexcept

Definition at line 310 of file faMatrix.H.

◆ setValues() [1/3]

void setValues ( const labelUList faceLabels,
const Type &  value 
)

Definition at line 415 of file faMatrix.C.

◆ setValues() [2/3]

void setValues ( const labelUList faceLabels,
const UList< Type > &  values 
)

Definition at line 426 of file faMatrix.C.

◆ setValues() [3/3]

void setValues ( const labelUList faceLabels,
const UIndirectList< Type > &  values 
)

Definition at line 437 of file faMatrix.C.

◆ setReference()

void setReference ( const label  facei,
const Type &  value,
const bool  forceReference = false 
)

Definition at line 448 of file faMatrix.C.

◆ setReferences() [1/2]

void setReferences ( const labelUList faceLabels,
const Type &  value,
const bool  forceReference = false 
)

◆ setReferences() [2/2]

void setReferences ( const labelUList faceLabels,
const UList< Type > &  values,
const bool  forceReference = false 
)

◆ setComponentReference() [1/3]

void setComponentReference ( const label  patchi,
const label  facei,
const direction  cmpt,
const scalar  value 
)

Definition at line 32 of file faMatrixSolve.C.

◆ relax() [1/2]

void relax ( const scalar  alpha)

Definition at line 512 of file faMatrix.C.

Referenced by jouleHeatingSource::addSup(), kinematicThinFilm::evolveRegion(), and sensitivitySurface::smoothSensitivities().

Here is the caller graph for this function:

◆ relax() [2/2]

void relax ( )

Definition at line 602 of file faMatrix.C.

◆ solve() [1/4]

SolverPerformance<Type> solve ( const dictionary )

◆ solve() [2/4]

Foam::SolverPerformance< Type > solve ( )

Definition at line 173 of file faMatrixSolve.C.

Referenced by faMatrix< Type >::solve().

Here is the caller graph for this function:

◆ residual() [1/3]

Foam::tmp< Foam::Field< Type > > residual ( ) const

Definition at line 180 of file faMatrixSolve.C.

◆ D()

Foam::tmp< Foam::scalarField > D ( ) const

Definition at line 618 of file faMatrix.C.

◆ A()

Definition at line 627 of file faMatrix.C.

Referenced by kinematicThinFilm::evolveRegion().

Here is the caller graph for this function:

◆ H() [1/3]

Definition at line 654 of file faMatrix.C.

Referenced by kinematicThinFilm::evolveRegion().

Here is the caller graph for this function:

◆ flux()

Definition at line 698 of file faMatrix.C.

Referenced by kinematicThinFilm::evolveRegion().

Here is the caller graph for this function:

◆ operator=() [1/2]

void operator= ( const faMatrix< Type > &  )

◆ operator=() [2/2]

void operator= ( const tmp< faMatrix< Type >> &  )

◆ negate()

void negate ( )

Definition at line 821 of file faMatrix.C.

◆ operator+=() [1/5]

void operator+= ( const faMatrix< Type > &  )

◆ operator+=() [2/5]

void operator+= ( const tmp< faMatrix< Type >> &  )

◆ operator-=() [1/5]

void operator-= ( const faMatrix< Type > &  )

◆ operator-=() [2/5]

void operator-= ( const tmp< faMatrix< Type >> &  )

◆ operator+=() [3/5]

void operator+= ( const GeometricField< Type, faPatchField, areaMesh > &  )

◆ operator+=() [4/5]

void operator+= ( const tmp< GeometricField< Type, faPatchField, areaMesh >> &  )

◆ operator-=() [3/5]

void operator-= ( const GeometricField< Type, faPatchField, areaMesh > &  )

◆ operator-=() [4/5]

void operator-= ( const tmp< GeometricField< Type, faPatchField, areaMesh >> &  )

◆ operator+=() [5/5]

void operator+= ( const dimensioned< Type > &  )

◆ operator-=() [5/5]

void operator-= ( const dimensioned< Type > &  )

◆ operator*=() [1/3]

void operator*= ( const areaScalarField )

◆ operator*=() [2/3]

void operator*= ( const tmp< areaScalarField > &  )

◆ operator*=() [3/3]

void operator*= ( const dimensioned< scalar > &  )

◆ setComponentReference() [2/3]

void setComponentReference ( const label  patchI,
const label  edgeI,
const  direction,
const scalar  value 
)

Definition at line 34 of file faScalarMatrix.C.

◆ solve() [3/4]

Foam::solverPerformance solve ( const dictionary solverControls)

Definition at line 51 of file faScalarMatrix.C.

◆ residual() [2/3]

Foam::tmp< Foam::scalarField > residual ( ) const

Definition at line 102 of file faScalarMatrix.C.

◆ H() [2/3]

Definition at line 131 of file faScalarMatrix.C.

◆ setComponentReference() [3/3]

void setComponentReference ( const label  patchi,
const label  facei,
const  direction,
const scalar  value 
)

◆ solve() [4/4]

SolverPerformance< scalar > solve ( const dictionary )

◆ residual() [3/3]

tmp< scalarField > residual ( ) const

◆ H() [3/3]

tmp< areaScalarField > H ( ) const

Friends And Related Function Documentation

◆ faSolver

friend class faSolver
friend

Definition at line 116 of file faMatrix.H.

◆ operator

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

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