treeDataCell Class Reference

Encapsulation of data needed to search in/for cells. Used to find the cell containing a point (e.g. cell-cell mapping). More...

Classes

class  findIntersectOp
 
class  findNearestOp
 

Public Member Functions

 ClassNameNoDebug ("treeDataCell")
 
 treeDataCell (const bool cacheBb, const polyMesh &mesh, polyMesh::cellDecomposition decompMode)
 Construct from mesh, using all cells in mesh. More...
 
 treeDataCell (const bool cacheBb, const polyMesh &mesh, const labelUList &cellLabels, polyMesh::cellDecomposition decompMode)
 Construct from mesh, copying subset of cells. More...
 
 treeDataCell (const bool cacheBb, const polyMesh &mesh, labelList &&cellLabels, polyMesh::cellDecomposition decompMode)
 Construct from mesh, moving subset of cells. More...
 
 treeDataCell (const polyMesh &mesh, polyMesh::cellDecomposition decompMode)
 Construct from mesh, using all cells in mesh. More...
 
 treeDataCell (const polyMesh &mesh, const labelUList &cellLabels, polyMesh::cellDecomposition decompMode)
 Construct from mesh, copying subset of cells. More...
 
 treeDataCell (const polyMesh &mesh, labelList &&cellLabels, polyMesh::cellDecomposition decompMode)
 Construct from mesh, moving subset of cells. More...
 
int nDim () const noexcept
 Object dimension == 3 (volume element) More...
 
treeBoundBox bounds (const labelUList &indices) const
 Return bounding box for the specified cell indices. More...
 
const polyMeshmesh () const noexcept
 Reference to the supporting mesh. More...
 
polyMesh::cellDecomposition decompMode () const noexcept
 The cell decomposition mode used. More...
 
const labelListcellLabels () const noexcept
 The subset of cell ids to use. More...
 
bool useSubset () const noexcept
 Use a subset of cells. More...
 
bool empty () const noexcept
 Is the effective cell selection empty? More...
 
label size () const noexcept
 The size of the cell selection. More...
 
label objectIndex (const label index) const
 Map from shape index to original (non-subset) cell label. More...
 
const pointcentre (const label index) const
 Representative point (cell centre) at shape index. More...
 
tmp< pointFieldcentres () const
 Representative point cloud for contained shapes. One point per shape, corresponding to the cell centres. More...
 
volumeType getVolumeType (const indexedOctree< treeDataCell > &, const point &) const
 Get type (inside,outside,mixed,unknown) of point w.r.t. surface. More...
 
bool overlaps (const label index, const treeBoundBox &searchBox) const
 Does (bb of) shape at index overlap searchBox. More...
 
bool contains (const label index, const point &sample) const
 Does shape at index contain sample. More...
 
void findNearest (const labelUList &indices, const point &sample, scalar &nearestDistSqr, label &nearestIndex, point &nearestPoint) const
 Calculates nearest (to sample) point in shape. More...
 

Static Public Member Functions

static treeBoundBoxList boxes (const primitiveMesh &mesh)
 Calculate and return bounding boxes for all mesh cells. More...
 
static treeBoundBoxList boxes (const primitiveMesh &mesh, const labelUList &cellIds)
 Calculate and return bounding boxes for specified mesh cells. More...
 
static treeBoundBox bounds (const primitiveMesh &mesh, const labelUList &cellIds)
 Return bounding box of specified mesh cells. More...
 

Detailed Description

Encapsulation of data needed to search in/for cells. Used to find the cell containing a point (e.g. cell-cell mapping).

Source files

Definition at line 53 of file treeDataCell.H.

Constructor & Destructor Documentation

◆ treeDataCell() [1/6]

treeDataCell ( const bool  cacheBb,
const polyMesh mesh,
polyMesh::cellDecomposition  decompMode 
)

Construct from mesh, using all cells in mesh.

Definition at line 159 of file treeDataCell.C.

References update().

Here is the call graph for this function:

◆ treeDataCell() [2/6]

treeDataCell ( const bool  cacheBb,
const polyMesh mesh,
const labelUList cellLabels,
polyMesh::cellDecomposition  decompMode 
)

Construct from mesh, copying subset of cells.

Definition at line 176 of file treeDataCell.C.

References update().

Here is the call graph for this function:

◆ treeDataCell() [3/6]

treeDataCell ( const bool  cacheBb,
const polyMesh mesh,
labelList &&  cellLabels,
polyMesh::cellDecomposition  decompMode 
)

Construct from mesh, moving subset of cells.

Definition at line 194 of file treeDataCell.C.

References update().

Here is the call graph for this function:

◆ treeDataCell() [4/6]

treeDataCell ( const polyMesh mesh,
polyMesh::cellDecomposition  decompMode 
)
inline

Construct from mesh, using all cells in mesh.

Definition at line 197 of file treeDataCell.H.

◆ treeDataCell() [5/6]

treeDataCell ( const polyMesh mesh,
const labelUList cellLabels,
polyMesh::cellDecomposition  decompMode 
)
inline

Construct from mesh, copying subset of cells.

Definition at line 209 of file treeDataCell.H.

◆ treeDataCell() [6/6]

