fvMatrix< Type > Class Template 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< Type >:
[legend]
Collaboration diagram for fvMatrix< Type >:
[legend]

Classes

class  fvSolver
 

Public Types

typedef GeometricField< Type, fvPatchField, volMeshpsiFieldType
 The geometric field type for psi. More...
 
typedef GeometricField< Type, fvsPatchField, surfaceMeshfaceFluxFieldType
 Field type for face flux (for non-orthogonal correction) More...
 
typedef GeometricField< Type, fvsPatchField, surfaceMesh > * faceFluxFieldPtrType
 Declare return type of the faceFluxCorrectionPtr() function. More...
 

Public Member Functions

 ClassName ("fvMatrix")
 
 fvMatrix (const GeometricField< Type, fvPatchField, volMesh > &psi, const dimensionSet &ds)
 Construct given a field to solve for. More...
 
 fvMatrix (const fvMatrix< Type > &)
 Copy construct. More...
 
 fvMatrix (const tmp< fvMatrix< Type > > &)
 Copy/move construct from tmp<fvMatrix<Type>> More...
 
 fvMatrix (const GeometricField< Type, fvPatchField, volMesh > &psi, Istream &is)
 Deprecated(2022-05) - construct with dimensionSet instead. More...
 
tmp< fvMatrix< Type > > clone () const
 Construct and return a clone. More...
 
virtual ~fvMatrix ()
 Destructor. More...
 
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 ()
 Transfer lower, upper, diag and source to this fvMatrix. More...
 
void createOrUpdateLduPrimitiveAssembly ()
 Create or update ldu assembly. More...
 
lduPrimitiveMeshAssemblylduMeshPtr ()
 Access to lduPrimitiveMeshAssembly. More...
 
const lduPrimitiveMeshAssemblylduMeshPtr () const
 Const Access to lduPrimitiveMeshAssembly. More...
 
void manipulateMatrix (direction cmp)
 Manipulate matrix. More...
 
void setBounAndInterCoeffs ()
 Manipulate boundary/internal coeffs for coupling. More...
 
void setInterfaces (lduInterfaceFieldPtrsList &, PtrDynList< lduInterfaceField > &newInterfaces)
 Set interfaces. More...
 
void mapContributions (label fieldi, const FieldField< Field, Type > &fluxContrib, FieldField< Field, Type > &contrib, bool internal) const
 Add internal and boundary contribution to local patches. More...
 
const lduPrimitiveMeshAssemblylduMeshAssembly ()
 Return optional lduAdressing. More...
 
const GeometricField< Type, fvPatchField, volMesh > & psi (const label i=0) const
 Return psi. More...
 
GeometricField< Type, fvPatchField, volMesh > & psi (const label i=0)
 
void clear ()
 Clear multiple fvMatrices. More...
 
const dimensionSetdimensions () const noexcept
 
Field< Type > & source () noexcept
 
const Field< Type > & source () const noexcept
 
const FieldField< Field, Type > & internalCoeffs () const noexcept
 
FieldField< Field, Type > & internalCoeffs () noexcept
 
const FieldField< Field, Type > & boundaryCoeffs () const noexcept
 
FieldField< Field, Type > & boundaryCoeffs () noexcept
 
faceFluxFieldPtrTypefaceFluxCorrectionPtr ()
 Return pointer to face-flux non-orthogonal correction field. More...
 
bool hasFaceFluxCorrection () const noexcept
 True if face-flux non-orthogonal correction field exists. More...
 
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)
 Set reference level for solution. More...
 
void setReferences (const labelUList &cellLabels, const Type &value, const bool forceReference=false)
 Set reference level for solution. More...
 
void setReferences (const labelUList &cellLabels, const UList< Type > &values, const bool forceReference=false)
 Set reference level for solution. More...
 
void setComponentReference (const label patchi, const label facei, const direction cmpt, const scalar value)
 
void addFvMatrix (fvMatrix< Type > &matrix)
 Add fvMatrix. More...
 
void relax (const scalar alpha)
 Relax matrix (for steady-state solution). More...
 
void relax ()
 Relax matrix (for steady-state solution). More...
 
void boundaryManipulate (typename GeometricField< Type, fvPatchField, volMesh >::Boundary &values)
 Manipulate based on a boundary field. More...
 
