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>
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.
Definition at line 113 of file fvMatrix.H.
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 > &) |
typedef GeometricField<Type, fvsPatchField, surfaceMesh>* surfaceTypeFieldPtr |
Declare return type of the faceFluxCorrectionPtr() function.
Definition at line 307 of file fvMatrix.H.
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().
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.
ClassName | ( | "fvMatrix< Type >" | ) |
const GeometricField<Type, fvPatchField, volMesh>& psi | ( | ) | const [inline]
|
Definition at line 265 of file fvMatrix.H.
Referenced by MRFZone::addCoriolis(), porousZone::addResistance(), explicitSource::addSu(), actuationDiskSource::addSu(), Foam::checkMethod(), Foam::correction(), gaussConvectionScheme< Type >::fvmDiv(), Foam::operator+(), Foam::operator-(), and Foam::operator==().
GeometricField<Type, fvPatchField, volMesh>& psi | ( | ) | [inline]
|
Definition at line 270 of file fvMatrix.H.
const dimensionSet& dimensions | ( | ) | const [inline]
|
Definition at line 275 of file fvMatrix.H.
Referenced by porousZone::addResistance(), actuationDiskSource::addSu(), Foam::checkMethod(), and Foam::operator&().
Field<Type>& source | ( | ) | [inline]
|
Definition at line 280 of file fvMatrix.H.
Referenced by MRFZone::addCoriolis(), porousZone::addResistance(), explicitSource::addSu(), actuationDiskSource::addSu(), EulerD2dt2Scheme< Type >::fvmD2dt2(), SLTSDdtScheme< Type >::fvmDdt(), localEulerDdtScheme< Type >::fvmDdt(), EulerDdtScheme< Type >::fvmDdt(), CrankNicholsonDdtScheme< Type >::fvmDdt(), CoEulerDdtScheme< Type >::fvmDdt(), boundedBackwardDdtScheme::fvmDdt(), backwardDdtScheme< Type >::fvmDdt(), gaussLaplacianScheme< Type, GType >::fvmLaplacian(), porousZone::modifyDdt(), Foam::operator&(), Foam::fvm::Su(), and Foam::fvm::SuSp().
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().
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 ) |
Relax matrix (for steady-state solution).
alpha = 1 : diagonally equal alpha < 1 : diagonally dominant alpha = 0 : do nothing
Definition at line 491 of file fvMatrix.C.
References Foam::cmptMag(), Foam::cmptMin(), Foam::cmptMultiply(), Foam::component(), fvPatchField< Type >::coupled(), Foam::diag(), forAll, Foam::mag(), Foam::max(), List< Type >::size(), and List< T >::size().
Referenced by LRRDiffStress::correct(), locDynOneEqEddy::correct(), kOmegaSSTSAS::correct(), SpalartAllmaras::correct(), oneEqEddy::correct(), dynOneEqEddy::correct(), DeardorffDiffStress::correct(), and radiativeIntensityRay::correct().
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 ) |
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.
Foam::lduMatrix::solverPerformance solve | ( | const dictionary & | solverControls ) |
Solve returning the solution statistics.
Use the given solver controls
Definition at line 54 of file fvMatrixSolve.C.
References Field< Type >::component(), Foam::diag(), Foam::endl(), Foam::Info, lduMatrix::solverPerformance::initialResidual(), Foam::pow(), lduMatrix::solverPerformance::print(), lduMatrix::solverPerformance::singular(), Foam::solve(), and Foam::type().
Referenced by LRRDiffStress::correct(), locDynOneEqEddy::correct(), kOmegaSSTSAS::correct(), SpalartAllmaras::correct(), oneEqEddy::correct(), dynOneEqEddy::correct(), DeardorffDiffStress::correct(), and Foam::solve().
Foam::lduMatrix::solverPerformance solve | ( | ) |
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::Field< Type > > residual | ( | ) | const |
Return the matrix residual.
Definition at line 190 of file fvMatrixSolve.C.
References GeometricField< Type, PatchField, GeoMesh >::boundaryField(), Field< Type >::component(), GeometricField< Type, PatchField, GeoMesh >::internalField(), Field< Type >::replace(), lduMatrix::residual(), and List< T >::size().
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::GeometricField< Type, Foam::fvPatchField, Foam::volMesh > > H | ( | ) | const |
Return the H operation source.
Definition at line 667 of file fvMatrix.C.
References Field< Type >::component(), GeometricField< Type, PatchField, GeoMesh >::correctBoundaryConditions(), DimensionedField< Type, GeoMesh >::dimensions(), Foam::dimVol, lduMatrix::H(), GeometricField< Type, PatchField, GeoMesh >::internalField(), Field< Type >::negate(), IOobject::NO_READ, IOobject::NO_WRITE, Foam::pow(), GeometricField< Type, PatchField, GeoMesh >::replace(), and Foam::type().
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.
Foam::tmp< Foam::GeometricField< Type, Foam::fvsPatchField, Foam::surfaceMesh > > flux | ( | ) | const |
Return the face-flux field from the matrix.
Definition at line 783 of file fvMatrix.C.
References Foam::abort(), GeometricField< Type, PatchField, GeoMesh >::boundaryField(), Foam::cmptMultiply(), lduMatrix::faceH(), Foam::FatalError, FatalErrorIn, forAll, GeometricField< Type, PatchField, GeoMesh >::internalField(), IOobject::NO_READ, and IOobject::NO_WRITE.
Referenced by Foam::correction(), and Foam::MULES::implicitSolve().
void operator= | ( | const fvMatrix< Type > & | fvmv ) |
Definition at line 867 of file fvMatrix.C.
References Foam::abort(), Foam::FatalError, FatalErrorIn, and lduMatrix::operator=().
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+=().
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-=().
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::lduMatrix::solverPerformance solve | ( | const dictionary & | solverControls ) |
Definition at line 125 of file fvScalarMatrix.C.
References Foam::diag(), Foam::endl(), Foam::Info, lduMatrix::solverPerformance::print(), and Foam::solve().
Foam::tmp< Foam::scalarField > residual | ( | ) | const |
Definition at line 164 of file fvScalarMatrix.C.
Foam::tmp< Foam::volScalarField > H | ( | ) | const |
Definition at line 188 of file fvScalarMatrix.C.
References GeometricField< Type, PatchField, GeoMesh >::correctBoundaryConditions(), Foam::dimVol, and GeometricField< Type, PatchField, GeoMesh >::internalField().
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.
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]
|