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

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

Inheritance diagram for fvMatrix:
Inheritance graph
[legend]

Classes

class  fvSolver
 

Public Types

typedef GeometricField< Type, fvPatchField, volMeshpsiFieldType
 
typedef GeometricField< Type, fvsPatchField, surfaceMeshfaceFluxFieldType
 
typedef GeometricField< Type, fvsPatchField, surfaceMesh > * faceFluxFieldPtrType
 

Public Member Functions

 ClassName ("fvMatrix")
 
 fvMatrix (const GeometricField< Type, fvPatchField, volMesh > &psi, const dimensionSet &ds)
 
 fvMatrix (const fvMatrix< Type > &)
 
 fvMatrix (const tmp< fvMatrix< Type >> &)
 
 fvMatrix (const GeometricField< Type, fvPatchField, volMesh > &psi, Istream &is)
 
tmp< fvMatrix< Type > > clone () const
 
virtual ~fvMatrix ()
 
label nMatrices () const
 
const fvMatrix< Type > & matrix (const label i) const
 
fvMatrix< Type > & matrix (const label i)
 
label globalPatchID (const label fieldi, const label patchi) const
 
void transferFvMatrixCoeffs ()
 
void createOrUpdateLduPrimitiveAssembly ()
 
lduPrimitiveMeshAssemblylduMeshPtr ()
 
const lduPrimitiveMeshAssemblylduMeshPtr () const
 
void manipulateMatrix (direction cmp)
 
void setBounAndInterCoeffs ()
 
void setInterfaces (lduInterfaceFieldPtrsList &, PtrDynList< lduInterfaceField > &newInterfaces)
 
void mapContributions (label fieldi, const FieldField< Field, Type > &fluxContrib, FieldField< Field, Type > &contrib, bool internal) const
 
const lduPrimitiveMeshAssemblylduMeshAssembly ()
 
const GeometricField< Type, fvPatchField, volMesh > & psi (const label i=0) const
 
GeometricField< Type, fvPatchField, volMesh > & psi (const label i=0)
 
void clear ()
 
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 &cellLabels, const Type &value)
 
void setValues (const labelUList &cellLabels, const UList< Type > &values)
 
void setValues (const labelUList &cellLabels, const UIndirectList< Type > &values)
 
void setReference (const label celli, const Type &value, const bool forceReference=false)
 
void setReferences (const labelUList &cellLabels, const Type &value, const bool forceReference=false)
 
void setReferences (const labelUList &cellLabels, const UList< Type > &values, const bool forceReference=false)
 
void setComponentReference (const label patchi, const label facei, const direction cmpt, const scalar value)
 
void addFvMatrix (fvMatrix< Type > &matrix)
 
void relax (const scalar alpha)
 
void relax ()
 
void boundaryManipulate (typename GeometricField< Type, fvPatchField, volMesh >::Boundary &values)
 
autoPtr< fvSolversolver (const dictionary &)
 
autoPtr< fvSolversolver ()
 
SolverPerformance< Type > solveSegregatedOrCoupled (const dictionary &)
 
SolverPerformance< Type > solveSegregated (const dictionary &)
 
SolverPerformance< Type > solveCoupled (const dictionary &)
 
SolverPerformance< Type > solve (const dictionary &)
 
SolverPerformance< Type > solve ()
 
tmp< Field< Type > > residual () const
 
tmp< scalarFieldD () const
 
tmp< Field< Type > > DD () const
 
tmp< volScalarFieldA () const
 
tmp< GeometricField< Type, fvPatchField, volMesh > > H () const
 
tmp< volScalarFieldH1 () const
 
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > flux () const
 
const dictionarysolverDict () const
 
void operator= (const fvMatrix< Type > &)
 
void operator= (const tmp< fvMatrix< Type >> &)
 
void negate ()
 
void operator+= (const fvMatrix< Type > &)
 
void operator+= (const tmp< fvMatrix< Type >> &)
 
void operator-= (const fvMatrix< Type > &)
 
void operator-= (const tmp< fvMatrix< Type >> &)
 