autoPtr< fvSolversolver (const dictionary &)
 Construct and return the solver. More...
 
autoPtr< fvSolversolver ()
 Construct and return the solver. More...
 
SolverPerformance< Type > solveSegregatedOrCoupled (const dictionary &)
 Solve segregated or coupled returning the solution statistics. More...
 
SolverPerformance< Type > solveSegregated (const dictionary &)
 Solve segregated returning the solution statistics. More...
 
SolverPerformance< Type > solveCoupled (const dictionary &)
 Solve coupled returning the solution statistics. More...
 
SolverPerformance< Type > solve (const dictionary &)
 Solve returning the solution statistics. More...
 
SolverPerformance< Type > solve ()
 Solve returning the solution statistics. More...
 
tmp< Field< Type > > residual () const
 Return the matrix residual. More...
 
tmp< scalarFieldD () const
 Return the matrix scalar diagonal. More...
 
tmp< Field< Type > > DD () const
 Return the matrix Type diagonal. More...
 
tmp< volScalarFieldA () const
 Return the central coefficient. More...
 
tmp< GeometricField< Type, fvPatchField, volMesh > > H () const
 Return the H operation source. More...
 
tmp< volScalarFieldH1 () const
 Return H(1) More...
 
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > flux () const
 Return the face-flux field from the matrix. More...
 
const dictionarysolverDict () const
 Return the solver dictionary taking into account finalIteration. More...
 
void operator= (const fvMatrix< Type > &)
 
void operator= (const tmp< fvMatrix< Type > > &)
 
void negate ()
 Inplace negate. More...
 
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 Foam::zero)
 
void operator-= (const Foam::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 >::fvSolver > solver (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 >::fvSolver > solver (const dictionary &)
 
solverPerformance solveSegregated (const dictionary &)
 
tmp< scalarFieldresidual () const
 
tmp< volScalarFieldH () const
 
tmp< volScalarFieldH1 () const
 
- Public Member Functions inherited from refCount
constexpr refCount () noexcept
 Default construct, initializing count to 0. More...
 
int count () const noexcept
 Return the current reference count. More...
 
bool unique () const noexcept
 Return true if the reference count is zero. More...
 
void operator++ () noexcept
 Increment the reference count. More...
 
void operator++ (int) noexcept
 Increment the reference count. More...
 
void operator-- () noexcept
 Decrement the reference count. More...
 
void operator-- (int) noexcept
 Decrement the reference count. More...
 
- Public Member Functions inherited from lduMatrix
 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 &)
 
 ~lduMatrix ()
 Destructor. More...
 
const lduMeshmesh () const
 Return the LDU mesh from which the addressing is obtained. More...
 
void setLduMesh (const lduMesh &m)
 Set the LDU mesh containing 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 (solveScalarField &, const tmp< solveScalarField > &, const FieldField< Field, scalar > &, const lduInterfaceFieldPtrsList &, const direction cmpt) const
 Matrix multiplication with updated interfaces. More...
 
void Tmul (solveScalarField &, const tmp< solveScalarField > &, const FieldField< Field, scalar > &, const lduInterfaceFieldPtrsList &, const direction cmpt) const
 Matrix transpose multiplication with updated interfaces. More...
 
void sumA (solveScalarField &, const FieldField< Field, scalar > &, const lduInterfaceFieldPtrsList &) const
 Sum the coefficients on each row of the matrix. More...
 
void residual (solveScalarField &rA, const solveScalarField &psi, const scalarField &source, const FieldField< Field, scalar > &interfaceBouCoeffs, const lduInterfaceFieldPtrsList &interfaces, const direction cmpt) const
 
tmp< solveScalarFieldresidual (const solveScalarField &psi, const scalarField &source, const FieldField< Field, scalar > &interfaceBouCoeffs, const lduInterfaceFieldPtrsList &interfaces, const direction cmpt) const
 
void initMatrixInterfaces (const bool add, const FieldField< Field, scalar > &interfaceCoeffs, const lduInterfaceFieldPtrsList &interfaces, const solveScalarField &psiif, solveScalarField &result, const direction cmpt) const
 
void updateMatrixInterfaces (const bool add, const FieldField< Field, scalar > &interfaceCoeffs, const lduInterfaceFieldPtrsList &interfaces, const solveScalarField &psiif, solveScalarField &result, const direction cmpt, const label startRequest) const
 Update interfaced interfaces for matrix operations. More...
 
void setResidualField (const scalarField &residual, const word &fieldName, const bool initial) const
 
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
 

Protected Member Functions

template<class Type2 >
void addToInternalField (const labelUList &addr, const Field< Type2 > &pf, Field< Type2 > &intf) const
 Add patch contribution to internal field. More...
 
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
 Subtract patch contribution from internal field. More...
 
template<class Type2 >
void subtractFromInternalField (const labelUList &addr, const tmp< Field< Type2 > > &tpf, Field< Type2 > &intf) const
 
bool checkImplicit (const label fieldi=0)
 Name the implicit assembly addressing. More...
 
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)
 Set solution in given cells to the specified values. More...
 

