cellVolumeWeight Class Reference

Volume-weighted interpolation stencil. More...

Inheritance diagram for cellVolumeWeight:
Collaboration diagram for cellVolumeWeight:

Public Member Functions

 TypeName ("cellVolumeWeight")
 Runtime type information. More...
 
 cellVolumeWeight (const fvMesh &, const dictionary &, const bool doUpdate)
 Construct from fvMesh. More...
 
virtual ~cellVolumeWeight ()
 Destructor. More...
 
scalar overlapTolerance () const
 Access to volume overlap tolerance. More...
 
virtual bool update ()
 Update stencils. Return false if nothing changed. More...
 
virtual const labelUListcellTypes () const
 Return the cell type list. More...
 
virtual const labelUListinterpolationCells () const
 Indices of interpolated cells. More...
 
virtual const mapDistributecellInterpolationMap () const
 Return a communication schedule. More...
 
virtual const labelListListcellStencil () const
 Per interpolated cell the neighbour cells (in terms of slots as. More...
 
virtual const List< scalarList > & cellInterpolationWeights () const
 Weights for cellStencil. More...
 
virtual const scalarListcellInterpolationWeight () const
 Per interpolated cell the interpolation factor. (0 = use. More...
 
virtual void stencilWeights (const point &sample, const pointList &donorCcs, scalarList &weights) const
 Calculate inverse distance weights for a single acceptor. Revert. More...
 
- Public Member Functions inherited from cellCellStencil
 TypeName ("cellCellStencil")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, cellCellStencil, mesh,(const fvMesh &mesh, const dictionary &dict, const bool update),(mesh, dict, update))
 
 cellCellStencil (const fvMesh &)
 Construct from fvMesh. More...
 
virtual ~cellCellStencil ()
 Destructor. More...
 
virtual const wordHashSetnonInterpolatedFields () const
 Return the names of any (stencil or mesh specific) fields that. More...
 
virtual wordHashSetnonInterpolatedFields ()
 Return non-const non-interpolating fields. More...
 
bool localStencil (const labelUList &) const
 Helper: is stencil fully local. More...
 
const labelIOListzoneID () const
 Helper: get reference to registered zoneID. Loads volScalarField. More...
 
template<class T >
void interpolate (const fvMesh &mesh, Field< T > &psi) const
 Explicit interpolation of acceptor cells from donor cells. Looks up cellCellStencil. More...
 
template<class GeoField >
void interpolate (GeoField &psi) const
 Explicit interpolation of acceptor cells from donor cells with boundary condition handling. More...
 
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) More...
 
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. More...
 
void setUpFront (const labelList &allCellTypes, bitSet &isFront) const
 Set up front using allCellTypes. More...
 
void setUpFrontOnOversetPatch (const labelList &allCellTypes, bitSet &isFront) const
 Set up front on overset patches. More...
 
void seedCell (const label cellI, const scalar wantedFraction, bitSet &isFront, scalarField &fraction) const
 Seed faces of cell with wantedFraction (if higher than current) More...
 
InfoProxy< cellCellStencilinfo () const noexcept
 Return info proxy, used to print stencil information to a stream. More...
 
template<class Type >
Foam::tmp< Foam::volScalarFieldcreateField (const fvMesh &mesh, const word &name, const UList< Type > &psi)
 

Protected Member Functions

void findHoles (const globalIndex &globalCells, const fvMesh &mesh, const labelList &zoneID, const labelListList &stencil, labelList &cellTypes) const
 Find cells next to cells of type PATCH. More...
 
void markPatchCells (const fvMesh &mesh, const labelList &cellMap, labelList &patchCellTypes) const
 according to additionalDocumentation/MEJ_oversetMesh.txt More...
 
void combineCellTypes (const label subZoneID, const fvMesh &subMesh, const labelList &subCellMap, const label donorZoneID, const labelListList &toOtherCells, const List< scalarList > &weights, const labelList &otherCells, const labelList &interpolatedOtherPatchTypes, labelListList &allStencil, scalarListList &allWeights, labelList &allCellTypes, labelList &allDonorID) const
 
void interpolatePatchTypes (const labelListList &addressing, const labelList &patchTypes, labelList &result) const
 interpolate (= combine) patch types More...
 
void interpolatePatchTypes (const autoPtr< mapDistribute > &mapPtr, const labelListList &addressing, const labelList &patchTypes, labelList &result) const
 interpolate (= combine) patch types More...
 
- Protected Member Functions inherited from cellCellStencil
void suppressMotionFields ()
 Helper: populate nonInterpolatedFields_ with motion solver. More...
 

Protected Attributes

const dictionary dict_
 Dictionary of motion control parameters. More...
 
scalar overlapTolerance_
 Tolerance for volume overlap. Fraction of volume. More...
 
labelList cellTypes_
 Per cell the cell type. More...
 
labelList interpolationCells_
 Indices of interpolated cells. More...
 
autoPtr< mapDistributecellInterpolationMap_
 Fetch interpolated cells. More...
 