treeDataCell ( const polyMesh mesh,
labelList &&  cellLabels,
polyMesh::cellDecomposition  decompMode 
)
inline

Construct from mesh, moving subset of cells.

Definition at line 222 of file treeDataCell.H.

Member Function Documentation

◆ ClassNameNoDebug()

ClassNameNoDebug ( "treeDataCell"  )

◆ boxes() [1/2]

Foam::treeBoundBoxList boxes ( const primitiveMesh mesh)
static

Calculate and return bounding boxes for all mesh cells.

Definition at line 85 of file treeDataCell.C.

References Foam::boxesImpl(), treeDataCell::mesh(), and primitiveMesh::nCells().

Here is the call graph for this function:

◆ boxes() [2/2]

Foam::treeBoundBoxList boxes ( const primitiveMesh mesh,
const labelUList cellIds 
)
static

Calculate and return bounding boxes for specified mesh cells.

Definition at line 94 of file treeDataCell.C.

References Foam::boxesImpl(), and mesh.

Here is the call graph for this function:

◆ bounds() [1/2]

Foam::treeBoundBox bounds ( const primitiveMesh mesh,
const labelUList cellIds 
)
static

Return bounding box of specified mesh cells.

Definition at line 105 of file treeDataCell.C.

References boundBox::add(), primitiveMesh::cellPoints(), primitiveMesh::cells(), primitiveMesh::hasCellPoints(), mesh, and polyMesh::points().

Referenced by treeDataCell::bounds().

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

◆ nDim()

int nDim ( ) const
inlinenoexcept

Object dimension == 3 (volume element)

Definition at line 266 of file treeDataCell.H.

◆ bounds() [2/2]

Foam::treeBoundBox bounds ( const labelUList indices) const

Return bounding box for the specified cell indices.

Definition at line 214 of file treeDataCell.C.

References boundBox::add(), and treeDataCell::bounds().

Here is the call graph for this function:

◆ mesh()

const polyMesh& mesh ( ) const
inlinenoexcept

Reference to the supporting mesh.

Definition at line 279 of file treeDataCell.H.

Referenced by treeDataCell::boxes(), and treeDataCell::findIntersectOp::operator()().

Here is the caller graph for this function:

◆ decompMode()

polyMesh::cellDecomposition decompMode ( ) const
inlinenoexcept

The cell decomposition mode used.

Definition at line 284 of file treeDataCell.H.

◆ cellLabels()

const labelList& cellLabels ( ) const
inlinenoexcept

The subset of cell ids to use.

Definition at line 292 of file treeDataCell.H.

◆ useSubset()

bool useSubset ( ) const
inlinenoexcept

Use a subset of cells.

Definition at line 297 of file treeDataCell.H.

◆ empty()

bool empty ( ) const
inlinenoexcept

Is the effective cell selection empty?

Definition at line 302 of file treeDataCell.H.

References UList< T >::empty(), and primitiveMesh::nCells().

Here is the call graph for this function:

◆ size()

label size ( ) const
inlinenoexcept

The size of the cell selection.

Definition at line 310 of file treeDataCell.H.

References primitiveMesh::nCells(), and UList< T >::size().

Here is the call graph for this function:

◆ objectIndex()

label objectIndex ( const label  index) const
inline

Map from shape index to original (non-subset) cell label.

Definition at line 318 of file treeDataCell.H.

Referenced by treeDataCell::centre(), and treeDataCell::findIntersectOp::operator()().

Here is the caller graph for this function:

◆ centre()

const point& centre ( const label  index) const
inline

Representative point (cell centre) at shape index.

const cell& operator[](const label index) const { return mesh_.cells()[objectIndex(index)]; }

Definition at line 330 of file treeDataCell.H.

References primitiveMesh::cellCentres(), and treeDataCell::objectIndex().

Here is the call graph for this function:

◆ centres()

Foam::tmp< Foam::pointField > centres ( ) const

Representative point cloud for contained shapes. One point per shape, corresponding to the cell centres.

Definition at line 246 of file treeDataCell.C.

References tmp< T >::New().

Here is the call graph for this function:

◆ getVolumeType()

volumeType getVolumeType ( const indexedOctree< treeDataCell > &  ,
const point  
) const
inline

Get type (inside,outside,mixed,unknown) of point w.r.t. surface.

Only makes sense for closed surfaces.

Definition at line 350 of file treeDataCell.H.

References NotImplemented, and volumeType::UNKNOWN.

◆ overlaps()

bool overlaps ( const label  index,
const treeBoundBox searchBox 
) const

Does (bb of) shape at index overlap searchBox.

Definition at line 258 of file treeDataCell.C.

References treeBoundBox::overlaps().

Here is the call graph for this function:

◆ contains()

bool contains ( const label  index,
const point sample 
) const

Does shape at index contain sample.

Definition at line 273 of file treeDataCell.C.

◆ findNearest()

void findNearest ( const labelUList indices,
const point sample,
scalar &  nearestDistSqr,
label &  nearestIndex,
point nearestPoint 
) const

Calculates nearest (to sample) point in shape.

Returns actual point and distance (squared)

Definition at line 303 of file treeDataCell.C.


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