Friends

class fvSolver
 Declare friendship with the fvSolver class. More...
 
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

template<class Type>
class Foam::fvMatrix< Type >

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 117 of file fvMatrix.H.

Member Typedef Documentation

◆ psiFieldType

The geometric field type for psi.

Definition at line 129 of file fvMatrix.H.

◆ faceFluxFieldType

Field type for face flux (for non-orthogonal correction)

Definition at line 134 of file fvMatrix.H.

◆ faceFluxFieldPtrType

Declare return type of the faceFluxCorrectionPtr() function.

Definition at line 498 of file fvMatrix.H.

Constructor & Destructor Documentation

◆ fvMatrix() [1/4]

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

Construct given a field to solve for.

Definition at line 343 of file fvMatrix.C.

References faMesh::boundary(), fvMatrix< Type >::checkImplicit(), DebugInFunction, Foam::endl(), forAll, DimensionedField< Type, GeoMesh >::mesh(), IOobject::name(), psi, UPtrList< T >::size(), and Foam::Zero.

Here is the call graph for this function:

◆ fvMatrix() [2/4]

fvMatrix ( const fvMatrix< Type > &  fvm)

Copy construct.

Definition at line 388 of file fvMatrix.C.

References DebugInFunction, Foam::endl(), and IOobject::name().

Here is the call graph for this function:

◆ fvMatrix() [3/4]

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

Copy/move construct from tmp<fvMatrix<Type>>

Definition at line 416 of file fvMatrix.C.

References DebugInFunction, Foam::endl(), and IOobject::name().

Here is the call graph for this function:

◆ fvMatrix() [4/4]

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

Deprecated(2022-05) - construct with dimensionSet instead.

Deprecated:
(2022-05) - construct with dimensionSet instead

Definition at line 313 of file fvMatrix.H.

◆ ~fvMatrix()

~fvMatrix
virtual

Destructor.

Definition at line 456 of file fvMatrix.C.

References DebugInFunction, Foam::deleteDemandDrivenData(), and Foam::endl().

Here is the call graph for this function:

Member Function Documentation

◆ addToInternalField() [1/2]

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

Add patch contribution to internal field.

Definition at line 48 of file fvMatrix.C.

References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, forAll, and UList< T >::size().

Here is the call graph for this function:

◆ addToInternalField() [2/2]

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

Definition at line 72 of file fvMatrix.C.

◆ subtractFromInternalField() [1/2]

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

Subtract patch contribution from internal field.

Definition at line 86 of file fvMatrix.C.

References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, forAll, and UList< T >::size().

Here is the call graph for this function:

◆ subtractFromInternalField() [2/2]

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

Definition at line 110 of file fvMatrix.C.

◆ checkImplicit()

bool checkImplicit ( const label  fieldi = 0)
protected

Name the implicit assembly addressing.

Returns
true if assembly is used

Definition at line 307 of file fvMatrix.C.

References Foam::endl(), forAll, Foam::name(), Foam::Pout, and psi.

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addBoundaryDiag()

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

Definition at line 123 of file fvMatrix.C.

References Foam::component(), Foam::diag(), forAll, and psi.

Referenced by fvMatrix< Type >::residual(), and fvMatrix< Type >::solveSegregated().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addCmptAvBoundaryDiag()

