Inverse-distance-weighted interpolation stencil. More...
Public Member Functions | |
TypeName ("inverseDistance") | |
Runtime type information. More... | |
inverseDistance (const fvMesh &, const dictionary &, const bool) | |
Construct from fvMesh. More... | |
virtual | ~inverseDistance () |
Destructor. More... | |
virtual bool | update () |
Update stencils. Return false if nothing changed. More... | |
virtual const labelUList & | cellTypes () const |
Return the cell type list. More... | |
virtual const labelUList & | interpolationCells () const |
Indices of interpolated cells. More... | |
virtual const mapDistribute & | cellInterpolationMap () const |
Return a communication schedule. More... | |
virtual const labelListList & | cellStencil () const |
Per interpolated cell the neighbour cells (in terms of slots as. More... | |
virtual const scalarListList & | cellInterpolationWeights () const |
Weights for cellStencil. More... | |
virtual const scalarList & | cellInterpolationWeight () 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. 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 bool | update ()=0 |
Update stencils. Return false if nothing changed. More... | |
virtual const labelUList & | cellTypes () const =0 |
Return the cell type list. More... | |
virtual const labelUList & | interpolationCells () const =0 |
Indices of interpolated cells. More... | |
virtual const mapDistribute & | cellInterpolationMap () const =0 |
Return a communication schedule. More... | |
virtual const labelListList & | cellStencil () const =0 |
Per interpolated cell the neighbour cells (in terms of slots as. More... | |
virtual const List< scalarList > & | cellInterpolationWeights () const =0 |
Weights for cellStencil. More... | |
virtual const scalarList & | cellInterpolationWeight () const =0 |
Per interpolated cell the interpolation factor. (0 = use. More... | |
virtual void | stencilWeights (const point &sample, const pointList &donorCcs, scalarList &weights) const =0 |
Calculate weights for a single acceptor. More... | |
virtual const wordHashSet & | nonInterpolatedFields () const |
Return the names of any (stencil or mesh specific) fields that. More... | |
virtual wordHashSet & | nonInterpolatedFields () |
Return non-const non-interpolating fields. More... | |
bool | localStencil (const labelUList &) const |
Helper: is stencil fully local. More... | |
const labelIOList & | zoneID () const |
Helper: get reference to registered zoneID. Loads volScalarField. More... | |
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. More... | |
bool | betterDonor (const label destMesh, const label currentDonorMesh, const label newDonorMesh) const |
If multiple donors meshes: decide which is best. More... | |
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. More... | |
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. More... | |
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. 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... | |
void | walkFront (const scalar layerRelax, const labelListList &allStencil, labelList &allCellTypes, scalarField &allWeight) const |
Surround holes with layer(s) of interpolated cells. More... | |
virtual void | createStencil (const globalIndex &) |
Create stencil starting from the donor containing the acceptor. More... | |
Static Protected Member Functions | |
static label | index (const labelVector &nDivs, const labelVector &) |
Convert ijk indices into single index. More... | |
static labelVector | index3 (const labelVector &nDivs, const label) |
Convert single index into ijk. More... | |
static labelVector | index3 (const boundBox &bb, const labelVector &nDivs, const point &pt) |
Convert coordinate into ijk. More... | |
static point | position (const boundBox &bb, const labelVector &nDivs, const label boxI) |
Convert index back into coordinate. More... | |
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. More... | |
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. More... | |
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. More... | |
static treeBoundBox | cellBb (const primitiveMesh &mesh, const label celli) |
Calculate bounding box of cell. More... | |
Static Protected Member Functions inherited from cellCellStencil | |
static labelList | count (const label size, const labelUList &lst) |
Count occurrences (in parallel) More... | |
template<class Type > | |
static tmp< volScalarField > | createField (const fvMesh &mesh, const word &name, const UList< Type > &) |
Helper: create volScalarField for postprocessing. More... | |
Protected Attributes | |
const dictionary | dict_ |
Dictionary of motion control parameters. More... | |
vector | smallVec_ |
Small perturbation vector for geometric tests. More... | |
labelList | cellTypes_ |
Per cell the cell type. More... | |
labelList | interpolationCells_ |
Indices of interpolated cells. More... | |
autoPtr< mapDistribute > | cellInterpolationMap_ |
Fetch interpolated cells. More... | |
labelListList | cellStencil_ |
Interpolation stencil. More... | |
scalarListList | cellInterpolationWeights_ |
Interpolation weights. More... | |
volScalarField | cellInterpolationWeight_ |
Amount of interpolation. More... | |
Protected Attributes inherited from cellCellStencil | |
const fvMesh & | mesh_ |
Reference to the mesh. More... | |
wordHashSet | nonInterpolatedFields_ |
Set of fields that should not be interpolated. 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 } |
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. More... | |
static const labelIOList & | zoneID (const fvMesh &) |
Helper: get reference to registered zoneID. Loads volScalarField. 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... | |
Static Protected Attributes inherited from cellCellStencil | |
static const Enum< cellType > | cellTypeNames_ |
Mode type names. More... | |
Inverse-distance-weighted interpolation stencil.
hole finding:
Definition at line 67 of file inverseDistanceCellCellStencil.H.
inverseDistance | ( | const fvMesh & | mesh, |
const dictionary & | dict, | ||
const bool | doUpdate | ||
) |
Construct from fvMesh.
Definition at line 1643 of file inverseDistanceCellCellStencil.C.
References inverseDistance::cellTypes_, Foam::endl(), forAll, HashSet< Key, Hash >::insert(), io(), cellCellStencil::mesh_, IOobject::NO_WRITE, cellCellStencil::nonInterpolatedFields_, Foam::Pout, IOobject::READ_IF_PRESENT, fvMesh::time(), Time::timeName(), IOobject::typeHeaderOk(), inverseDistance::update(), and cellCellStencil::zoneID().
|
virtual |
Destructor.
Definition at line 1724 of file inverseDistanceCellCellStencil.C.
|
staticprotected |
Convert ijk indices into single index.
Definition at line 59 of file inverseDistanceCellCellStencil.C.
|
staticprotected |
Convert single index into ijk.
Definition at line 69 of file inverseDistanceCellCellStencil.C.
References k.
|
staticprotected |
Convert coordinate into ijk.
Definition at line 84 of file inverseDistanceCellCellStencil.C.
References boundBox::min(), and boundBox::span().
|
staticprotected |
Convert index back into coordinate.
Definition at line 103 of file inverseDistanceCellCellStencil.C.
References boundBox::min(), and boundBox::span().
|
staticprotected |
Fill all elements overlapping subBb with value val.
Definition at line 120 of file inverseDistanceCellCellStencil.C.
References k, boundBox::max(), Foam::max(), boundBox::min(), and Foam::min().
|
staticprotected |
Is any voxel inside subBb set to val.
Definition at line 270 of file inverseDistanceCellCellStencil.C.
References k, boundBox::max(), Foam::max(), boundBox::min(), and Foam::min().
|
staticprotected |
Mark voxels of patchTypes with type of patch face.
Definition at line 158 of file inverseDistanceCellCellStencil.C.
References cyclicACMIPointPatch::constraintType(), fvPatch::faceCells(), forAll, boundBox::max(), mesh, boundBox::min(), boundBox::overlaps(), fvPatch::patch(), patchTypes(), and PrimitivePatch< FaceList, PointField >::points().
|
staticprotected |
Calculate bounding box of cell.
Definition at line 236 of file inverseDistanceCellCellStencil.C.
References cells, f(), forAll, boundBox::max(), Foam::max(), mesh, boundBox::min(), Foam::min(), p, and points.
|
protected |
Mark all cells overlapping (a voxel covered by) a src patch.
with type HOLE
Definition at line 314 of file inverseDistanceCellCellStencil.C.
References PstreamBuffers::allProcs(), PstreamBuffers::clear(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, PstreamBuffers::finishedSends(), forAll, boundBox::max(), meshParts(), boundBox::min(), processorFaPatch::myProcNo(), os(), and treeBoundBox::overlaps().
|
protected |
If multiple donors meshes: decide which is best.
Definition at line 440 of file inverseDistanceCellCellStencil.C.
References Foam::mag().
|
protected |
Determine donors for all tgt cells.
Definition at line 482 of file inverseDistanceCellCellStencil.C.
References Foam::abort(), PstreamBuffers::allProcs(), DynamicList< T, SizeMin >::append(), List< T >::append(), polyMesh::CELL_TETS, primitiveMesh::cellCentres(), cellIDs, PstreamBuffers::clear(), Foam::FatalError, FatalErrorInFunction, polyMesh::findCell(), PstreamBuffers::finishedSends(), forAll, boundBox::max(), meshBb(), meshParts(), boundBox::min(), processorFaPatch::myProcNo(), primitiveMesh::nCells(), PstreamBuffers::nProcs(), os(), treeBoundBox::overlaps(), samples(), List< T >::setSize(), UList< T >::size(), polyMesh::tetBasePtIs(), and globalIndex::toGlobal().
|
protected |
Replacement of regionSplit.
|
protected |
|
protected |
Do flood filling to detect unreachable (from patches) sections.
of mesh
Definition at line 931 of file inverseDistanceCellCellStencil.C.
References cellTypes, cyclicACMIPointPatch::constraintType(), DebugInfo, mapDistribute::distribute(), Foam::endl(), fvPatch::faceCells(), Foam::findIndices(), forAll, FUNCTION_NAME, Pstream::listCombineAllGather(), mesh, regionSplit::nRegions(), Foam::reduce(), UList< T >::size(), syncTools::swapBoundaryCellList(), Foam::type(), and Foam::Zero.
|
protected |
Seed faces of cell with wantedFraction (if higher than current)
Definition at line 1212 of file inverseDistanceCellCellStencil.C.
References forAll, and bitSet::set().
|
protected |
Surround holes with layer(s) of interpolated cells.
Definition at line 1233 of file inverseDistanceCellCellStencil.C.
References bitSet::any(), fvBoundaryMesh::faceCells(), forAll, Foam::returnReduce(), bitSet::set(), syncTools::swapBoundaryCellList(), syncTools::syncFaceList(), bitSet::test(), bitSet::transfer(), List< T >::transfer(), and Foam::Zero.
|
protectedvirtual |
Create stencil starting from the donor containing the acceptor.
Definition at line 1455 of file inverseDistanceCellCellStencil.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, forAll, UPstream::msgType(), UPstream::nonBlocking, nSamples(), List< T >::null(), Foam::returnReduce(), samples(), bitSet::set(), UList< T >::size(), and List< T >::transfer().
TypeName | ( | "inverseDistance" | ) |
Runtime type information.
|
virtual |
Update stencils. Return false if nothing changed.
Implements cellCellStencil.
Reimplemented in trackingInverseDistance.
Definition at line 1730 of file inverseDistanceCellCellStencil.C.
References Pstream::allGatherList(), DynamicList< T, SizeMin >::append(), Foam::cbrt(), List< T >::clear(), GeometricField< Type, PatchField, GeoMesh >::correctBoundaryConditions(), Foam::decrIndent(), e, Foam::endl(), forAll, Foam::gMax(), Foam::incrIndent(), Foam::indent(), Foam::Info, Pstream::listCombineAllGather(), Foam::mag(), meshBb(), meshParts(), boundBox::min(), Foam::mkDir(), processorFaPatch::myProcNo(), OFstream::name(), Foam::name(), nCellsPerZone(), polyMesh::nGeometricD(), Foam::nl, UPstream::nonBlocking, primitiveMesh::nPoints(), PstreamBuffers::nProcs(), nZones, polyMesh::points(), Foam::Pout, Foam::reduce(), tmp< T >::ref(), Foam::returnReduce(), PtrList< T >::set(), List< T >::setSize(), UList< T >::size(), boundBox::span(), Foam::sqrt(), List< T >::transfer(), Foam::type(), OBJstream::write(), oversetFvPatchField< Type >::write(), Foam::Zero, and zoneID.
Referenced by inverseDistance::cellInterpolationMap(), inverseDistance::inverseDistance(), and leastSquares::leastSquares().
|
inlinevirtual |
Return the cell type list.
Implements cellCellStencil.
Definition at line 292 of file inverseDistanceCellCellStencil.H.
References inverseDistance::cellTypes_.
|
inlinevirtual |
Indices of interpolated cells.
Implements cellCellStencil.
Definition at line 298 of file inverseDistanceCellCellStencil.H.
References inverseDistance::interpolationCells_.
|
inlinevirtual |
Return a communication schedule.
Implements cellCellStencil.
Definition at line 304 of file inverseDistanceCellCellStencil.H.
References inverseDistance::cellInterpolationMap_, and inverseDistance::update().
|
inlinevirtual |
Per interpolated cell the neighbour cells (in terms of slots as.
constructed by above cellInterpolationMap) to interpolate
Implements cellCellStencil.
Definition at line 315 of file inverseDistanceCellCellStencil.H.
|
inlinevirtual |
Weights for cellStencil.
Implements cellCellStencil.
Definition at line 321 of file inverseDistanceCellCellStencil.H.
References inverseDistance::cellInterpolationWeights_.
|
inlinevirtual |
Per interpolated cell the interpolation factor. (0 = use.
calculated, 1 = use interpolated)
Implements cellCellStencil.
Definition at line 328 of file inverseDistanceCellCellStencil.H.
|
virtual |
Calculate inverse distance weights for a single acceptor.
Implements cellCellStencil.
Reimplemented in leastSquares.
Definition at line 1420 of file inverseDistanceCellCellStencil.C.
References forAll, Foam::mag(), List< T >::setSize(), UList< T >::size(), and Foam::sum().
|
protected |
Dictionary of motion control parameters.
Definition at line 76 of file inverseDistanceCellCellStencil.H.
|
protected |
Small perturbation vector for geometric tests.
Definition at line 79 of file inverseDistanceCellCellStencil.H.
|
protected |
Per cell the cell type.
Definition at line 82 of file inverseDistanceCellCellStencil.H.
Referenced by inverseDistance::cellTypes(), and inverseDistance::inverseDistance().
|
protected |
Indices of interpolated cells.
Definition at line 85 of file inverseDistanceCellCellStencil.H.
Referenced by inverseDistance::interpolationCells().
|
protected |
Fetch interpolated cells.
Definition at line 88 of file inverseDistanceCellCellStencil.H.
Referenced by inverseDistance::cellInterpolationMap().
|
protected |
Interpolation stencil.
Definition at line 91 of file inverseDistanceCellCellStencil.H.
|
protected |
Interpolation weights.
Definition at line 94 of file inverseDistanceCellCellStencil.H.
Referenced by inverseDistance::cellInterpolationWeights().
|
protected |
Amount of interpolation.
Definition at line 97 of file inverseDistanceCellCellStencil.H.