Inverse-distance-weighted interpolation stencil. More...
#include <inverseDistanceCellCellStencil.H>


Classes | |
| struct | interpolatedDonorSet |
| Data for a set of interpolated/donor set. More... | |
Public Member Functions | |
| TypeName ("inverseDistance") | |
| Runtime type information. | |
| inverseDistance (const fvMesh &, const dictionary &, const bool) | |
| Construct from fvMesh. | |
| virtual | ~inverseDistance () |
| Destructor. | |
| virtual bool | update () |
| Update stencils. Return false if nothing changed. | |
| virtual const labelUList & | cellTypes () const |
| Return the cell type list. | |
| virtual const labelUList & | interpolationCells () const |
| Indices of interpolated cells. | |
| virtual const mapDistribute & | cellInterpolationMap () const |
| Return a communication schedule. | |
| virtual const labelListList & | cellStencil () const |
| Per interpolated cell the neighbour cells (in terms of slots as. | |
| virtual const scalarListList & | cellInterpolationWeights () const |
| Weights for cellStencil. | |
| virtual const scalarList & | cellInterpolationWeight () const |
| Per interpolated cell the interpolation factor. (0 = use. | |
| virtual void | stencilWeights (const point &sample, const pointList &donorCcs, scalarList &weights) const |
| Calculate inverse distance weights for a single acceptor. | |
| Public Member Functions inherited from cellCellStencil | |
| 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 const wordHashSet & | nonInterpolatedFields () const |
| Return the names of any (stencil or mesh specific) fields that. | |
| virtual wordHashSet & | nonInterpolatedFields () |
| Return non-const non-interpolating fields. | |
| bool | localStencil (const labelUList &) const |
| Helper: is stencil fully local. | |
| const labelIOList & | zoneID () 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::volScalarField > | createField (const fvMesh &mesh, const word &name, const UList< Type > &psi) |
Protected Member Functions | |
| void | markPatchesAsHoles (PstreamBuffers &pBufs, const PtrList< fvMeshSubset > &meshParts, const List< treeBoundBoxList > &patchBb, const List< labelVector > &patchDivisions, const PtrList< PackedList< 2 > > &patchParts, const label srcI, const label tgtI, labelList &allCellTypes) const |
| Mark all cells overlapping (a voxel covered by) a src patch. | |
| bool | betterDonor (const label destMesh, const label currentDonorMesh, const label newDonorMesh) const |
| If multiple donors meshes: decide which is best. | |
| void | markDonors (const globalIndex &globalCells, PstreamBuffers &pBufs, const PtrList< fvMeshSubset > &meshParts, const List< treeBoundBoxList > &meshBb, const labelList &allCellTypes, const label srcI, const label tgtI, labelListList &allStencil, labelList &allDonor) const |
| Determine donors for all tgt cells. | |
| void | uncompactedRegionSplit (const fvMesh &mesh, const globalIndex &globalFaces, const label nZones, const labelList &zoneID, const labelList &cellTypes, const boolList &isBlockedFace, labelList &cellRegion) const |
| Replacement of regionSplit. | |
| autoPtr< globalIndex > | compactedRegionSplit (const fvMesh &mesh, const globalIndex &globalFaces, labelList &cellRegion) const |
| void | findHoles (const globalIndex &globalCells, const fvMesh &mesh, const labelList &zoneID, const labelListList &stencil, labelList &cellTypes) const |
| Do flood filling to detect unreachable (from patches) sections. | |
| void | seedCell (const label cellI, const scalar wantedFraction, bitSet &isFront, scalarField &fraction) const |
| Seed faces of cell with wantedFraction (if higher than current). | |
| virtual void | createStencil (const globalIndex &, const bool allowHoleDonors) |
| Create stencil starting from the donor containing the acceptor allowHoleDonors : allow donors of type HOLE (otherwise are filtered out). | |
| void | holeExtrapolationStencil (const globalIndex &globalCells) |
| Make holes next to live ones type SPECIAL and include in interpolation stencil. | |
| Protected Member Functions inherited from cellCellStencil | |
| void | suppressMotionFields () |
| Helper: populate nonInterpolatedFields_ with motion solver. | |
Static Protected Member Functions | |
| static label | index (const labelVector &nDivs, const labelVector &) |
| Convert ijk indices into single index. | |
| static labelVector | index3 (const labelVector &nDivs, const label) |
| Convert single index into ijk. | |
| static labelVector | index3 (const boundBox &bb, const labelVector &nDivs, const point &pt) |
| Convert coordinate into ijk. | |
| static point | position (const boundBox &bb, const labelVector &nDivs, const label boxI) |
| Convert index back into coordinate. | |
| static void | fill (PackedList< 2 > &elems, const boundBox &bb, const labelVector &nDivs, const boundBox &subBb, const unsigned int val) |
| Fill all elements overlapping subBb with value val. | |
| static bool | overlaps (const boundBox &bb, const labelVector &nDivs, const PackedList< 2 > &voxels, const treeBoundBox &subBb, const unsigned int val) |
| Is any voxel inside subBb set to val. | |
| static void | markBoundaries (const fvMesh &mesh, const vector &smallVec, const boundBox &bb, const labelVector &nDivs, PackedList< 2 > &patchTypes, const labelList &cellMap, labelList &patchCellTypes) |
| Mark voxels of patchTypes with type of patch face. | |
| Static Protected Member Functions inherited from cellCellStencil | |
| template<class Type> | |
| static tmp< volScalarField > | createField (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 dictionary | dict_ |
| Dictionary of motion control parameters. | |
| const bool | allowHoleDonors_ |
| Allow holes as donors. | |
| const bool | allowInterpolatedDonors_ |
| Allow interpolared as donors. | |
| vector | smallVec_ |
| Small perturbation vector for geometric tests. | |
| labelList | cellTypes_ |
| Per cell the cell type. | |
| labelList | interpolationCells_ |
| Indices of interpolated cells. | |
| autoPtr< mapDistribute > | cellInterpolationMap_ |
| Fetch interpolated cells. | |
| labelListList | cellStencil_ |
| Interpolation stencil. | |
| scalarListList | cellInterpolationWeights_ |
| Interpolation weights. | |
| volScalarField | cellInterpolationWeight_ |
| Amount of interpolation. | |
| Protected Attributes inherited from cellCellStencil | |
| const fvMesh & | mesh_ |
| Reference to the mesh. | |
| wordHashSet | nonInterpolatedFields_ |
| Set of fields that should not be interpolated. | |
| const dictionary | dict_ |
| Dictionary of motion control parameters. | |
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< cellCellStencil > | New (const fvMesh &, const dictionary &dict, const bool update=true) |
| New function which constructs and returns pointer to a. | |
| static const labelIOList & | zoneID (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. | |
| Static Protected Attributes inherited from cellCellStencil | |
| static const Enum< cellType > | cellTypeNames_ |
| Mode type names. | |
Inverse-distance-weighted interpolation stencil.
hole finding:
Definition at line 63 of file inverseDistanceCellCellStencil.H.
| inverseDistance | ( | const fvMesh & | mesh, |
| const dictionary & | dict, | ||
| const bool | doUpdate ) |
Construct from fvMesh.
Definition at line 1701 of file inverseDistanceCellCellStencil.C.
References allowHoleDonors_, allowInterpolatedDonors_, cellCellStencil::CALCULATED, cellInterpolationMap_, cellInterpolationWeight_, cellInterpolationWeights_, cellStencil_, cellTypes_, dict, dict_, Foam::dimless, Foam::endl(), forAll, interpolationCells_, io, mesh, cellCellStencil::mesh_, IOobjectOption::NO_REGISTER, IOobjectOption::NO_WRITE, Foam::Pout, IOobjectOption::READ_IF_PRESENT, smallVec_, cellCellStencil::suppressMotionFields(), update(), Foam::Zero, and cellCellStencil::zoneID().

|
virtual |
Destructor.
Definition at line 1778 of file inverseDistanceCellCellStencil.C.
|
staticprotected |
Convert ijk indices into single index.
Definition at line 55 of file inverseDistanceCellCellStencil.C.
Referenced by fill(), and overlaps().

|
staticprotected |
Convert single index into ijk.
Definition at line 65 of file inverseDistanceCellCellStencil.C.
References k.
Referenced by fill(), overlaps(), and position().

|
staticprotected |
Convert coordinate into ijk.
Definition at line 80 of file inverseDistanceCellCellStencil.C.
References boundBox::min(), and boundBox::span().

|
staticprotected |
Convert index back into coordinate.
Definition at line 99 of file inverseDistanceCellCellStencil.C.
References index3(), boundBox::min(), and boundBox::span().

|
staticprotected |
Fill all elements overlapping subBb with value val.
Definition at line 116 of file inverseDistanceCellCellStencil.C.
References index(), index3(), k, boundBox::max(), Foam::max(), boundBox::min(), Foam::min(), and VectorSpace< Form, Cmpt, Ncmpts >::zero.
Referenced by markBoundaries().


|
staticprotected |
Is any voxel inside subBb set to val.
Definition at line 230 of file inverseDistanceCellCellStencil.C.
References index(), index3(), k, boundBox::max(), Foam::max(), boundBox::min(), Foam::min(), cellCellStencil::PATCH, and VectorSpace< Form, Cmpt, Ncmpts >::zero.
Referenced by markDonors(), trackingInverseDistance::markDonors(), and markPatchesAsHoles().


|
staticprotected |
Mark voxels of patchTypes with type of patch face.
Definition at line 154 of file inverseDistanceCellCellStencil.C.
References fvPatch::constraintType(), fvPatch::faceCells(), fill(), forAll, boundBox::grow(), Foam::isA(), mesh, cellCellStencil::OTHER, boundBox::overlaps(), cellCellStencil::OVERSET, cellCellStencil::PATCH, fvPatch::patch(), patchTypes(), pbm, and pp().
Referenced by update().


|
protected |
Mark all cells overlapping (a voxel covered by) a src patch.
with type HOLE
Definition at line 274 of file inverseDistanceCellCellStencil.C.
References UPstream::allProcs(), PstreamBuffers::clear(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, PstreamBuffers::finishedSends(), forAll, boundBox::grow(), cellCellStencil::HOLE, cellCellStencil::mesh_, UPstream::myProcNo(), os(), overlaps(), treeBoundBox::overlaps(), cellCellStencil::PATCH, and smallVec_.
Referenced by update().


|
protected |
If multiple donors meshes: decide which is best.
Definition at line 398 of file inverseDistanceCellCellStencil.C.
References Foam::mag().
Referenced by markDonors(), and trackingInverseDistance::markDonors().


|
protected |
Determine donors for all tgt cells.
Definition at line 440 of file inverseDistanceCellCellStencil.C.
References Foam::abort(), UPstream::allProcs(), DynamicList< T, SizeMin >::append(), List< T >::append(), betterDonor(), waveMethod::calculate(), polyMesh::CELL_TETS, primitiveMesh::cellCentres(), PstreamBuffers::clear(), Foam::FatalError, FatalErrorInFunction, polyMesh::findCell(), PstreamBuffers::finishedSends(), forAll, boundBox::grow(), cellCellStencil::HOLE, cellCellStencil::mesh_, meshBb(), UPstream::myProcNo(), primitiveMesh::nCells(), UPstream::nProcs(), os(), overlaps(), treeBoundBox::overlaps(), samples(), List< T >::setSize(), UList< T >::size(), smallVec_, polyMesh::tetBasePtIs(), and globalIndex::toGlobal().
Referenced by update().


|
protected |
Replacement of regionSplit.
References cellTypes(), isBlockedFace(), mesh, and cellCellStencil::zoneID().

|
protected |
References cellTypes(), mesh, and cellCellStencil::zoneID().

|
protected |
Do flood filling to detect unreachable (from patches) sections.
of mesh
Definition at line 893 of file inverseDistanceCellCellStencil.C.
References cellTypes(), fvPatch::constraintType(), DebugInfo, mapDistribute::distribute(), Foam::endl(), fvPatch::faceCells(), Foam::findIndices(), forAll, FUNCTION_NAME, cellCellStencil::HOLE, Foam::isA(), isBlockedFace(), Pstream::listReduce(), mesh, regionSplit::nRegions(), pbm, Foam::reduce(), UList< T >::size(), syncTools::swapBoundaryCellList(), Foam::Zero, and cellCellStencil::zoneID().
Referenced by update(), and trackingInverseDistance::update().


|
protected |
Seed faces of cell with wantedFraction (if higher than current).
|
protectedvirtual |
Create stencil starting from the donor containing the acceptor allowHoleDonors : allow donors of type HOLE (otherwise are filtered out).
Note: empty slots can happen for interpolated cells with
bad/insufficient donors. These are handled later on.
Definition at line 1501 of file inverseDistanceCellCellStencil.C.
References Foam::abort(), cellInterpolationMap(), cellInterpolationMap_, cellInterpolationWeights_, cellStencil_, cellTypes_, mapDistributeBase::distribute(), Foam::FatalError, FatalErrorInFunction, forAll, cellCellStencil::globalCellCells(), cellCellStencil::HOLE, interpolationCells_, cellCellStencil::mesh_, UPstream::msgType(), UPstream::nonBlocking, nSamples(), List< T >::null(), Foam::returnReduceOr(), samples(), bitSet::set(), UList< T >::size(), and stencilWeights().
Referenced by update(), and trackingInverseDistance::update().


|
protected |
Make holes next to live ones type SPECIAL and include in interpolation stencil.
Definition at line 1209 of file inverseDistanceCellCellStencil.C.
References DynamicList< T, SizeMin >::append(), List< T >::append(), cellCellStencil::CALCULATED, cellInterpolationMap(), cellInterpolationMap_, cellInterpolationWeight_, cellInterpolationWeights_, cellStencil_, cellTypes_, UList< T >::data(), mapDistributeBase::distribute(), Foam::endl(), forAll, cellCellStencil::HOLE, Foam::identity(), globalIndex::inplaceToGlobal(), cellCellStencil::INTERPOLATED, interpolationCells_, Foam::labelMin, cellCellStencil::mesh_, UPstream::myProcNo(), Foam::nl, UPstream::nonBlocking, Foam::Pout, Foam::reduce(), cellCellStencil::SPECIAL, stencilWeights(), syncTools::swapBoundaryCellList(), and globalIndex::toGlobal().
Referenced by update(), and trackingInverseDistance::update().


| TypeName | ( | "inverseDistance" | ) |
Runtime type information.
|
virtual |
Update stencils. Return false if nothing changed.
Implements cellCellStencil.
Reimplemented in trackingInverseDistance.
Definition at line 1784 of file inverseDistanceCellCellStencil.C.
References Pstream::allGatherList(), allowHoleDonors_, allowInterpolatedDonors_, boundaryFieldRef(), cellCellStencil::CALCULATED, Foam::cbrt(), cellInterpolationMap(), cellInterpolationMap_, cellInterpolationWeight_, cellInterpolationWeights_, cellStencil_, cellTypes_, List< T >::clear(), oversetFvMeshBase::correctBoundaryConditions(), cellCellStencil::count(), Foam::createField(), createStencil(), DebugInfo, Foam::decrIndent(), dict_, mapDistribute::distribute(), e, Foam::endl(), findHoles(), forAll, dictionary::found(), FUNCTION_NAME, dictionary::getOrDefault(), Foam::gMax(), cellCellStencil::HOLE, holeExtrapolationStencil(), Foam::incrIndent(), Foam::indent(), Foam::Info, cellCellStencil::INTERPOLATED, interpolationCells(), interpolationCells_, Pstream::listReduce(), Foam::mag(), markBoundaries(), markDonors(), markPatchesAsHoles(), cellCellStencil::mesh_, meshBb(), boundBox::min(), Foam::mkDir(), UPstream::myProcNo(), Foam::name(), OFstream::name(), polyMesh::nGeometricD(), Foam::nl, primitiveMesh::nPoints(), UPstream::nProcs(), cellCellStencil::OTHER, cellCellStencil::OVERSET, polyMesh::points(), cellCellStencil::POROUS, Foam::Pout, Foam::reduce(), tmp< T >::ref(), Foam::returnReduce(), PtrList< T >::set(), List< T >::setSize(), UList< T >::size(), UPtrList< T >::size(), smallVec_, boundBox::span(), Foam::sqrt(), dictionary::subDict(), Foam::type(), cellCellStencil::walkFront(), OBJstream::writeLine(), Foam::Zero, and cellCellStencil::zoneID().
Referenced by inverseDistance(), and leastSquares::leastSquares().


|
inlinevirtual |
Return the cell type list.
Implements cellCellStencil.
Definition at line 362 of file inverseDistanceCellCellStencil.H.
References cellTypes_.
Referenced by compactedRegionSplit(), findHoles(), and uncompactedRegionSplit().

|
inlinevirtual |
Indices of interpolated cells.
Implements cellCellStencil.
Definition at line 370 of file inverseDistanceCellCellStencil.H.
References interpolationCells_.
Referenced by update(), and trackingInverseDistance::update().

|
inlinevirtual |
Return a communication schedule.
Implements cellCellStencil.
Definition at line 378 of file inverseDistanceCellCellStencil.H.
References cellInterpolationMap_.
Referenced by createStencil(), holeExtrapolationStencil(), update(), and trackingInverseDistance::update().

|
inlinevirtual |
Per interpolated cell the neighbour cells (in terms of slots as.
constructed by above cellInterpolationMap) to interpolate
Implements cellCellStencil.
Definition at line 392 of file inverseDistanceCellCellStencil.H.
References cellStencil_.
|
inlinevirtual |
Weights for cellStencil.
Implements cellCellStencil.
Definition at line 400 of file inverseDistanceCellCellStencil.H.
References cellInterpolationWeights_.
|
inlinevirtual |
Per interpolated cell the interpolation factor. (0 = use.
calculated, 1 = use interpolated)
Implements cellCellStencil.
Definition at line 410 of file inverseDistanceCellCellStencil.H.
References cellInterpolationWeight_.
|
virtual |
Calculate inverse distance weights for a single acceptor.
Implements cellCellStencil.
Reimplemented in leastSquares.
Definition at line 1174 of file inverseDistanceCellCellStencil.C.
References forAll, Foam::mag(), List< T >::setSize(), UList< T >::size(), and Foam::sum().
Referenced by createStencil(), and holeExtrapolationStencil().


|
protected |
Dictionary of motion control parameters.
Definition at line 87 of file inverseDistanceCellCellStencil.H.
Referenced by inverseDistance(), update(), and trackingInverseDistance::update().
|
protected |
Allow holes as donors.
Definition at line 92 of file inverseDistanceCellCellStencil.H.
Referenced by inverseDistance(), update(), and trackingInverseDistance::update().
|
protected |
Allow interpolared as donors.
Definition at line 97 of file inverseDistanceCellCellStencil.H.
Referenced by inverseDistance(), update(), and trackingInverseDistance::update().
|
protected |
Small perturbation vector for geometric tests.
Definition at line 102 of file inverseDistanceCellCellStencil.H.
Referenced by inverseDistance(), markDonors(), trackingInverseDistance::markDonors(), markPatchesAsHoles(), trackingInverseDistance::markPatchesAsHoles(), update(), and trackingInverseDistance::update().
|
protected |
Per cell the cell type.
Definition at line 107 of file inverseDistanceCellCellStencil.H.
Referenced by cellTypes(), createStencil(), holeExtrapolationStencil(), inverseDistance(), update(), and trackingInverseDistance::update().
|
protected |
Indices of interpolated cells.
Definition at line 112 of file inverseDistanceCellCellStencil.H.
Referenced by createStencil(), holeExtrapolationStencil(), interpolationCells(), inverseDistance(), update(), and trackingInverseDistance::update().
|
protected |
Fetch interpolated cells.
Definition at line 117 of file inverseDistanceCellCellStencil.H.
Referenced by cellInterpolationMap(), createStencil(), holeExtrapolationStencil(), inverseDistance(), update(), and trackingInverseDistance::update().
|
protected |
Interpolation stencil.
Definition at line 122 of file inverseDistanceCellCellStencil.H.
Referenced by cellStencil(), createStencil(), holeExtrapolationStencil(), inverseDistance(), update(), and trackingInverseDistance::update().
|
protected |
Interpolation weights.
Definition at line 127 of file inverseDistanceCellCellStencil.H.
Referenced by cellInterpolationWeights(), createStencil(), holeExtrapolationStencil(), inverseDistance(), update(), and trackingInverseDistance::update().
|
protected |
Amount of interpolation.
Definition at line 132 of file inverseDistanceCellCellStencil.H.
Referenced by cellInterpolationWeight(), holeExtrapolationStencil(), inverseDistance(), update(), and trackingInverseDistance::update().