labelListList cellStencil_
 Interpolation stencil. More...
 
List< scalarListcellInterpolationWeights_
 Interpolation weights. More...
 
volScalarField cellInterpolationWeight_
 Amount of interpolation. More...
 
const bool allowInterpolatedDonors_
 Allow interpolared as donors. More...
 
- Protected Attributes inherited from cellCellStencil
const fvMeshmesh_
 Reference to the mesh. More...
 
wordHashSet nonInterpolatedFields_
 Set of fields that should not be interpolated. More...
 
const dictionary dict_
 Dictionary of motion control parameters. More...
 

Static Protected Attributes

static scalar defaultOverlapTolerance_ = 1e-6
 Default overlap tolerance. Fraction of volume. More...
 
- Static Protected Attributes inherited from cellCellStencil
static const Enum< cellTypecellTypeNames_
 Mode type names. More...
 

Additional Inherited Members

- Public Types inherited from cellCellStencil
enum  patchCellType { OTHER = 0, PATCH = 1, OVERSET = 2 }
 
enum  cellType {
  CALCULATED = 0, INTERPOLATED = 1, HOLE = 2, SPECIAL = 3,
  POROUS = 4
}
 
- Static Public Member Functions inherited from cellCellStencil
static autoPtr< cellCellStencilNew (const fvMesh &, const dictionary &dict, const bool update=true)
 New function which constructs and returns pointer to a. More...
 
static const labelIOListzoneID (const fvMesh &)
 Helper: get reference to registered zoneID. Loads volScalarField. More...
 
static labelList count (const label size, const labelUList &lst)
 Count occurrences (in parallel) More...
 
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. More...
 
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. More...
 
template<class GeoField , class SuppressBC >
static void correctBoundaryConditions (GeoField &psi)
 Version of correctBoundaryConditions that excludes 'overset' bcs. More...
 
- Static Protected Member Functions inherited from cellCellStencil
template<class Type >
static tmp< volScalarFieldcreateField (const fvMesh &mesh, const word &name, const UList< Type > &)
 Helper: create volScalarField for postprocessing. More...
 
static word baseName (const word &name)
 Helper: strip off trailing _0. More...
 

Detailed Description

Constructor & Destructor Documentation

◆ cellVolumeWeight()

cellVolumeWeight ( const fvMesh mesh,
const dictionary dict,
const bool  doUpdate 
)

Construct from fvMesh.

Definition at line 508 of file cellVolumeWeightCellCellStencil.C.

References Foam::ensightOutput::debug, Foam::endl(), forAll, io(), Foam::Pout, and update().

Here is the call graph for this function:

◆ ~cellVolumeWeight()

~cellVolumeWeight ( )
virtual

Destructor.

Definition at line 586 of file cellVolumeWeightCellCellStencil.C.

Member Function Documentation

◆ findHoles()

void findHoles ( const globalIndex globalCells,
const fvMesh mesh,
const labelList zoneID,
const labelListList stencil,
labelList cellTypes 
) const
protected

Find cells next to cells of type PATCH.

Definition at line 54 of file cellVolumeWeightCellCellStencil.C.

References cellTypes, mapDistribute::distribute(), Foam::endl(), fvPatch::faceCells(), forAll, Foam::Info, mesh, Foam::nl, regionSplit::nRegions(), pbm, Foam::returnReduceOr(), and Foam::Zero.

Here is the call graph for this function:

◆ markPatchCells()

void markPatchCells ( const fvMesh mesh,
const labelList cellMap,
labelList patchCellTypes 
) const
protected

according to additionalDocumentation/MEJ_oversetMesh.txt

Definition at line 286 of file cellVolumeWeightCellCellStencil.C.

References fvPatch::faceCells(), forAll, mesh, and pbm.

Here is the call graph for this function:

◆ combineCellTypes()

void combineCellTypes ( const label  subZoneID,
const fvMesh subMesh,
const labelList subCellMap,
const label  donorZoneID,
const labelListList toOtherCells,
const List< scalarList > &  weights,
const labelList otherCells,
const labelList interpolatedOtherPatchTypes,
labelListList allStencil,
scalarListList allWeights,
labelList allCellTypes,
labelList allDonorID 
) const
protected

Option 1:

scalar currentVol = sum(allWeights[cellI]); if (overlapVol[subCellI] > currentVol)

Option 3:

Definition at line 395 of file cellVolumeWeightCellCellStencil.C.

References forAll, and Foam::mag().

Here is the call graph for this function:

◆ interpolatePatchTypes() [1/2]

void interpolatePatchTypes ( const labelListList addressing,
const labelList patchTypes,
labelList result 
) const
protected

interpolate (= combine) patch types

Definition at line 326 of file cellVolumeWeightCellCellStencil.C.

References forAll, and patchTypes().

Here is the call graph for this function:

◆ interpolatePatchTypes() [2/2]

void interpolatePatchTypes ( const autoPtr< mapDistribute > &  mapPtr,
const labelListList addressing,
const labelList patchTypes,
labelList result 
) const
protected

