OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

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 >:
Collaboration diagram for fvMatrix< Type >:

List of all members.


Classes

class  fvSolver
 Solver class returned by the solver function. More...

Public Types

typedef GeometricField< Type,
fvsPatchField, surfaceMesh > * 
surfaceTypeFieldPtr
 Declare return type of the faceFluxCorrectionPtr() function.

Public Member Functions

template<class Type2 >
void addToInternalField (const unallocLabelList &addr, const Field< Type2 > &pf, Field< Type2 > &intf) const
 Add patch contribution to internal field.
template<class Type2 >
void addToInternalField (const unallocLabelList &addr, const tmp< Field< Type2 > > &tpf, Field< Type2 > &intf) const
template<class Type2 >
void subtractFromInternalField (const unallocLabelList &addr, const Field< Type2 > &pf, Field< Type2 > &intf) const
 Subtract patch contribution from internal field.
template<class Type2 >
void subtractFromInternalField (const unallocLabelList &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
 ClassName ("fvMatrix")
 fvMatrix (GeometricField< Type, fvPatchField, volMesh > &, const dimensionSet &)
 Construct given a field to solve for.
 fvMatrix (const fvMatrix< Type > &)
 Construct as copy.
 fvMatrix (GeometricField< Type, fvPatchField, volMesh > &, Istream &)
 Construct as copy of tmp<fvMatrix<Type> > deleting argument.
virtual ~fvMatrix ()
const GeometricField< Type,
fvPatchField, volMesh > & 
psi () const
GeometricField< Type,
fvPatchField, volMesh > & 
psi ()
const dimensionSet & dimensions () const
Field< Type > & source ()
const Field< Type > & source () const
FieldField< Field, Type > & internalCoeffs ()
 fvBoundary scalar field containing pseudo-matrix coeffs
FieldField< Field, Type > & boundaryCoeffs ()
 fvBoundary scalar field containing pseudo-matrix coeffs
surfaceTypeFieldPtr & faceFluxCorrectionPtr ()
 Return pointer to face-flux non-orthogonal correction field.
void setValues (const labelList &cells, const Field< Type > &values)
 Set solution in given cells and eliminate corresponding.
void setReference (const label celli, const Type &value, const bool forceReference=false)
 Set reference level for solution.
void setComponentReference (const label patchi, const label facei, const direction cmpt, const scalar value)
 Set reference level for a component of the solution.
void relax (const scalar alpha)
 Relax matrix (for steady-state solution).
void relax ()
 Relax matrix (for steady-state solution).
void boundaryManipulate (typename GeometricField< Type, fvPatchField, volMesh >::GeometricBoundaryField &values)
 Manipulate based on a boundary field.
autoPtr< fvSolver > solver (const dictionary &)
 Construct and return the solver.
autoPtr< fvSolver > solver ()
 Construct and return the solver.
lduMatrix::solverPerformance solve (const dictionary &)
 Solve returning the solution statistics.
lduMatrix::solverPerformance solve ()
 Solve returning the solution statistics.
tmp< Field< Type > > residual () const
 Return the matrix residual.
tmp< scalarField > D () const
 Return the matrix scalar diagonal.
tmp< Field< Type > > DD () const
 Return the matrix Type diagonal.
tmp< volScalarField > A () const
 Return the central coefficient.
tmp< GeometricField< Type,
fvPatchField, volMesh > > 
H () const
 Return the H operation source.
tmp< volScalarField > H1 () const
 Return H(1).
tmp< GeometricField< Type,
fvsPatchField, surfaceMesh > > 
flux () const
 Return the face-flux field from the matrix.
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 zeroField &)
void operator-= (const zeroField &)
void operator*= (const DimensionedField< scalar, volMesh > &)
void operator*= (const tmp< DimensionedField< scalar, volMesh > > &)
void operator*= (const tmp< volScalarField > &)
void operator*= (const dimensioned< scalar > &)
template<>
void setComponentReference (const label patchi, const label facei, const direction, const scalar value)
template<>
Foam::autoPtr< Foam::fvMatrix
< Foam::scalar >::fvSolver > 
solver (const dictionary &solverControls)
template<>
Foam::lduMatrix::solverPerformance solve (const dictionary &solverControls)
template<>
Foam::tmp< Foam::scalarField > residual () const
template<>
Foam::tmp< Foam::volScalarField > H () const
template<>
Foam::tmp< Foam::volScalarField > H1 () const
template<>
void setComponentReference (const label patchi, const label facei, const direction, const scalar value)
template<>
autoPtr< fvMatrix< scalar >
::fvSolver > 
solver (const dictionary &)
template<>
lduMatrix::solverPerformance solve (const dictionary &)
template<>
tmp< scalarField > residual () const
template<>
tmp< volScalarField > H () const
template<>
tmp< volScalarField > H1 () const

