LeastSquaresGrad< Type, Stencil > Class Template Reference

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

Inheritance diagram for LeastSquaresGrad< Type, Stencil >:
Collaboration diagram for LeastSquaresGrad< Type, Stencil >:

Public Member Functions

 TypeName ("LeastSquares")
 Runtime type information. More...
 
 LeastSquaresGrad (const fvMesh &mesh, Istream &schemeData)
 Construct from Istream. More...
 
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. More...
 
- Public Member Functions inherited from gradScheme< Type >
virtual const wordtype () const =0
 Runtime type information. More...
 
 declareRunTimeSelectionTable (tmp, gradScheme, Istream,(const fvMesh &mesh, Istream &schemeData),(mesh, schemeData))
 
 gradScheme (const fvMesh &mesh)
 Construct from mesh. More...
 
virtual ~gradScheme ()=default
 Destructor. More...
 
const fvMeshmesh () const
 Return const reference to mesh. More...
 
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. More...
 
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. More...
 
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. More...
 
- Public Member Functions inherited from refCount
constexpr refCount () noexcept
 Default construct, initializing count to 0. More...
 
int use_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...
 

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

Detailed Description

template<class Type, class Stencil>
class Foam::fv::LeastSquaresGrad< Type, Stencil >

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.

Usage
Example of the gradient specification:
gradSchemes
{
    default         pointCellsLeastSquares;
}
See also
Foam::fv::LeastSquaresVectors Foam::fv::leastSquaresGrad
Source files

Definition at line 99 of file LeastSquaresGrad.H.

Constructor & Destructor Documentation

◆ LeastSquaresGrad()

LeastSquaresGrad ( const fvMesh mesh,
Istream schemeData 
)
inline

Construct from Istream.

Definition at line 137 of file LeastSquaresGrad.H.

Member Function Documentation

◆ TypeName()

TypeName ( "LeastSquares"  )

Runtime type information.

◆ calcGrad()

virtual tmp< GeometricField <typename outerProduct<vector, Type>::type, fvPatchField, volMesh> > calcGrad ( const GeometricField< Type, fvPatchField, volMesh > &  vsf,
const word name 
) const
virtual

Return the gradient of the given field to the gradScheme::grad for optional caching.

Implements gradScheme< Type >.


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