FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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...

#include <finiteVolume/fvMatrix.H>


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

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

 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

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 > &)

Member Typedef Documentation

Declare return type of the faceFluxCorrectionPtr() function.

Definition at line 307 of file fvMatrix.H.


Constructor & Destructor Documentation

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

Construct given a field to solve for.

Definition at line 184 of file fvMatrix.C.

References Foam::endl(), forAll, Foam::Info, and DimensionedField< Type, GeoMesh >::mesh().

fvMatrix ( const fvMatrix< Type > &   fvm  )

Construct as copy.

Definition at line 234 of file fvMatrix.C.

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

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

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

Construct from Istream given field to solve for

Definition at line 323 of file fvMatrix.C.

References Foam::endl(), forAll, Foam::Info, and DimensionedField< Type, GeoMesh >::mesh().

~fvMatrix (  ) [virtual]

Definition at line 372 of file fvMatrix.C.

References Foam::endl(), and Foam::Info.


Member Function Documentation

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

Definition at line 270 of file fvMatrix.H.

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

Definition at line 285 of file fvMatrix.H.

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

fvBoundary scalar field containing pseudo-matrix coeffs

for internal cells

Definition at line 292 of file fvMatrix.H.

Referenced by gaussConvectionScheme< Type >::fvmDiv().

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

fvBoundary scalar field containing pseudo-matrix coeffs

for boundary cells

Definition at line 299 of file fvMatrix.H.

Referenced by gaussConvectionScheme< Type >::fvmDiv().

surfaceTypeFieldPtr& faceFluxCorrectionPtr (  ) [inline]

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

Definition at line 310 of file fvMatrix.H.

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

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

Set solution in given cells and eliminate corresponding.

equations from the matrix

Definition at line 394 of file fvMatrix.C.

References polyMesh::boundaryMesh(), primitiveMesh::cells(), cells, Foam::diag(), forAll, primitiveMesh::isInternalFace(), mesh, fvMesh::neighbour(), fvMesh::owner(), and polyBoundaryMesh::whichPatch().

Referenced by fixedInternalValueFvPatchField< Type >::manipulateMatrix().

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

Set reference level for solution.

Definition at line 476 of file fvMatrix.C.

References Foam::diag().

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 30 of file fvMatrixSolve.C.

References Foam::diag().

void relax ( const scalar   alpha  )
void relax (  )

Relax matrix (for steady-state solution).

alpha is read from controlDict

Definition at line 581 of file fvMatrix.C.

References relax().

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

Manipulate based on a boundary field.

Definition at line 592 of file fvMatrix.C.

References forAll.

autoPtr<fvSolver> solver ( const dictionary &    )

Construct and return the solver.

Use the given solver controls

Referenced by radiativeIntensityRay::correct().

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

Construct and return the solver.

Solver controls read from fvSolution

Definition at line 170 of file fvMatrixSolve.C.

Solve returning the solution statistics.

Solver controls read from fvSolution

Definition at line 183 of file fvMatrixSolve.C.

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

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

Return the matrix scalar diagonal.

Definition at line 605 of file fvMatrix.C.

References Foam::diag().

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

Return the matrix Type diagonal.

Definition at line 614 of file fvMatrix.C.

References fvPatchField< Type >::coupled(), Foam::diag(), forAll, and List< Type >::size().

Foam::tmp< Foam::volScalarField > A (  ) const

Return the central coefficient.

Definition at line 638 of file fvMatrix.C.

References Foam::dimVol, IOobject::NO_READ, and IOobject::NO_WRITE.

Foam::tmp< Foam::volScalarField > H1 (  ) const

Return H(1)

Reimplemented from lduMatrix.

Definition at line 733 of file fvMatrix.C.

References Foam::dimVol, lduMatrix::H1(), IOobject::NO_READ, and IOobject::NO_WRITE.

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

Definition at line 867 of file fvMatrix.C.

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

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

Definition at line 902 of file fvMatrix.C.

void negate (  )

Reimplemented from lduMatrix.

Definition at line 910 of file fvMatrix.C.

References lduMatrix::negate().

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

Definition at line 925 of file fvMatrix.C.

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

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

Definition at line 951 of file fvMatrix.C.

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

Definition at line 959 of file fvMatrix.C.

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

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

Definition at line 983 of file fvMatrix.C.

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

Definition at line 992 of file fvMatrix.C.

References Foam::checkMethod().

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

Definition at line 1003 of file fvMatrix.C.

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

Definition at line 1014 of file fvMatrix.C.

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

Definition at line 1025 of file fvMatrix.C.

References Foam::checkMethod().

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

Definition at line 1036 of file fvMatrix.C.

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

Definition at line 1047 of file fvMatrix.C.

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

Definition at line 1058 of file fvMatrix.C.

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

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

Definition at line 1068 of file fvMatrix.C.

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

void operator+= ( const zeroField &    )

Definition at line 1078 of file fvMatrix.C.

void operator-= ( const zeroField &    )

Definition at line 1086 of file fvMatrix.C.

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

Definition at line 1094 of file fvMatrix.C.

References Foam::abort(), Foam::FatalError, FatalErrorIn, forAll, and lduMatrix::operator*=().

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

Definition at line 1127 of file fvMatrix.C.

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

Definition at line 1138 of file fvMatrix.C.

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

Definition at line 1149 of file fvMatrix.C.

References lduMatrix::operator*=().

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

Definition at line 33 of file fvScalarMatrix.C.

References Foam::diag().

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

Definition at line 58 of file fvScalarMatrix.C.

References Foam::diag(), Foam::endl(), and Foam::Info.

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

Definition at line 164 of file fvScalarMatrix.C.

Foam::tmp< Foam::volScalarField > H1 (  ) const

Reimplemented from lduMatrix.

Definition at line 220 of file fvScalarMatrix.C.

References Foam::dimVol.

void setComponentReference ( const label   patchi,
const label   facei,
const   direction,
const scalar   value  
)
autoPtr< fvMatrix< scalar >::fvSolver > solver ( const dictionary &    )
lduMatrix::solverPerformance solve ( const dictionary &    )
tmp< scalarField > residual (  ) const
tmp< volScalarField > H (  ) const
tmp< volScalarField > H1 (  ) const

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]

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