void addCmptAvBoundaryDiag ( scalarField diag) const
protected

Definition at line 152 of file fvMatrix.C.

References Foam::cmptAv(), Foam::diag(), forAll, and psi.

Here is the call graph for this function:

◆ addBoundarySource()

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

Definition at line 176 of file fvMatrix.C.

References Foam::cmptMultiply(), fvPatchField< Type >::coupled(), forAll, fvPatchField< Type >::patchNeighbourField(), and psi.

Referenced by fvMatrix< Type >::H(), fvMatrix< Type >::residual(), and fvMatrix< Type >::solveSegregated().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setValuesFromList()

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

Set solution in given cells to the specified values.

Definition at line 226 of file fvMatrix.C.

References cells, Foam::diag(), forAll, mesh, primitiveFieldRef(), and psi.

Here is the call graph for this function:

◆ ClassName()

ClassName ( "fvMatrix< Type >"  )

◆ clone()

tmp< fvMatrix< Type > > clone ( ) const
inline

Construct and return a clone.

Definition at line 323 of file fvMatrix.H.

References Foam::New().

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nMatrices()

label nMatrices ( ) const
inline

Definition at line 339 of file fvMatrix.H.

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

Here is the caller graph for this function:

◆ matrix() [1/2]

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

Definition at line 344 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 349 of file fvMatrix.H.

◆ globalPatchID()

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

Definition at line 354 of file fvMatrix.H.

References fvMatrix< Type >::lduMeshPtr(), and lduPrimitiveMeshAssembly::patchMap().

Here is the call graph for this function:

◆ transferFvMatrixCoeffs()

void transferFvMatrixCoeffs

Transfer lower, upper, diag and source to this fvMatrix.

Definition at line 813 of file fvMatrix.C.

References Foam::diag(), Foam::faceMap(), forAll, List< T >::setSize(), UList< T >::size(), and Foam::Zero.

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createOrUpdateLduPrimitiveAssembly()

void createOrUpdateLduPrimitiveAssembly

Create or update ldu assembly.

Definition at line 906 of file fvMatrix.C.

References lduAddressing::clearOut(), Foam::endl(), Foam::Info, io(), lduPrimitiveMesh::lduAddr(), DimensionedField< Type, GeoMesh >::mesh(), IOobject::NO_READ, IOobject::NO_WRITE, psi, UPtrList< T >::set(), regIOobject::store(), and lduPrimitiveMeshAssembly::update().

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lduMeshPtr() [1/2]

Access to lduPrimitiveMeshAssembly.

Definition at line 880 of file fvMatrix.C.

References lduPrimitiveMesh::mesh(), and lduMesh::thisDb().

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lduMeshPtr() [2/2]

const Foam::lduPrimitiveMeshAssembly * lduMeshPtr

Const Access to lduPrimitiveMeshAssembly.

Definition at line 893 of file fvMatrix.C.

◆ manipulateMatrix()

void manipulateMatrix ( direction  cmp)

Manipulate matrix.

Definition at line 790 of file fvMatrix.C.

References GeometricField< Type, PatchField, GeoMesh >::boundaryFieldRef(), forAll, and psi.

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setBounAndInterCoeffs()

void setBounAndInterCoeffs

Manipulate boundary/internal coeffs for coupling.

Definition at line 660 of file fvMatrix.C.

References boundary, GeometricField< Type, PatchField, GeoMesh >::boundaryField(), forAll, DimensionedField< Type, GeoMesh >::mesh(), psi, List< T >::set(), and Foam::Zero.

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setInterfaces()

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

Set interfaces.

Definition at line 469 of file fvMatrix.C.

References PtrDynList< T, SizeMin >::append(), GeometricField< Type, PatchField, GeoMesh >::boundaryField(), forAll, UPtrList< T >::last(), psi, UPtrList< T >::set(), and UPtrList< T >::setSize().

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mapContributions()

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

Add internal and boundary contribution to local patches.

Definition at line 547 of file fvMatrix.C.

