Loading...
Searching...
No Matches
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...

#include <treeDataCell.H>

Classes

class  findNearestOp
class  findIntersectOp

Public Member Functions

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

Static Public Member Functions

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

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 158 of file treeDataCell.C.

References decompMode(), mesh(), and update().

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

Here is the call graph for this function:
Here is the caller 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 175 of file treeDataCell.C.

References cellLabels(), decompMode(), mesh(), and 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 193 of file treeDataCell.C.

References cellLabels(), decompMode(), mesh(), and 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 196 of file treeDataCell.H.

References decompMode(), mesh(), and treeDataCell().

Here is the call graph for this function:

◆ treeDataCell() [5/6]

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

Construct from mesh, copying subset of cells.

Definition at line 208 of file treeDataCell.H.

References cellLabels(), decompMode(), mesh(), and treeDataCell().

Here is the call graph for this function:

◆ treeDataCell() [6/6]

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

Construct from mesh, moving subset of cells.

Definition at line 221 of file treeDataCell.H.

References cellLabels(), decompMode(), mesh(), and treeDataCell().

Here is the call graph for this function:

Member Function Documentation

◆ ClassNameNoDebug()

ClassNameNoDebug ( "treeDataCell" )

References cellLabels(), decompMode(), and mesh().

Here is the call graph for this function:

◆ 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(), and mesh().

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 93 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 104 of file treeDataCell.C.

References boundBox::add(), and mesh().

Referenced by 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.

References Foam::noexcept.

◆ 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 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.

References Foam::noexcept.

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

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.

References Foam::noexcept.

Referenced by ClassNameNoDebug(), treeDataCell(), treeDataCell(), treeDataCell(), treeDataCell(), treeDataCell(), and treeDataCell().

Here is the caller graph for this function:

◆ cellLabels()

const labelList & cellLabels ( ) const
inlinenoexcept

The subset of cell ids to use.

Definition at line 292 of file treeDataCell.H.

References Foam::noexcept.

Referenced by ClassNameNoDebug(), treeDataCell(), treeDataCell(), treeDataCell(), and treeDataCell().

Here is the caller graph for this function:

◆ useSubset()

bool useSubset ( ) const
inlinenoexcept

Use a subset of cells.

Definition at line 297 of file treeDataCell.H.

References Foam::noexcept.

◆ empty()

bool empty ( ) const
inlinenoexcept

Is the effective cell selection empty?

Definition at line 302 of file treeDataCell.H.

References Foam::noexcept.

◆ size()

label size ( ) const
inlinenoexcept

The size of the cell selection.

Definition at line 310 of file treeDataCell.H.

References Foam::noexcept.

◆ 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 centre(), contains(), 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 objectIndex().

Referenced by findNearest().

Here is the call graph for this function:
Here is the caller 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 349 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 257 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 272 of file treeDataCell.C.

References objectIndex().

Here is the call graph for this function:

◆ 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 302 of file treeDataCell.C.

References centre().

Here is the call graph for this function:

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