void operator+= (const DimensionedField< Type, volMesh > &)
 
void operator+= (const tmp< DimensionedField< Type, volMesh >> &)
 
void operator+= (const tmp< GeometricField< Type, fvPatchField, volMesh >> &)
 
void operator-= (const DimensionedField< Type, volMesh > &)
 
void operator-= (const tmp< DimensionedField< Type, volMesh >> &)
 
void operator-= (const tmp< GeometricField< Type, fvPatchField, volMesh >> &)
 
void operator+= (const dimensioned< Type > &)
 
void operator-= (const dimensioned< Type > &)
 
void operator+= (const zero &)
 
void operator-= (const zero &)
 
void operator*= (const volScalarField::Internal &)
 
void operator*= (const tmp< volScalarField::Internal > &)
 
void operator*= (const tmp< volScalarField > &)
 
void operator*= (const dimensioned< scalar > &)
 
void setComponentReference (const label patchi, const label facei, const direction, const scalar value)
 
Foam::autoPtr< Foam::fvMatrix< Foam::scalar >::fvSolversolver (const dictionary &solverControls)
 
Foam::solverPerformance solveSegregated (const dictionary &solverControls)
 
Foam::tmp< Foam::scalarFieldresidual () const
 
Foam::tmp< Foam::volScalarFieldH () const
 
Foam::tmp< Foam::volScalarFieldH1 () const
 
void setComponentReference (const label patchi, const label facei, const direction, const scalar value)
 
autoPtr< fvMatrix< scalar >::fvSolversolver (const dictionary &)
 
solverPerformance solveSegregated (const dictionary &)
 
tmp< scalarFieldresidual () const
 
tmp< volScalarFieldH () const
 
tmp< volScalarFieldH1 () 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
 
label checkImplicit (const label fieldI=0)
 
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 &cellLabels, const ListType< Type > &values)
 

Friends

class fvSolver
 
tmp< GeometricField< Type, fvPatchField, volMesh > > operator& (const fvMatrix< Type > &, const DimensionedField< Type, volMesh > &)
 
tmp< GeometricField< Type, fvPatchField, volMesh > > operator& (const fvMatrix< Type > &, const tmp< GeometricField< Type, fvPatchField, volMesh >> &)
 
tmp< GeometricField< Type, fvPatchField, volMesh > > operator& (const tmp< fvMatrix< Type >> &, const DimensionedField< Type, volMesh > &)
 
tmp< GeometricField< Type, fvPatchField, volMesh > > operator& (const tmp< fvMatrix< Type >> &, const tmp< GeometricField< Type, fvPatchField, volMesh >> &)
 
Ostreamoperator (Ostream &, const fvMatrix< Type > &)
 

Detailed Description

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

Source files

Definition at line 64 of file fvPatchField.H.

Member Typedef Documentation

◆ psiFieldType

Definition at line 126 of file fvMatrix.H.

◆ faceFluxFieldType

Definition at line 131 of file fvMatrix.H.

◆ faceFluxFieldPtrType

Definition at line 481 of file fvMatrix.H.

Constructor & Destructor Documentation

◆ fvMatrix() [1/4]

fvMatrix ( const GeometricField< Type, fvPatchField, volMesh > &  psi,
const dimensionSet ds 
)

Definition at line 337 of file fvMatrix.C.

◆ fvMatrix() [2/4]

fvMatrix ( const fvMatrix< Type > &  )

◆ fvMatrix() [3/4]

fvMatrix ( const tmp< fvMatrix< Type >> &  )

◆ fvMatrix() [4/4]

fvMatrix ( const GeometricField< Type, fvPatchField, volMesh > &  psi,
Istream is 
)

Definition at line 473 of file fvMatrix.C.

◆ ~fvMatrix()

~fvMatrix ( )
virtual

Definition at line 531 of file fvMatrix.C.

Member Function Documentation

◆ addToInternalField() [1/2]

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

Definition at line 42 of file fvMatrix.C.

◆ addToInternalField() [2/2]

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