References lduPrimitiveMeshAssembly::cellBoundMap(), cellId, Foam::cmptMultiply(), coupled(), faceId(), lduPrimitiveMeshAssembly::facePatchFaceMap(), forAll, polyPatch::masterImplicit(), DimensionedField< Type, GeoMesh >::mesh(), polyPatch::neighbPolyPatchID(), lduPrimitiveMeshAssembly::patchLocalToGlobalMap(), lduPrimitiveMeshAssembly::patchMap(), psi, List< T >::setSize(), and PtrList< T >::setSize().

Here is the call graph for this function:

◆ lduMeshAssembly()

const lduPrimitiveMeshAssembly & lduMeshAssembly ( )
inline

Return optional lduAdressing.

Definition at line 405 of file fvMatrix.H.

References fvMatrix< Type >::lduMeshPtr().

Referenced by mixedEnergyFvPatchScalarField::manipulateMatrix(), cyclicFvPatchField< Type >::manipulateMatrix(), cyclicACMIFvPatchField< Type >::manipulateMatrix(), and cyclicAMIFvPatchField< Type >::manipulateMatrix().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ psi() [1/2]

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

Return psi.

Definition at line 411 of file fvMatrix.H.

References fvMatrix< Type >::matrix(), and psi.

Referenced by MRFZone::addCoriolis(), velocityDampingConstraint::addDamping(), dynamicOversetFvMesh::addInterpolation(), solver::addOptimisationTypeSource(), PhaseLimitStabilization< Type >::addSup(), jouleHeatingSource::addSup(), patchCellsSource::addSup(), radiation::addSup(), SemiImplicitSource< Type >::addSup(), multiphaseStabilizedTurbulence::addSup(), interRegionHeatTransferModel::addSup(), multiphaseMangrovesTurbulenceModel::addSup(), atmCoriolisUSource::addSup(), atmPlantCanopyUSource::addSup(), acousticDampingSource::addSup(), explicitPorositySource::addSup(), radialActuationDiskSource::addSup(), rotorDiskSource::addSup(), solidificationMeltingSource::addSup(), interRegionExplicitPorositySource::addSup(), multiphaseMangrovesSource::addSup(), Foam::checkMethod(), optionList::constrain(), cyclicFvPatchField< Type >::manipulateMatrix(), cyclicACMIFvPatchField< Type >::manipulateMatrix(), cyclicAMIFvPatchField< Type >::manipulateMatrix(), MomentumTransferPhaseSystem< BasePhaseSystem >::momentumTransfer(), dynamicOversetFvMesh::normalisation(), dynamicOversetFvMesh::solve(), and dynamicOversetFvMesh::write().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ psi() [2/2]

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

Definition at line 423 of file fvMatrix.H.

References fvMatrix< Type >::matrix(), and psi.

Here is the call graph for this function:

◆ clear()

void clear ( )
inline

Clear multiple fvMatrices.

Definition at line 446 of file fvMatrix.H.

References PtrList< T >::clear().

Here is the call graph for this function:

◆ dimensions()

const dimensionSet & dimensions ( ) const
inlinenoexcept

◆ source() [1/2]

◆ source() [2/2]

const Field< Type > & source ( ) const
inlinenoexcept

Definition at line 463 of file fvMatrix.H.

◆ internalCoeffs() [1/2]

◆ internalCoeffs() [2/2]

FieldField< Field, Type > & internalCoeffs ( )
inlinenoexcept

fvBoundary scalar field containing pseudo-matrix coeffs for internal cells

Definition at line 477 of file fvMatrix.H.

◆ boundaryCoeffs() [1/2]

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

◆ boundaryCoeffs() [2/2]

FieldField< Field, Type > & boundaryCoeffs ( )
inlinenoexcept

fvBoundary scalar field containing pseudo-matrix coeffs for boundary cells

Definition at line 491 of file fvMatrix.H.

◆ faceFluxCorrectionPtr()

faceFluxFieldPtrType & faceFluxCorrectionPtr ( )
inline

Return pointer to face-flux non-orthogonal correction field.

Definition at line 501 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

True if face-flux non-orthogonal correction field exists.

Definition at line 507 of file fvMatrix.H.

References bool.

◆ setValues() [1/3]

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

Set solution in given cells to the specified value and eliminate the corresponding equations from the matrix.

Definition at line 968 of file fvMatrix.C.