Public Attributes

GeometricField< Type,
fvPatchField, volMesh > & 
psi_
dimensionSet dimensions_
 Dimension set.
Field< Type > source_
 Source term.
FieldField< Field, Type > internalCoeffs_
 Boundary scalar field containing pseudo-matrix coeffs.
FieldField< Field, Type > boundaryCoeffs_
 Boundary scalar field containing pseudo-matrix coeffs.
GeometricField< Type,
fvsPatchField, surfaceMesh > * 
faceFluxCorrectionPtr_
 Face flux field for non-orthogonal correction.

Friends

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 > > &)
Ostream & operator (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.

Finite-Volume matrix.

Source files

Definition at line 105 of file fvMatrix.H.


Member Typedef Documentation

Declare return type of the faceFluxCorrectionPtr() function.

Definition at line 315 of file fvMatrix.H.


Constructor & Destructor Documentation

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

Construct given a field to solve for.

Definition at line 176 of file fvMatrix.C.

fvMatrix ( const fvMatrix< Type > &  fvm  )  [inline]

Construct as copy.

Definition at line 226 of file fvMatrix.C.

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

Construct as copy of tmp<fvMatrix<Type> > deleting argument.

Construct from Istream given field to solve for

Definition at line 315 of file fvMatrix.C.

~fvMatrix (  )  [inline, virtual]

Definition at line 364 of file fvMatrix.C.


Member Function Documentation

void addToInternalField ( const unallocLabelList &  addr,
const Field< Type2 > &  pf,
Field< Type2 > &  intf 
) const [inline]

Add patch contribution to internal field.

Definition at line 29 of file fvMatrix.C.

References Foam::abort(), Foam::FatalError, FatalErrorIn, forAll, UList< T >::size(), and List< Type >::size().

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

Here is the call graph for this function:

Here is the caller graph for this function:

void addToInternalField ( const unallocLabelList &  addr,
const tmp< Field< Type2 > > &  tpf,
Field< Type2 > &  intf 
) const [inline]

Definition at line 55 of file fvMatrix.C.

void subtractFromInternalField ( const unallocLabelList &  addr,
const Field< Type2 > &  pf,
Field< Type2 > &  intf 
) const [inline]

Subtract patch contribution from internal field.

Definition at line 69 of file fvMatrix.C.

References fvMatrix< Type >::addToInternalField().

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

Here is the call graph for this function:

Here is the caller graph for this function:

void subtractFromInternalField ( const unallocLabelList &  addr,
const tmp< Field< Type2 > > &  tpf,
Field< Type2 > &  intf 
) const [inline]

Definition at line 95 of file fvMatrix.C.

void addBoundaryDiag ( scalarField &  diag,
const direction  cmpt 
) const [inline]

Definition at line 108 of file fvMatrix.C.

References fvMatrix< Type >::subtractFromInternalField().

Here is the call graph for this function:

void addCmptAvBoundaryDiag ( scalarField &  diag  )  const [inline]

Definition at line 126 of file fvMatrix.C.

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

Here is the caller graph for this function:

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

Definition at line 142 of file fvMatrix.C.

ClassName ( "fvMatrix< Type >"   ) 

const GeometricField<Type, fvPatchField, volMesh>& psi (  )  const [inline]

Definition at line 269 of file fvMatrix.H.

References fvMatrix< Type >::psi_.

GeometricField<Type, fvPatchField, volMesh>& psi (  )  [inline]

Definition at line 274 of file fvMatrix.H.

References fvMatrix< Type >::dimensions_.

const dimensionSet& dimensions (  )  const [inline]

Definition at line 279 of file fvMatrix.H.

References fvMatrix< Type >::source_.

Field<Type>& source (  )  [inline]

Definition at line 284 of file fvMatrix.H.

References fvMatrix< Type >::source_.

Referenced by porousZone::modifyDdt(), and fvMatrix< Type >::relax().

Here is the caller graph for this function:

const Field<Type>& source (  )  const [inline]

Definition at line 289 of file fvMatrix.H.

References fvMatrix< Type >::internalCoeffs_.

FieldField<Field, Type>& internalCoeffs (  )  [inline]

fvBoundary scalar field containing pseudo-matrix coeffs

for internal cells

Definition at line 298 of file fvMatrix.H.

References fvMatrix< Type >::boundaryCoeffs_.

FieldField<Field, Type>& boundaryCoeffs (  )  [inline]

fvBoundary scalar field containing pseudo-matrix coeffs

for boundary cells

Definition at line 307 of file fvMatrix.H.

References fvMatrix< Type >::faceFluxCorrectionPtr_.

surfaceTypeFieldPtr& faceFluxCorrectionPtr (  )  [inline]

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

Definition at line 318 of file fvMatrix.H.

void setValues ( const labelList &  cells,
const Field< Type > &  values 
) [inline]

Set solution in given cells and eliminate corresponding.

equations from the matrix

Definition at line 386 of file fvMatrix.C.

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

Set reference level for solution.

Definition at line 468 of file fvMatrix.C.

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

void relax ( const scalar  alpha  )  [inline]

Relax matrix (for steady-state solution).

alpha = 1 : diagonally equal alpha < 1 : diagonally dominant alpha = 0 : do nothing

Definition at line 483 of file fvMatrix.C.

References lduMatrix::diag(), and fvMatrix< Type >::source().

Here is the call graph for this function:

void relax (  )  [inline]

Relax matrix (for steady-state solution).

alpha is read from controlDict

Definition at line 573 of file fvMatrix.C.

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

Here is the caller graph for this function:

void boundaryManipulate ( typename GeometricField< Type, fvPatchField, volMesh >::GeometricBoundaryField &  values  )  [inline]

Manipulate based on a boundary field.

Definition at line 584 of file fvMatrix.C.

References DimensionedField< Type, GeoMesh >::mesh(), IOobject::name(), fvMatrix< Type >::psi_, and fvMatrix< Type >::relax().

Here is the call graph for this function:

autoPtr<fvSolver> solver ( const dictionary &   ) 

Construct and return the solver.

Use the given solver controls

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

Construct and return the solver.

Solver controls read from fvSolution

Definition at line 162 of file fvMatrixSolve.C.

Referenced by fvSolver::solve().

Here is the caller graph for this function:

Foam::lduMatrix::solverPerformance solve ( const dictionary &  solverControls  )  [inline]

Solve returning the solution statistics.

Use the given solver controls

Definition at line 46 of file fvMatrixSolve.C.

Referenced by Foam::solve().

Here is the caller graph for this function:

Foam::lduMatrix::solverPerformance solve (  )  [inline]

Solve returning the solution statistics.

Solver controls read from fvSolution

Definition at line 175 of file fvMatrixSolve.C.

References DimensionedField< Type, GeoMesh >::mesh(), IOobject::name(), and fvMatrix< Type >::psi_.

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

Here is the call graph for this function:

Here is the caller graph for this function:

Foam::tmp< Foam::Field< Type > > residual (  )  const [inline]

Return the matrix residual.

Definition at line 182 of file fvMatrixSolve.C.

References DimensionedField< Type, GeoMesh >::mesh(), IOobject::name(), fvMatrix< Type >::psi_, and fvMatrix< Type >::solve().

Here is the call graph for this function:

Foam::tmp< Foam::scalarField > D (  )  const [inline]

Return the matrix scalar diagonal.

Definition at line 597 of file fvMatrix.C.

References forAll.

Foam::tmp< Foam::Field< Type > > DD (  )  const [inline]

Return the matrix Type diagonal.

Definition at line 606 of file fvMatrix.C.

References fvMatrix< Type >::addCmptAvBoundaryDiag(), and lduMatrix::diag().

Here is the call graph for this function:

Foam::tmp< Foam::volScalarField > A (  )  const [inline]

Return the central coefficient.

Definition at line 630 of file fvMatrix.C.

Return the H operation source.

Definition at line 659 of file fvMatrix.C.

Foam::tmp< Foam::volScalarField > H1 (  )  const [inline]

Return H(1).

Reimplemented from lduMatrix.

Definition at line 725 of file fvMatrix.C.

Return the face-flux field from the matrix.

Definition at line 775 of file fvMatrix.C.

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

Definition at line 859 of file fvMatrix.C.

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

Here is the caller graph for this function:

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

Definition at line 894 of file fvMatrix.C.

References fvMatrix< Type >::faceFluxCorrectionPtr_.

void negate (  )  [inline]

Reimplemented from lduMatrix.

Definition at line 902 of file fvMatrix.C.

References fvMatrix< Type >::operator=().

Here is the call graph for this function:

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

Definition at line 917 of file fvMatrix.C.

References fvMatrix< Type >::faceFluxCorrectionPtr_, and GeometricField< Type, PatchField, GeoMesh >::negate().

Referenced by fvMatrix< Type >::operator-=().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 943 of file fvMatrix.C.

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

Definition at line 951 of file fvMatrix.C.

References fvMatrix< Type >::operator+=().

Referenced by fvMatrix< Type >::operator+=().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 975 of file fvMatrix.C.

References fvMatrix< Type >::faceFluxCorrectionPtr_.

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

Definition at line 984 of file fvMatrix.C.

References fvMatrix< Type >::operator-=().

Here is the call graph for this function:

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

Definition at line 995 of file fvMatrix.C.

References Foam::checkMethod().

Here is the call graph for this function:

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

Definition at line 1006 of file fvMatrix.C.

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

Definition at line 1017 of file fvMatrix.C.

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

Definition at line 1028 of file fvMatrix.C.

References Foam::checkMethod().

Here is the call graph for this function:

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

Definition at line 1039 of file fvMatrix.C.

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

Definition at line 1050 of file fvMatrix.C.

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

Definition at line 1060 of file fvMatrix.C.

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

Here is the call graph for this function:

void operator+= ( const zeroField &   )  [inline]

Definition at line 1070 of file fvMatrix.C.

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

Here is the call graph for this function:

void operator-= ( const zeroField &   )  [inline]

Definition at line 1078 of file fvMatrix.C.

void operator*= ( const DimensionedField< scalar, volMesh > &  dsf  )  [inline]

Definition at line 1086 of file fvMatrix.C.

void operator*= ( const tmp< DimensionedField< scalar, volMesh > > &  tdsf  )  [inline]

Definition at line 1119 of file fvMatrix.C.

void operator*= ( const tmp< volScalarField > &  tvsf  )  [inline]

Definition at line 1130 of file fvMatrix.C.

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

Definition at line 1141 of file fvMatrix.C.

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

Foam::autoPtr< Foam::fvMatrix< Foam::scalar >::fvSolver > solver ( const dictionary &  solverControls  )  [inline]

Definition at line 50 of file fvScalarMatrix.C.

Foam::lduMatrix::solverPerformance solve ( const dictionary &  solverControls  )  [inline]

Definition at line 117 of file fvScalarMatrix.C.

Foam::tmp< Foam::scalarField > residual (  )  const [inline]

Definition at line 156 of file fvScalarMatrix.C.

Foam::tmp< Foam::volScalarField > H (  )  const [inline]

Definition at line 180 of file fvScalarMatrix.C.

Foam::tmp< Foam::volScalarField > H1 (  )  const [inline]

Reimplemented from lduMatrix.

Definition at line 212 of file fvScalarMatrix.C.

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

autoPtr< fvMatrix< scalar >::fvSolver > solver ( const dictionary &   )  [inline]

lduMatrix::solverPerformance solve ( const dictionary &   )  [inline]

tmp< scalarField > residual (  )  const [inline]

tmp< volScalarField > H (  )  const [inline]

tmp< volScalarField > H1 (  )  const [inline]

Reimplemented from lduMatrix.


Friends And Related Function Documentation

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

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

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

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

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


Member Data Documentation

Dimension set.

Definition at line 118 of file fvMatrix.H.

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

Source term.

Definition at line 121 of file fvMatrix.H.

Referenced by fvMatrix< Type >::dimensions(), and fvMatrix< Type >::source().

Boundary scalar field containing pseudo-matrix coeffs.

for internal cells

Definition at line 127 of file fvMatrix.H.

Referenced by fvMatrix< Type >::setComponentReference(), and fvMatrix< Type >::source().

Boundary scalar field containing pseudo-matrix coeffs.

for boundary cells

Definition at line 133 of file fvMatrix.H.

Referenced by fvMatrix< Type >::internalCoeffs(), and fvMatrix< Type >::setComponentReference().


The documentation for this class was generated from the following files:
Copyright © 2000-2009 OpenCFD Ltd