Definition at line 66 of file fvMatrix.C.

◆ subtractFromInternalField() [1/2]

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

Definition at line 80 of file fvMatrix.C.

◆ subtractFromInternalField() [2/2]

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

Definition at line 104 of file fvMatrix.C.

◆ checkImplicit()

Foam::label checkImplicit ( const label  fieldI = 0)
protected

Definition at line 300 of file fvMatrix.C.

◆ addBoundaryDiag()

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

Definition at line 117 of file fvMatrix.C.

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

Here is the caller graph for this function:

◆ addCmptAvBoundaryDiag()

void addCmptAvBoundaryDiag ( scalarField diag) const
protected

Definition at line 145 of file fvMatrix.C.

◆ addBoundarySource()

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

Definition at line 170 of file fvMatrix.C.

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

Here is the caller graph for this function:

◆ setValuesFromList()

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

Definition at line 220 of file fvMatrix.C.

◆ ClassName()

ClassName ( "fvMatrix"  )

◆ clone()

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

Definition at line 522 of file fvMatrix.C.

Referenced by fvMatrix< Type >::addFvMatrix().

Here is the caller graph for this function:

◆ nMatrices()

label nMatrices ( ) const
inline

Definition at line 322 of file fvMatrix.H.

◆ matrix() [1/2]

const fvMatrix<Type>& matrix ( const label  i) const
inline

Definition at line 327 of file fvMatrix.H.

Referenced by fvMatrix< Type >::psi().

Here is the caller graph for this function:

◆ matrix() [2/2]

fvMatrix<Type>& matrix ( const label  i)
inline

Definition at line 332 of file fvMatrix.H.

◆ globalPatchID()

label globalPatchID ( const label  fieldi,
const label  patchi 
) const
inline

Definition at line 338 of file fvMatrix.H.

◆ transferFvMatrixCoeffs()

void transferFvMatrixCoeffs ( )

Definition at line 896 of file fvMatrix.C.

◆ createOrUpdateLduPrimitiveAssembly()

void createOrUpdateLduPrimitiveAssembly ( )

Definition at line 989 of file fvMatrix.C.

◆ lduMeshPtr() [1/2]

Definition at line 963 of file fvMatrix.C.

Referenced by fvMatrix< Type >::globalPatchID(), and fvMatrix< Type >::lduMeshAssembly().

Here is the caller graph for this function:

◆ lduMeshPtr() [2/2]

const Foam::lduPrimitiveMeshAssembly * lduMeshPtr ( ) const

Definition at line 976 of file fvMatrix.C.

◆ manipulateMatrix()

void manipulateMatrix ( direction  cmp)

Definition at line 873 of file fvMatrix.C.

◆ setBounAndInterCoeffs()

void setBounAndInterCoeffs ( )

Definition at line 735 of file fvMatrix.C.

◆ setInterfaces()

void setInterfaces ( lduInterfaceFieldPtrsList interfaces,
PtrDynList< lduInterfaceField > &  newInterfaces 
)

Definition at line 545 of file fvMatrix.C.

◆ mapContributions()

void mapContributions ( label  fieldi,
const FieldField< Field, Type > &  fluxContrib,
FieldField< Field, Type > &  contrib,
bool  internal 
) const

Definition at line 623 of file fvMatrix.C.

◆ lduMeshAssembly()

const lduPrimitiveMeshAssembly& lduMeshAssembly ( )
inline

◆ psi() [1/2]

const GeometricField<Type, fvPatchField, volMesh>& psi ( const label  i = 0) const
inline

◆ psi() [2/2]

GeometricField<Type, fvPatchField, volMesh>& psi ( const label  i = 0)
inline

Definition at line 407 of file fvMatrix.H.

◆ clear()

void clear ( )
inline

Definition at line 429 of file fvMatrix.H.

◆ dimensions()

const dimensionSet& dimensions ( ) const
inline

◆ source() [1/2]

Field<Type>& source ( )
inline

◆ source() [2/2]

const Field<Type>& source ( ) const
inline

Definition at line 446 of file fvMatrix.H.