Referenced by fixedTemperatureConstraint::constrain(), FixedValueConstraint< Type >::constrain(), epsilonWallFunctionFvPatchScalarField::manipulateMatrix(), omegaWallFunctionFvPatchScalarField::manipulateMatrix(), and fixedInternalValueFvPatchField< Type >::manipulateMatrix().

Here is the caller graph for this function:

◆ setValues() [2/3]

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

Set solution in given cells to the specified values and eliminate the corresponding equations from the matrix.

Definition at line 979 of file fvMatrix.C.

◆ setValues() [3/3]

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

Set solution in given cells to the specified values and eliminate the corresponding equations from the matrix.

Definition at line 990 of file fvMatrix.C.

◆ setReference()

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

Set reference level for solution.

Definition at line 1001 of file fvMatrix.C.

References Foam::diag().

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setReferences() [1/2]

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

Set reference level for solution.

Definition at line 1017 of file fvMatrix.C.

References cellId, Foam::diag(), and forAll.

Here is the call graph for this function:

◆ setReferences() [2/2]

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

Set reference level for solution.

Definition at line 1040 of file fvMatrix.C.

References cellId, Foam::diag(), and forAll.

Here is the call graph for this function:

◆ setComponentReference() [1/3]

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

Set reference level for a component of the solution on a given patch face

Definition at line 37 of file fvMatrixSolve.C.

References Foam::diag().

Here is the call graph for this function:

◆ addFvMatrix()

void addFvMatrix ( fvMatrix< Type > &  matrix)

Add fvMatrix.

Definition at line 1063 of file fvMatrix.C.

References Foam::abort(), fvMatrix< Type >::clone(), fvMatrix< Type >::dimensions(), Foam::endl(), Foam::FatalError, and FatalErrorInFunction.

Here is the call graph for this function:

◆ relax() [1/2]

void relax ( const scalar  alpha)

Relax matrix (for steady-state solution).

alpha = 1 : diagonally equal alpha < 1 : diagonally dominant alpha = 0 : do nothing Note: Requires positive diagonal.

Definition at line 1092 of file fvMatrix.C.

References alpha, Foam::cmptMag(), Foam::cmptMax(), Foam::cmptMin(), Foam::component(), fvPatchField< Type >::coupled(), D, DebugInFunction, Foam::diag(), Foam::endl(), forAll, InfoInFunction, Foam::mag(), Foam::max(), UPstream::msgType(), Foam::nl, Foam::reduce(), Foam::returnReduce(), UList< T >::size(), and Foam::Zero.

Referenced by jouleHeatingSource::addSup(), hydrostaticPressure::calculateAndWrite(), kineticTheoryModel::correct(), IATE::correct(), radiativeIntensityRay::correct(), dynamicLagrangian< BasicTurbulenceModel >::correct(), thixotropicViscosity::correct(), advectionDiffusion::correct(), incompressiblePrimalSolver::correctBoundaryConditions(), waxSolventEvaporation::correctModel(), thermo::evolveRegion(), age::execute(), electricPotential::execute(), energyTransport::execute(), scalarTransport::execute(), adjointSimple::mainIter(), simple::mainIter(), adjointEikonalSolver::solve(), populationBalanceModel::solve(), twoPhaseSystem::solve(), thermalShell::solveEnergy(), reactingOneDim::solveEnergy(), thermalBaffle::solveEnergy(), and kinematicSingleLayer::solveMomentum().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ relax() [2/2]

void relax

Relax matrix (for steady-state solution).

alpha is read from controlDict

Definition at line 1240 of file fvMatrix.C.

References Foam::name(), and relax().

Here is the call graph for this function:

◆ boundaryManipulate()

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

Manipulate based on a boundary field.

Definition at line 1256 of file fvMatrix.C.

References forAll.

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

Here is the caller graph for this function:

◆ solver() [1/4]

autoPtr< fvSolver > solver ( const dictionary )

Construct and return the solver.

Use the given solver controls

Referenced by radiativeIntensityRay::correct().

Here is the caller graph for this function:

◆ solver() [2/4]

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

Construct and return the solver.

Solver controls read from fvSolution

Definition at line 329 of file fvMatrixSolve.C.

◆ solveSegregatedOrCoupled()

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

Solve segregated or coupled returning the solution statistics.

Use the given solver controls

