Gradient calculated using weighted least-squares on an arbitrary stencil. The stencil type is provided via a template argument and any cell-based stencil is supported: More...
#include <LeastSquaresGrad.H>


Public Member Functions | |
| TypeName ("LeastSquares") | |
| Runtime type information. | |
| LeastSquaresGrad (const fvMesh &mesh, Istream &schemeData) | |
| Construct from Istream. | |
| virtual tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh > > | calcGrad (const GeometricField< Type, fvPatchField, volMesh > &vsf, const word &name) const |
| Return the gradient of the given field to the gradScheme::grad for optional caching. | |
| virtual void | calcGrad (GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh > &res, const GeometricField< Type, fvPatchField, volMesh > &) const |
| Calculate the grad of the given field into supplied field. | |
| Public Member Functions inherited from gradScheme< Type > | |
| virtual const word & | type () const =0 |
| Runtime type information. | |
| declareRunTimeSelectionTable (tmp, gradScheme, Istream,(const fvMesh &mesh, Istream &schemeData),(mesh, schemeData)) | |
| gradScheme (const fvMesh &mesh) | |
| Construct from mesh. | |
| virtual | ~gradScheme ()=default |
| Destructor. | |
| const fvMesh & | mesh () const |
| Return const reference to mesh. | |
| tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh > > | grad (const GeometricField< Type, fvPatchField, volMesh > &, const word &name) const |
| Calculate and return the grad of the given field which may have been cached. | |
| tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh > > | grad (const GeometricField< Type, fvPatchField, volMesh > &) const |
| Calculate and return the grad of the given field with the default name which may have been cached. | |
| tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh > > | grad (const tmp< GeometricField< Type, fvPatchField, volMesh > > &) const |
| Calculate and return the grad of the given field with the default name which may have been cached. | |
| Public Member Functions inherited from refCount | |
| constexpr | refCount () noexcept |
| Default construct, initializing count to 0. | |
| int | use_count () const noexcept |
| Return the current reference count. | |
| bool | unique () const noexcept |
| Return true if the reference count is zero. | |
| void | operator++ () noexcept |
| Increment the reference count. | |
| void | operator++ (int) noexcept |
| Increment the reference count. | |
| void | operator-- () noexcept |
| Decrement the reference count. | |
| void | operator-- (int) noexcept |
| Decrement the reference count. | |
Additional Inherited Members | |
| Static Public Member Functions inherited from gradScheme< Type > | |
| static tmp< gradScheme< Type > > | New (const fvMesh &mesh, Istream &schemeData) |
| Return a pointer to a new gradScheme created on freestore. | |
Gradient calculated using weighted least-squares on an arbitrary stencil. The stencil type is provided via a template argument and any cell-based stencil is supported:
| Stencil | Connections | Scheme name |
|---|---|---|
centredCFCCellToCellStencil | cell-face-cell | Not Instantiated |
centredCPCCellToCellStencil | cell-point-cell | pointCellsLeastSquares |
centredCECCellToCellStencil | cell-edge-cell | edgeCellsLeastSquares |
The first of these is not instantiated by default as the standard leastSquaresGrad is equivalent and more efficient.
gradSchemes
{
default pointCellsLeastSquares;
}
Definition at line 99 of file LeastSquaresGrad.H.
|
inline |
Construct from Istream.
Definition at line 137 of file LeastSquaresGrad.H.
| TypeName | ( | "LeastSquares" | ) |
Runtime type information.
|
virtual |
Return the gradient of the given field to the gradScheme::grad for optional caching.
Implements gradScheme< Type >.
Definition at line 118 of file LeastSquaresGrad.C.
References calcGrad(), DimensionedField< Type, GeoMesh >::dimensions(), Foam::dimLength, fvPatchFieldBase::extrapolatedCalculatedType(), IOobject::instance(), DimensionedField< Type, GeoMesh >::mesh(), gradScheme< Type >::mesh(), Foam::name(), IOobjectOption::NO_READ, IOobjectOption::NO_WRITE, and tmp< T >::ref().
Referenced by calcGrad().


|
virtual |
Calculate the grad of the given field into supplied field.
Reimplemented from gradScheme< Type >.
Definition at line 32 of file LeastSquaresGrad.C.
References GeometricField< Type, PatchField, GeoMesh >::boundaryField(), mapDistributeBase::constructSize(), gaussGrad< Type >::correctBoundaryConditions(), DimensionedField< Type, GeoMesh >::dimensions(), Foam::dimLength, mapDistribute::distribute(), forAll, extendedCentredCellToCellStencil::map(), DimensionedField< Type, GeoMesh >::mesh(), gradScheme< Type >::mesh(), MeshObject< fvMesh, MoveableMeshObject, LeastSquaresVectors< Stencil > >::New(), fvPatchFieldBase::patch(), fvPatch::start(), extendedCentredCellToCellStencil::stencil(), LeastSquaresVectors< Stencil >::stencil(), LeastSquaresVectors< Stencil >::vectors(), and Foam::Zero.