◆ internalCoeffs() [1/2]

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

◆ internalCoeffs() [2/2]

FieldField<Field, Type>& internalCoeffs ( )
inline

Definition at line 460 of file fvMatrix.H.

◆ boundaryCoeffs() [1/2]

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

◆ boundaryCoeffs() [2/2]

FieldField<Field, Type>& boundaryCoeffs ( )
inline

Definition at line 474 of file fvMatrix.H.

◆ faceFluxCorrectionPtr()

faceFluxFieldPtrType& faceFluxCorrectionPtr ( )
inline

Definition at line 484 of file fvMatrix.H.

Referenced by gaussLaplacianScheme< Type, GType >::fvmLaplacian(), and relaxedNonOrthoGaussLaplacianScheme< Type, GType >::fvmLaplacian().

Here is the caller graph for this function:

◆ hasFaceFluxCorrection()

bool hasFaceFluxCorrection ( ) const
inlinenoexcept

Definition at line 490 of file fvMatrix.H.

◆ setValues() [1/3]

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

◆ setValues() [2/3]

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

Definition at line 1063 of file fvMatrix.C.

◆ setValues() [3/3]

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

Definition at line 1074 of file fvMatrix.C.

◆ setReference()

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

Definition at line 1085 of file fvMatrix.C.

Referenced by Foam::CorrectPhi(), simple::mainIter(), and adjointSimple::mainIter().

Here is the caller graph for this function:

◆ setReferences() [1/2]

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

◆ setReferences() [2/2]