Definition at line 61 of file fvMatrixSolve.C.

References addProfiling, Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, dictionary::getOrDefault(), Foam::Info, messageStream::masterStream(), mesh, regionName, and solve().

Referenced by displacementComponentLaplacianFvMotionSolver::solve(), velocityComponentLaplacianFvMotionSolver::solve(), displacementLaplacianFvMotionSolver::solve(), displacementSBRStressFvMotionSolver::solve(), solidBodyDisplacementLaplacianFvMotionSolver::solve(), surfaceAlignedSBRStressFvMotionSolver::solve(), velocityLaplacianFvMotionSolver::solve(), and fvMesh::solve().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ solveSegregated() [1/3]

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

Solve segregated returning the solution statistics.

Use the given solver controls

Definition at line 111 of file fvMatrixSolve.C.

References Field< Type >::component(), Foam::diag(), Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, dictionary::getOrDefault(), Foam::Info, messageStream::masterStream(), mesh, pTraits< bool >::nComponents, SolverPerformance< Type >::print(), psi, refPtr< T >::ref(), GeometricField< Type, PatchField, GeoMesh >::replace(), SolverPerformance< Type >::solverName(), and ensightPTraits< Type >::typeName.

Here is the call graph for this function:

◆ solveCoupled()

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

Solve coupled returning the solution statistics.

Use the given solver controls

Definition at line 251 of file fvMatrixSolve.C.

References GeometricField< Type, PatchField, GeoMesh >::component(), Foam::diag(), Foam::endl(), dictionary::getOrDefault(), Foam::Info, messageStream::masterStream(), mesh, SolverPerformance< Type >::print(), and psi.

Here is the call graph for this function:

◆ solve() [1/2]

◆ solve() [2/2]

Foam::SolverPerformance< Type > solve

Solve returning the solution statistics.

Solver controls read from fvSolution

Definition at line 343 of file fvMatrixSolve.C.

References fvMatrix< Type >::solve(), and fvMatrix< Type >::solverDict().

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ residual() [1/3]

◆ D()

Return the matrix scalar diagonal.

Definition at line 1270 of file fvMatrix.C.

References Foam::diag(), and tmp< T >::ref().

Here is the call graph for this function:

◆ DD()

Foam::tmp< Foam::Field< Type > > DD

Return the matrix Type diagonal.

Definition at line 1279 of file fvMatrix.C.

References fvPatchField< Type >::coupled(), Foam::diag(), forAll, tmp< T >::ref(), and UList< T >::size().

Here is the call graph for this function:

◆ A()

Return the central coefficient.

Definition at line 1303 of file fvMatrix.C.

References D, Foam::dimVol, IOobject::NO_READ, IOobject::NO_WRITE, and tmp< T >::ref().

Referenced by directionalPressureGradientExplicitSource::constrain(), meanVelocityForce::constrain(), incompressiblePrimalSolver::correctBoundaryConditions(), adjointSimple::mainIter(), simple::mainIter(), and kinematicSingleLayer::solveThickness().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ H() [1/3]

Return the H operation source.

Definition at line 1332 of file fvMatrix.C.

References GeometricField< Type, PatchField, GeoMesh >::correctBoundaryConditions(), DimensionedField< Type, GeoMesh >::dimensions(), Foam::dimVol, faMatrix< Type >::H(), Field< Type >::negate(), IOobject::NO_READ, IOobject::NO_WRITE, GeometricField< Type, PatchField, GeoMesh >::primitiveFieldRef(), tmp< T >::ref(), GeometricField< Type, PatchField, GeoMesh >::replace(), Field< Type >::replace(), and Foam::Zero.

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ H1() [1/3]

Return H(1)

Definition at line 1394 of file fvMatrix.C.

References Foam::component(), GeometricField< Type, PatchField, GeoMesh >::correctBoundaryConditions(), fvPatchField< Type >::coupled(), Foam::dimVol, forAll, lduMatrix::H1(), IOobject::NO_READ, IOobject::NO_WRITE, GeometricField< Type, PatchField, GeoMesh >::primitiveFieldRef(), tmp< T >::ref(), and UList< T >::size().

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ flux()

◆ solverDict()

const Foam::dictionary & solverDict

Return the solver dictionary taking into account finalIteration.