interpolate (= combine) patch types

Definition at line 362 of file cellVolumeWeightCellCellStencil.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, patchTypes(), and UList< T >::size().

Here is the call graph for this function:

◆ TypeName()

TypeName ( "cellVolumeWeight"  )

Runtime type information.

◆ overlapTolerance()

scalar overlapTolerance ( ) const
inline

Access to volume overlap tolerance.

Definition at line 218 of file cellVolumeWeightCellCellStencil.H.

References cellVolumeWeight::overlapTolerance_.

◆ update()

◆ cellTypes()

virtual const labelUList& cellTypes ( ) const
inlinevirtual

Return the cell type list.

Implements cellCellStencil.

Definition at line 231 of file cellVolumeWeightCellCellStencil.H.

References cellVolumeWeight::cellTypes_.

◆ interpolationCells()

virtual const labelUList& interpolationCells ( ) const
inlinevirtual

Indices of interpolated cells.

Implements cellCellStencil.

Definition at line 239 of file cellVolumeWeightCellCellStencil.H.

References cellVolumeWeight::interpolationCells_.

◆ cellInterpolationMap()

virtual const mapDistribute& cellInterpolationMap ( ) const
inlinevirtual

Return a communication schedule.

Implements cellCellStencil.

Definition at line 247 of file cellVolumeWeightCellCellStencil.H.

References cellVolumeWeight::cellInterpolationMap_, and cellVolumeWeight::update().

Here is the call graph for this function:

◆ cellStencil()

virtual const labelListList& cellStencil ( ) const
inlinevirtual

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

constructed by above cellInterpolationMap) to interpolate

Implements cellCellStencil.

Definition at line 261 of file cellVolumeWeightCellCellStencil.H.

References cellVolumeWeight::cellStencil_.

◆ cellInterpolationWeights()

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

Weights for cellStencil.

Implements cellCellStencil.

Definition at line 269 of file cellVolumeWeightCellCellStencil.H.

References cellVolumeWeight::cellInterpolationWeights_.

◆ cellInterpolationWeight()

virtual const scalarList& cellInterpolationWeight ( ) const
inlinevirtual

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

calculated, 1 = use interpolated)

Implements cellCellStencil.

Definition at line 279 of file cellVolumeWeightCellCellStencil.H.

References cellVolumeWeight::cellInterpolationWeight_.

◆ stencilWeights()

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

Calculate inverse distance weights for a single acceptor. Revert.

to inverse distance (so not consistent with volume overlap!)

Implements cellCellStencil.

Definition at line 1100 of file cellVolumeWeightCellCellStencil.C.

References forAll, Foam::mag(), List< T >::setSize(), UList< T >::size(), and Foam::sum().

Here is the call graph for this function:

Member Data Documentation

◆ defaultOverlapTolerance_

Foam::scalar defaultOverlapTolerance_ = 1e-6
staticprotected

Default overlap tolerance. Fraction of volume.

Definition at line 61 of file cellVolumeWeightCellCellStencil.H.

◆ dict_

const dictionary dict_
protected

Dictionary of motion control parameters.

Definition at line 69 of file cellVolumeWeightCellCellStencil.H.

◆ overlapTolerance_

scalar overlapTolerance_
protected

Tolerance for volume overlap. Fraction of volume.

Definition at line 74 of file cellVolumeWeightCellCellStencil.H.

Referenced by cellVolumeWeight::overlapTolerance().

◆ cellTypes_

labelList cellTypes_
protected

Per cell the cell type.

Definition at line 79 of file cellVolumeWeightCellCellStencil.H.

Referenced by cellVolumeWeight::cellTypes().

◆ interpolationCells_

labelList interpolationCells_
protected

Indices of interpolated cells.

Definition at line 84 of file cellVolumeWeightCellCellStencil.H.

Referenced by cellVolumeWeight::interpolationCells().

◆ cellInterpolationMap_

autoPtr<mapDistribute> cellInterpolationMap_
protected

Fetch interpolated cells.

Definition at line 89 of file cellVolumeWeightCellCellStencil.H.

Referenced by cellVolumeWeight::cellInterpolationMap().

◆ cellStencil_

labelListList cellStencil_
protected

Interpolation stencil.

Definition at line 94 of file cellVolumeWeightCellCellStencil.H.

Referenced by cellVolumeWeight::cellStencil().

◆ cellInterpolationWeights_

List<scalarList> cellInterpolationWeights_
protected

Interpolation weights.

Definition at line 99 of file cellVolumeWeightCellCellStencil.H.

Referenced by cellVolumeWeight::cellInterpolationWeights().

◆ cellInterpolationWeight_

volScalarField cellInterpolationWeight_
protected

Amount of interpolation.

Definition at line 104 of file cellVolumeWeightCellCellStencil.H.

Referenced by cellVolumeWeight::cellInterpolationWeight().

◆ allowInterpolatedDonors_

const bool allowInterpolatedDonors_
protected

Allow interpolared as donors.

Definition at line 109 of file cellVolumeWeightCellCellStencil.H.


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