void setReferences ( const labelUList cellLabels,
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 31 of file fvMatrixSolve.C.

◆ addFvMatrix()

void addFvMatrix ( fvMatrix< Type > &  matrix)

Definition at line 1146 of file fvMatrix.C.

◆ relax() [1/2]

void relax ( const scalar  alpha)

◆ relax() [2/2]

void relax ( )

Definition at line 1324 of file fvMatrix.C.

◆ boundaryManipulate()

void boundaryManipulate ( typename GeometricField< Type, fvPatchField, volMesh >::Boundary &  values)

Definition at line 1341 of file fvMatrix.C.

Referenced by adjointSimple::mainIter(), and adjointMeshMovementSolver::solve().

Here is the caller graph for this function:

◆ solver() [1/4]

Referenced by radiativeIntensityRay::correct().

Here is the caller graph for this function:

◆ solver() [2/4]

Foam::autoPtr< typename Foam::fvMatrix< Type >::fvSolver > solver ( )

Definition at line 322 of file fvMatrixSolve.C.

◆ solveSegregatedOrCoupled()

Foam::SolverPerformance< Type > solveSegregatedOrCoupled ( const dictionary solverControls)

◆ solveSegregated() [1/3]

Foam::SolverPerformance< Type > solveSegregated ( const dictionary solverControls)

Definition at line 105 of file fvMatrixSolve.C.

◆ solveCoupled()

Foam::SolverPerformance< Type > solveCoupled ( const dictionary solverControls)

Definition at line 245 of file fvMatrixSolve.C.

◆ solve() [1/2]

SolverPerformance<Type> solve ( const dictionary )

◆ solve() [2/2]

Foam::SolverPerformance< Type > solve ( )

Definition at line 336 of file fvMatrixSolve.C.

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

Here is the caller graph for this function:

◆ residual() [1/3]

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

Definition at line 343 of file fvMatrixSolve.C.

◆ D()

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

Definition at line 1354 of file fvMatrix.C.

◆ DD()

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

Definition at line 1363 of file fvMatrix.C.

◆ A()

◆ H() [1/3]

Definition at line 1416 of file fvMatrix.C.

Referenced by incompressiblePrimalSolver::correctBoundaryConditions(), simple::mainIter(), and adjointSimple::mainIter().

Here is the caller graph for this function:

◆ H1() [1/3]

Definition at line 1478 of file fvMatrix.C.

Referenced by simple::mainIter(), and adjointSimple::mainIter().

Here is the caller graph for this function:

◆ flux()

◆ solverDict()

const Foam::dictionary & solverDict ( ) const

◆ operator=() [1/2]

void operator= ( const fvMatrix< Type > &  )

◆ operator=() [2/2]

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

◆ negate()

void negate ( )

Definition at line 1703 of file fvMatrix.C.

◆ operator+=() [1/7]

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

◆ operator+=() [2/7]

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

◆ operator-=() [1/7]

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

◆ operator-=() [2/7]

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

◆ operator+=() [3/7]

void operator+= ( const DimensionedField< Type, volMesh > &  )

◆ operator+=() [4/7]

void operator+= ( const tmp< DimensionedField< Type, volMesh >> &  )

◆ operator+=() [5/7]

void operator+= ( const tmp< GeometricField< Type, fvPatchField, volMesh >> &  )

◆ operator-=() [3/7]

void operator-= ( const DimensionedField< Type, volMesh > &  )

◆ operator-=() [4/7]

void operator-= ( const tmp< DimensionedField< Type, volMesh >> &  )

◆ operator-=() [5/7]

void operator-= ( const tmp< GeometricField< Type, fvPatchField, volMesh >> &  )

◆ operator+=() [6/7]

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

◆ operator-=() [6/7]

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

◆ operator+=() [7/7]

void operator+= ( const zero )

Definition at line 1879 of file fvMatrix.C.

◆ operator-=() [7/7]

void operator-= ( const zero )

Definition at line 1887 of file fvMatrix.C.

◆ operator*=() [1/4]

void operator*= ( const volScalarField::Internal )

◆ operator*=() [2/4]

void operator*= ( const tmp< volScalarField::Internal > &  )

◆ operator*=() [3/4]

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

◆ operator*=() [4/4]

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

◆ setComponentReference() [2/3]

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

Definition at line 34 of file fvScalarMatrix.C.

◆ solver() [3/4]

Foam::autoPtr< Foam::fvMatrix< Foam::scalar >::fvSolver > solver ( const dictionary solverControls)

Definition at line 59 of file fvScalarMatrix.C.

◆ solveSegregated() [2/3]

Foam::solverPerformance solveSegregated ( const dictionary solverControls)

Definition at line 159 of file fvScalarMatrix.C.

◆ residual() [2/3]

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

Definition at line 321 of file fvScalarMatrix.C.

◆ H() [2/3]

Definition at line 350 of file fvScalarMatrix.C.

◆ H1() [2/3]

Definition at line 382 of file fvScalarMatrix.C.

◆ setComponentReference() [3/3]

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

◆ solver() [4/4]

autoPtr< fvMatrix< scalar >::fvSolver > solver ( const dictionary )

◆ solveSegregated() [3/3]

solverPerformance solveSegregated ( const dictionary )

◆ residual() [3/3]

tmp< scalarField > residual ( ) const

◆ H() [3/3]

tmp< volScalarField > H ( ) const

◆ H1() [3/3]

tmp< volScalarField > H1 ( ) const

Friends And Related Function Documentation

◆ fvSolver

friend class fvSolver
friend

Definition at line 174 of file fvMatrix.H.

◆ operator& [1/4]

tmp<GeometricField<Type, fvPatchField, volMesh> > operator& ( const fvMatrix< Type > &  ,
const DimensionedField< Type, volMesh > &   
)
friend

◆ operator& [2/4]

tmp<GeometricField<Type, fvPatchField, volMesh> > operator& ( const fvMatrix< Type > &  ,
const tmp< GeometricField< Type, fvPatchField, volMesh >> &   
)
friend

◆ operator& [3/4]

tmp<GeometricField<Type, fvPatchField, volMesh> > operator& ( const tmp< fvMatrix< Type >> &  ,
const DimensionedField< Type, volMesh > &   
)
friend

◆ operator& [4/4]

tmp<GeometricField<Type, fvPatchField, volMesh> > operator& ( const tmp< fvMatrix< Type >> &  ,
const tmp< GeometricField< Type, fvPatchField, volMesh >> &   
)
friend

◆ operator

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

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