Definition at line 1558 of file fvMatrix.C.

Referenced by fvMatrix< Type >::solve(), displacementComponentLaplacianFvMotionSolver::solve(), velocityComponentLaplacianFvMotionSolver::solve(), displacementLaplacianFvMotionSolver::solve(), displacementSBRStressFvMotionSolver::solve(), solidBodyDisplacementLaplacianFvMotionSolver::solve(), surfaceAlignedSBRStressFvMotionSolver::solve(), and velocityLaplacianFvMotionSolver::solve().

Here is the caller graph for this function:

◆ operator=() [1/2]

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

Definition at line 1574 of file fvMatrix.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and lduMatrix::operator=().

Here is the call graph for this function:

◆ operator=() [2/2]

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

Definition at line 1611 of file fvMatrix.C.

◆ negate()

void negate

Inplace negate.

Definition at line 1619 of file fvMatrix.C.

References lduMatrix::negate().

Here is the call graph for this function:

◆ operator+=() [1/7]

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

Definition at line 1634 of file fvMatrix.C.

References Foam::checkMethod(), and lduMatrix::operator+=().

Here is the call graph for this function:

◆ operator+=() [2/7]

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

Definition at line 1664 of file fvMatrix.C.

◆ operator-=() [1/7]

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

Definition at line 1672 of file fvMatrix.C.

References Foam::checkMethod(), and lduMatrix::operator-=().

Here is the call graph for this function:

◆ operator-=() [2/7]

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

Definition at line 1700 of file fvMatrix.C.

◆ operator+=() [3/7]

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

Definition at line 1708 of file fvMatrix.C.

References Foam::checkMethod().

Here is the call graph for this function:

◆ operator+=() [4/7]

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

Definition at line 1719 of file fvMatrix.C.

◆ operator+=() [5/7]

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

Definition at line 1730 of file fvMatrix.C.

◆ operator-=() [3/7]

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

Definition at line 1741 of file fvMatrix.C.

References Foam::checkMethod().

Here is the call graph for this function:

◆ operator-=() [4/7]

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

Definition at line 1752 of file fvMatrix.C.

◆ operator-=() [5/7]

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

Definition at line 1763 of file fvMatrix.C.

◆ operator+=() [6/7]

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

Definition at line 1774 of file fvMatrix.C.

References DimensionedField< Type, GeoMesh >::mesh(), and psi.

Here is the call graph for this function:

◆ operator-=() [6/7]

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

Definition at line 1784 of file fvMatrix.C.

References DimensionedField< Type, GeoMesh >::mesh(), and psi.

Here is the call graph for this function:

◆ operator+=() [7/7]

void operator+= ( const Foam::zero  )

Definition at line 1794 of file fvMatrix.C.

◆ operator-=() [7/7]

void operator-= ( const Foam::zero  )

Definition at line 1799 of file fvMatrix.C.

◆ operator*=() [1/4]

void operator*= ( const volScalarField::Internal dsf)

Definition at line 1804 of file fvMatrix.C.

References Foam::abort(), fvMatrix< Type >::dimensions(), Foam::FatalError, FatalErrorInFunction, forAll, and lduMatrix::operator*=().

Here is the call graph for this function:

◆ operator*=() [2/4]

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

Definition at line 1834 of file fvMatrix.C.

◆ operator*=() [3/4]

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

Definition at line 1845 of file fvMatrix.C.

◆ operator*=() [4/4]

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

Definition at line 1856 of file fvMatrix.C.

References fvMatrix< Type >::dimensions(), and lduMatrix::operator*=().

Here is the call graph for this function:

◆ setComponentReference() [2/3]

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

Definition at line 40 of file fvScalarMatrix.C.

References Foam::diag().

Here is the call graph for this function:

◆ solver() [3/4]

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

Definition at line 65 of file fvScalarMatrix.C.

References addProfiling, Foam::diag(), Foam::endl(), Foam::Info, messageStream::masterStream(), mesh, regionName, and solve().

Here is the call graph for this function:

◆ solveSegregated() [2/3]

◆ residual() [2/3]

◆ H() [2/3]

◆ H1() [2/3]

◆ 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

Declare friendship with the fvSolver class.

Definition at line 181 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: