Loading...
Searching...
No Matches
cellCellStencil Class Referenceabstract

Calculation of interpolation stencils. More...

#include <cellCellStencil.H>

Inheritance diagram for cellCellStencil:
Collaboration diagram for cellCellStencil:

Public Types

enum  patchCellType { OTHER = 0 , PATCH = 1 , OVERSET = 2 }
enum  cellType {
  CALCULATED = 0 , INTERPOLATED = 1 , HOLE = 2 , SPECIAL = 3 ,
  POROUS = 4
}

Public Member Functions

 TypeName ("cellCellStencil")
 Runtime type information.
 declareRunTimeSelectionTable (autoPtr, cellCellStencil, mesh,(const fvMesh &mesh, const dictionary &dict, const bool update),(mesh, dict, update))
 cellCellStencil (const fvMesh &)
 Construct from fvMesh.
virtual ~cellCellStencil ()
 Destructor.
virtual bool update ()=0
 Update stencils. Return false if nothing changed.
virtual const labelUListcellTypes () const =0
 Return the cell type list.
virtual const labelUListinterpolationCells () const =0
 Indices of interpolated cells.
virtual const mapDistributecellInterpolationMap () const =0
 Return a communication schedule.
virtual const labelListListcellStencil () const =0
 Per interpolated cell the neighbour cells (in terms of slots as.
virtual const List< scalarList > & cellInterpolationWeights () const =0
 Weights for cellStencil.
virtual const scalarListcellInterpolationWeight () const =0
 Per interpolated cell the interpolation factor. (0 = use.
virtual void stencilWeights (const point &sample, const pointList &donorCcs, scalarList &weights) const =0
 Calculate weights for a single acceptor.
virtual const wordHashSetnonInterpolatedFields () const
 Return the names of any (stencil or mesh specific) fields that.
virtual wordHashSetnonInterpolatedFields ()
 Return non-const non-interpolating fields.
bool localStencil (const labelUList &) const
 Helper: is stencil fully local.
const labelIOListzoneID () const
 Helper: get reference to registered zoneID. Loads volScalarField.
template<class T>
void interpolate (const fvMesh &mesh, Field< T > &psi) const
 Explicit interpolation of acceptor cells from donor cells. Looks up cellCellStencil.
template<class GeoField>
void interpolate (GeoField &psi) const
 Explicit interpolation of acceptor cells from donor cells with boundary condition handling.
template<class GeoField>
void interpolate (const fvMesh &mesh, const wordHashSet &suppressed) const
 Explicit interpolation of all registered fields. No boundary conditions. Excludes selected fields (and their old-time fields).
void walkFront (const globalIndex &globalCells, const scalar layerRelax, const labelListList &allStencil, labelList &allCellTypes, scalarField &allWeight, const scalarList &compactCellVol, const labelListList &compactStencil, const labelList &zoneID, const label holeLayers, const label useLayer) const
 Surround holes with layer(s) of interpolated cells.
void setUpFront (const labelList &allCellTypes, bitSet &isFront) const
 Set up front using allCellTypes.
void setUpFrontOnOversetPatch (const labelList &allCellTypes, bitSet &isFront) const
 Set up front on overset patches.
void seedCell (const label cellI, const scalar wantedFraction, bitSet &isFront, scalarField &fraction) const
 Seed faces of cell with wantedFraction (if higher than current).
InfoProxy< cellCellStencil > info () const noexcept
 Return info proxy, used to print stencil information to a stream.
template<class Type>
Foam::tmp< Foam::volScalarFieldcreateField (const fvMesh &mesh, const word &name, const UList< Type > &psi)

Static Public Member Functions

static autoPtr< cellCellStencil > New (const fvMesh &, const dictionary &dict, const bool update=true)
 New function which constructs and returns pointer to a.
static const labelIOListzoneID (const fvMesh &)
 Helper: get reference to registered zoneID. Loads volScalarField.
static labelList count (const label size, const labelUList &lst)
 Count occurrences (in parallel).
static void globalCellCells (const globalIndex &gi, const polyMesh &mesh, const boolList &isValidDonor, const labelList &selectedCells, labelListList &cellCells, pointListList &cellCellCentres)
 Helper: create cell-cell addressing in global numbering.
template<class T>
static void interpolate (Field< T > &psi, const fvMesh &mesh, const cellCellStencil &overlap, const List< scalarList > &wghts)
 Interpolation of acceptor cells from donor cells.
template<class GeoField, class SuppressBC>
static void correctBoundaryConditions (GeoField &psi)
 Version of correctBoundaryConditions that excludes 'overset' bcs.

Protected Member Functions

void suppressMotionFields ()
 Helper: populate nonInterpolatedFields_ with motion solver.

Static Protected Member Functions

template<class Type>
static tmp< volScalarFieldcreateField (const fvMesh &mesh, const word &name, const UList< Type > &)
 Helper: create volScalarField for postprocessing.
static word baseName (const word &name)
 Helper: strip off trailing _0.

Protected Attributes

const fvMeshmesh_
 Reference to the mesh.
wordHashSet nonInterpolatedFields_
 Set of fields that should not be interpolated.
const dictionary dict_
 Dictionary of motion control parameters.

Static Protected Attributes

static const Enum< cellTypecellTypeNames_
 Mode type names.

Detailed Description

Calculation of interpolation stencils.

Looks up zoneID labelIOList to give the zoning. Wrapped in MeshObject as cellCellStencilObject. Kept separate so meshes can implement more clever methods (e.g. solid body motion does not require full recalculation)

Source files

Definition at line 63 of file cellCellStencil.H.

Member Enumeration Documentation

◆ patchCellType

Enumerator
OTHER 
PATCH 
OVERSET 

Definition at line 67 of file cellCellStencil.H.

◆ cellType

enum cellType
Enumerator
CALCULATED 
INTERPOLATED 
HOLE 
SPECIAL 
POROUS 

Definition at line 74 of file cellCellStencil.H.

Constructor & Destructor Documentation

◆ cellCellStencil()

cellCellStencil ( const fvMesh & mesh)

Construct from fvMesh.

Definition at line 52 of file cellCellStencil.C.

References mesh, mesh_, and nonInterpolatedFields_.

◆ ~cellCellStencil()

~cellCellStencil ( )
virtual

Destructor.

Definition at line 89 of file cellCellStencil.C.

Member Function Documentation

◆ createField() [1/2]

template<class Type>
tmp< volScalarField > createField ( const fvMesh & mesh,
const word & name,
const UList< Type > &  )
staticprotected

Helper: create volScalarField for postprocessing.

References mesh, and Foam::name().

Referenced by trackingInverseDistance::update(), and walkFront().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ baseName()

Foam::word baseName ( const word & name)
staticprotected

Helper: strip off trailing _0.

Definition at line 95 of file cellCellStencil.C.

References baseName(), and Foam::name().

Referenced by baseName(), and interpolate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ suppressMotionFields()

void suppressMotionFields ( )
protected

Helper: populate nonInterpolatedFields_ with motion solver.

fields

Definition at line 106 of file cellCellStencil.C.

References nonInterpolatedFields_.

Referenced by cellVolumeWeight::cellVolumeWeight(), and inverseDistance::inverseDistance().

Here is the caller graph for this function:

◆ TypeName()

TypeName ( "cellCellStencil" )

Runtime type information.

◆ declareRunTimeSelectionTable()

declareRunTimeSelectionTable ( autoPtr ,
cellCellStencil ,
mesh ,
(const fvMesh &mesh, const dictionary &dict, const bool update) ,
(mesh, dict, update)  )

References dict, mesh, and update().

Here is the call graph for this function:

◆ New()

Foam::autoPtr< Foam::cellCellStencil > New ( const fvMesh & mesh,
const dictionary & dict,
const bool update = true )
static

New function which constructs and returns pointer to a.

cellCellStencil

Definition at line 59 of file cellCellStencil.C.

References DebugInFunction, dict, Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInLookup, mesh, and update().

Here is the call graph for this function:

◆ update()

virtual bool update ( )
pure virtual

Update stencils. Return false if nothing changed.

Implemented in cellCellStencilObject, cellVolumeWeight, inverseDistance, and trackingInverseDistance.

Referenced by declareRunTimeSelectionTable(), and New().

Here is the caller graph for this function:

◆ cellTypes()

virtual const labelUList & cellTypes ( ) const
pure virtual

Return the cell type list.

Implemented in cellCellStencilObject, cellVolumeWeight, and inverseDistance.

◆ interpolationCells()

virtual const labelUList & interpolationCells ( ) const
pure virtual

Indices of interpolated cells.

Implemented in cellCellStencilObject, cellVolumeWeight, and inverseDistance.

◆ cellInterpolationMap()

virtual const mapDistribute & cellInterpolationMap ( ) const
pure virtual

Return a communication schedule.

Implemented in cellCellStencilObject, cellVolumeWeight, and inverseDistance.

◆ cellStencil()

virtual const labelListList & cellStencil ( ) const
pure virtual

Per interpolated cell the neighbour cells (in terms of slots as.

constructed by above cellInterpolationMap) to interpolate

Implemented in cellCellStencilObject, cellVolumeWeight, and inverseDistance.

◆ cellInterpolationWeights()

virtual const List< scalarList > & cellInterpolationWeights ( ) const
pure virtual

Weights for cellStencil.

Implemented in cellCellStencilObject, cellVolumeWeight, and inverseDistance.

◆ cellInterpolationWeight()

virtual const scalarList & cellInterpolationWeight ( ) const
pure virtual

Per interpolated cell the interpolation factor. (0 = use.

calculated, 1 = use interpolated)

Implemented in cellCellStencilObject, cellVolumeWeight, and inverseDistance.

◆ stencilWeights()

virtual void stencilWeights ( const point & sample,
const pointList & donorCcs,
scalarList & weights ) const
pure virtual

Calculate weights for a single acceptor.

Implemented in cellCellStencilObject, cellVolumeWeight, inverseDistance, and leastSquares.

◆ nonInterpolatedFields() [1/2]

const Foam::wordHashSet & nonInterpolatedFields ( ) const
virtual

Return the names of any (stencil or mesh specific) fields that.

should not be interpolated

Reimplemented in cellCellStencilObject.

Definition at line 197 of file cellCellStencil.C.

References nonInterpolatedFields_.

◆ nonInterpolatedFields() [2/2]

Foam::wordHashSet & nonInterpolatedFields ( )
virtual

Return non-const non-interpolating fields.

Definition at line 203 of file cellCellStencil.C.

References nonInterpolatedFields_.

◆ localStencil()

bool localStencil ( const labelUList & slots) const

Helper: is stencil fully local.

Definition at line 209 of file cellCellStencil.C.

References forAll, and mesh_.

◆ zoneID() [1/2]

◆ zoneID() [2/2]

const labelIOList & zoneID ( ) const
inline

Helper: get reference to registered zoneID. Loads volScalarField.

if not registered.

Definition at line 280 of file cellCellStencil.H.

References mesh_, and zoneID().

Referenced by cellVolumeWeight::cellVolumeWeight(), inverseDistance::inverseDistance(), and zoneID().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ count()

Foam::labelList count ( const label size,
const labelUList & lst )
static

Count occurrences (in parallel).

Definition at line 181 of file cellCellStencil.C.

References count(), forAll, Pstream::listCombineGather(), and Foam::Zero.

Referenced by count(), Foam::operator<<(), cellVolumeWeight::update(), inverseDistance::update(), and walkFront().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ globalCellCells()

void globalCellCells ( const globalIndex & gi,
const polyMesh & mesh,
const boolList & isValidDonor,
const labelList & selectedCells,
labelListList & cellCells,
pointListList & cellCellCentres )
static

Helper: create cell-cell addressing in global numbering.

Definition at line 222 of file cellCellStencil.C.

References cells, forAll, UList< T >::found(), Foam::identity(), mesh, globalIndex::range(), List< T >::setSize(), UList< T >::size(), syncTools::swapBoundaryCellList(), and globalIndex::toGlobal().

Referenced by inverseDistance::createStencil().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ interpolate() [1/4]

◆ interpolate() [2/4]

template<class T>
void interpolate ( const fvMesh & mesh,
Field< T > & psi ) const

Explicit interpolation of acceptor cells from donor cells. Looks up cellCellStencil.

Definition at line 77 of file cellCellStencilTemplates.C.

References Foam::interpolate(), mesh, overlap, and psi.

Here is the call graph for this function:

◆ interpolate() [3/4]

template<class GeoField>
void interpolate ( GeoField & psi) const

Explicit interpolation of acceptor cells from donor cells with boundary condition handling.

Definition at line 92 of file cellCellStencilTemplates.C.

References Foam::interpolate(), and psi.

Here is the call graph for this function:

◆ interpolate() [4/4]

template<class GeoField>
void interpolate ( const fvMesh & mesh,
const wordHashSet & suppressed ) const

Explicit interpolation of all registered fields. No boundary conditions. Excludes selected fields (and their old-time fields).

Definition at line 104 of file cellCellStencilTemplates.C.

References baseName(), Foam::endl(), field(), fld(), HashTable< T, Key, Hash >::found(), Foam::interpolate(), mesh, Foam::name(), overlap, and Foam::Pout.

Here is the call graph for this function:

◆ correctBoundaryConditions()

template<class GeoField, class SuppressBC>
void correctBoundaryConditions ( GeoField & psi)
static

Version of correctBoundaryConditions that excludes 'overset' bcs.

Definition at line 173 of file cellCellStencilTemplates.C.

References Foam::isA(), UPstream::nonBlocking, and psi.

Referenced by oversetFvMeshBase::writeObject().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ walkFront()

void walkFront ( const globalIndex & globalCells,
const scalar layerRelax,
const labelListList & allStencil,
labelList & allCellTypes,
scalarField & allWeight,
const scalarList & compactCellVol,
const labelListList & compactStencil,
const labelList & zoneID,
const label holeLayers,
const label useLayer ) const

◆ setUpFront()

void setUpFront ( const labelList & allCellTypes,
bitSet & isFront ) const

Set up front using allCellTypes.

Definition at line 359 of file cellCellStencil.C.

References HOLE, mesh_, bitSet::set(), and syncTools::swapBoundaryCellList().

Referenced by walkFront().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setUpFrontOnOversetPatch()

void setUpFrontOnOversetPatch ( const labelList & allCellTypes,
bitSet & isFront ) const

Set up front on overset patches.

Definition at line 407 of file cellCellStencil.C.

References forAll, INTERPOLATED, Foam::isA(), mesh_, and bitSet::set().

Referenced by walkFront().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ seedCell()

void seedCell ( const label cellI,
const scalar wantedFraction,
bitSet & isFront,
scalarField & fraction ) const

Seed faces of cell with wantedFraction (if higher than current).

Definition at line 338 of file cellCellStencil.C.

References forAll, mesh_, and bitSet::set().

Referenced by walkFront().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ info()

InfoProxy< cellCellStencil > info ( ) const
inlinenoexcept

Return info proxy, used to print stencil information to a stream.

Definition at line 400 of file cellCellStencil.H.

References Foam::noexcept.

Referenced by cellVolumeWeight::update(), and trackingInverseDistance::update().

Here is the caller graph for this function:

◆ createField() [2/2]

template<class Type>
Foam::tmp< Foam::volScalarField > createField ( const fvMesh & mesh,
const word & name,
const UList< Type > & psi )

Member Data Documentation

◆ cellTypeNames_

const Foam::Enum< Foam::cellCellStencil::cellType > cellTypeNames_
staticprotected

Mode type names.

Definition at line 91 of file cellCellStencil.H.

◆ mesh_

◆ nonInterpolatedFields_

wordHashSet nonInterpolatedFields_
protected

Set of fields that should not be interpolated.

Definition at line 101 of file cellCellStencil.H.

Referenced by cellCellStencil(), nonInterpolatedFields(), nonInterpolatedFields(), and suppressMotionFields().

◆ dict_

const dictionary dict_
protected

Dictionary of motion control parameters.

Definition at line 106 of file cellCellStencil.H.


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