Inverse-distance-weighted interpolation stencil. More...
#include <trackingInverseDistanceCellCellStencil.H>
Public Member Functions | |
| TypeName ("trackingInverseDistance") | |
| Runtime type information. | |
| trackingInverseDistance (const fvMesh &, const dictionary &, const bool) | |
| Construct from fvMesh. | |
| virtual | ~trackingInverseDistance () |
| Destructor. | |
| virtual bool | update () |
| Update stencils. Return false if nothing changed. | |
| Public Member Functions inherited from inverseDistance | |
| TypeName ("inverseDistance") | |
| Runtime type information. | |
| inverseDistance (const fvMesh &, const dictionary &, const bool) | |
| Construct from fvMesh. | |
| virtual | ~inverseDistance () |
| Destructor. | |
| 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 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. | |
| void | markDonors (PstreamBuffers &pBufs, const List< treeBoundBoxList > &meshBb, const PtrList< voxelMeshSearch > &meshSearches, const labelList &allCellTypes, const label srcI, const label tgtI, labelListList &allStencil, labelList &allDonor) const |
| Protected Member Functions inherited from inverseDistance | |
| 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 bool | markBoundaries (const fvMesh &mesh, const vector &smallVec, const boundBox &bb, 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 inverseDistance | |
| 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 | |
| globalIndex | globalCells_ |
| Global indexing for cells. | |
| labelList | globalDonor_ |
| Current (global) donor cell. | |
| PtrList< fvMeshSubset > | meshParts_ |
| Subset according to zone. | |
| Protected Attributes inherited from inverseDistance | |
| 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.
Definition at line 52 of file trackingInverseDistanceCellCellStencil.H.
| trackingInverseDistance | ( | const fvMesh & | mesh, |
| const dictionary & | dict, | ||
| const bool | doUpdate ) |
Construct from fvMesh.
Definition at line 492 of file trackingInverseDistanceCellCellStencil.C.
References Foam::decrIndent(), dict, Foam::endl(), forAll, globalCells_, globalDonor_, Foam::GlobalIOList< Tuple2< scalar, vector > >::typeName, Foam::gMax(), Foam::incrIndent(), Foam::indent(), Foam::Info, Pstream::listReduce(), mesh, cellCellStencil::mesh_, meshParts_, update(), Foam::Zero, and cellCellStencil::zoneID().
|
virtual |
Destructor.
Definition at line 557 of file trackingInverseDistanceCellCellStencil.C.
|
staticprotected |
Mark voxels of patchTypes with type of patch face.
Definition at line 48 of file trackingInverseDistanceCellCellStencil.C.
References fvPatch::constraintType(), boundBox::contains(), Foam::endl(), fvPatch::faceCells(), voxelMeshSearch::fill(), forAll, boundBox::grow(), Foam::isA(), mesh, cellCellStencil::OTHER, boundBox::overlaps(), voxelMeshSearch::overlaps(), cellCellStencil::OVERSET, cellCellStencil::PATCH, fvPatch::patch(), patchTypes(), pbm, Foam::Pout, pp(), and WarningInFunction.
Referenced by update().
|
protected |
Mark all cells overlapping (a voxel covered by) a src patch.
with type HOLE
Definition at line 189 of file trackingInverseDistanceCellCellStencil.C.
References UPstream::allProcs(), PstreamBuffers::clear(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, PstreamBuffers::finishedSends(), forAll, boundBox::grow(), cellCellStencil::HOLE, cellCellStencil::mesh_, meshParts_, UPstream::myProcNo(), os(), treeBoundBox::overlaps(), voxelMeshSearch::overlaps(), cellCellStencil::PATCH, and inverseDistance::smallVec_.
Referenced by update().
|
protected |
Definition at line 310 of file trackingInverseDistanceCellCellStencil.C.
References Foam::abort(), UPstream::allProcs(), DynamicList< T, SizeMin >::append(), List< T >::append(), inverseDistance::betterDonor(), waveMethod::calculate(), polyMesh::CELL_TETS, primitiveMesh::cellCentres(), PstreamBuffers::clear(), Foam::FatalError, FatalErrorInFunction, polyMesh::findCell(), PstreamBuffers::finishedSends(), forAll, globalCells_, boundBox::grow(), cellCellStencil::HOLE, cellCellStencil::mesh_, meshBb(), meshParts_, UPstream::myProcNo(), primitiveMesh::nCells(), UPstream::nProcs(), os(), inverseDistance::overlaps(), treeBoundBox::overlaps(), samples(), List< T >::setSize(), UList< T >::size(), inverseDistance::smallVec_, and polyMesh::tetBasePtIs().
Referenced by update().
| TypeName | ( | "trackingInverseDistance" | ) |
Runtime type information.
|
virtual |
Update stencils. Return false if nothing changed.
Reimplemented from inverseDistance.
Definition at line 563 of file trackingInverseDistanceCellCellStencil.C.
References Pstream::allGatherList(), inverseDistance::allowHoleDonors_, inverseDistance::allowInterpolatedDonors_, cellCellStencil::CALCULATED, inverseDistance::cellInterpolationMap(), inverseDistance::cellInterpolationMap_, inverseDistance::cellInterpolationWeight_, inverseDistance::cellInterpolationWeights_, inverseDistance::cellStencil_, inverseDistance::cellTypes_, List< T >::clear(), Foam::cmptProduct(), oversetFvMeshBase::correctBoundaryConditions(), cellCellStencil::createField(), Foam::createField(), inverseDistance::createStencil(), DebugInfo, inverseDistance::dict_, mapDistribute::distribute(), e, Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, inverseDistance::findHoles(), forAll, FUNCTION_NAME, globalCells_, Foam::GlobalIOList< Tuple2< scalar, vector > >::typeName, cellCellStencil::HOLE, inverseDistance::holeExtrapolationStencil(), Foam::Info, cellCellStencil::info(), cellCellStencil::INTERPOLATED, inverseDistance::interpolationCells(), inverseDistance::interpolationCells_, markBoundaries(), markDonors(), markPatchesAsHoles(), cellCellStencil::mesh_, meshBb(), meshParts_, boundBox::min(), Foam::mkDir(), fvMesh::movePoints(), UPstream::myProcNo(), Foam::name(), OFstream::name(), IOobjectOption::NO_READ, primitiveMesh::nPoints(), UPstream::nProcs(), IOobject::objectPath(), cellCellStencil::OTHER, cellCellStencil::OVERSET, polyMesh::points(), cellCellStencil::POROUS, Foam::Pout, Foam::reduce(), PtrList< T >::set(), List< T >::setSize(), PtrList< T >::setSize(), UList< T >::size(), UPtrList< T >::size(), inverseDistance::smallVec_, boundBox::span(), cellCellStencil::walkFront(), OBJstream::writeLine(), Foam::Zero, and cellCellStencil::zoneID().
Referenced by trackingInverseDistance().
|
protected |
Global indexing for cells.
Definition at line 63 of file trackingInverseDistanceCellCellStencil.H.
Referenced by markDonors(), trackingInverseDistance(), and update().
|
protected |
Current (global) donor cell.
Definition at line 68 of file trackingInverseDistanceCellCellStencil.H.
Referenced by trackingInverseDistance().
|
protected |
Subset according to zone.
Definition at line 73 of file trackingInverseDistanceCellCellStencil.H.
Referenced by markDonors(), markPatchesAsHoles(), trackingInverseDistance(), and update().