42 const cellList& cells = mesh_.cells();
43 const faceList& faces = mesh_.faces();
48 vector(GREAT, GREAT, GREAT),
49 vector(-GREAT, -GREAT, -GREAT)
52 const cell& cFaces = cells[cellI];
56 const face& f = faces[cFaces[cFaceI]];
60 const point& p = points[f[fp]];
62 cellBb.
min() =
min(cellBb.min(),
p);
63 cellBb.max() =
max(cellBb.max(),
p);
70 void Foam::treeDataCell::update()
74 bbs_.setSize(cellLabels_.size());
78 bbs_[i] = calcCellBb(cellLabels_[i]);
95 cellLabels_(cellLabels),
97 decompMode_(decompMode)
112 cellLabels_(cellLabels),
114 decompMode_(decompMode)
128 cellLabels_(
identity(mesh_.nCells())),
130 decompMode_(decompMode)
162 cc[i] = mesh_.cellCentres()[cellLabels_[i]];
177 return cubeBb.
overlaps(bbs_[index]);
181 return cubeBb.
overlaps(calcCellBb(cellLabels_[index]));
192 return mesh_.pointInCell(sample, cellLabels_[index], decompMode_);
196 void Foam::treeDataCell::findNearestOp::operator()
201 scalar& nearestDistSqr,
210 label index = indices[i];
214 if (distSqr < nearestDistSqr)
216 nearestDistSqr = distSqr;
224 void Foam::treeDataCell::findNearestOp::operator()
237 "treeDataCell::findNearestOp::operator()" 239 " const labelUList&," 240 " const linePointRef&," 250 bool Foam::treeDataCell::findIntersectOp::operator()
255 point& intersectionPoint
273 const treeBoundBox cellBb = shape.calcCellBb(shape.cellLabels_[index]);
289 const cell& cFaces = shape.mesh_.
cells()[shape.cellLabels_[index]];
291 const vector dir(end - start);
292 scalar minDistSqr =
magSqr(dir);
297 const face& f = shape.mesh_.
faces()[cFaces[i]];
313 intersectionPoint = inter.
hitPoint();
pointHit ray(const point &p, const vector &n, const pointField &, const intersection::algorithm alg=intersection::FULL_RAY, const intersection::direction dir=intersection::VECTOR) const
Return potential intersection with face with a ray starting.
bool overlaps(const label index, const treeBoundBox &sampleBb) const
Does (bb of) shape at index overlap bb.
vector point
Point is a vector.
const polyMesh & mesh() const
A cell is defined as a list of faces with extra functionality.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
const Point & hitPoint() const
Return hit point.
A simple container for copying or transferring objects of type <T>.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Standard boundBox + extra functionality for use in octree.
const cellList & cells() const
const vectorField & cellCentres() const
pointField shapePoints() const
Get representative point cloud for all shapes inside.
vectorField pointField
pointField is a vectorField.
static scalar setPlanarTol(const scalar t)
Set the planar tolerance, returning the previous value.
findNearestOp(const indexedOctree< treeDataCell > &tree)
findIntersectOp(const indexedOctree< treeDataCell > &tree)
A face is a list of labels corresponding to mesh vertices.
bool contains(const label index, const point &sample) const
Does shape at index contain sample.
List< cell > cellList
list of cells
virtual const pointField & points() const
Return raw points.
bool ln(const fileName &src, const fileName &dst)
Create a softlink. dst should not exist. Returns true if successful.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
labelList identity(const label len)
Create identity map (map[i] == i) of given length.
direction posBits(const point &) const
Position of point relative to bounding box.
const labelList & cellLabels() const
Non-pointer based hierarchical recursive searching.
treeDataCell(const bool cacheBb, const polyMesh &, const labelUList &, const polyMesh::cellDecomposition decompMode)
Construct from mesh and subset of cells.
scalar distance() const
Return distance to hit.
Mesh consisting of general polyhedral cells.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
bool hit() const
Is there a hit.
Vector< scalar > vector
A scalar version of the templated Vector.
virtual const faceList & faces() const
Return raw faces.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
#define notImplemented(functionName)
Issue a FatalErrorIn for a function not currently implemented.
Encapsulation of data needed to search in/for cells. Used to find the cell containing a point (e...
cellDecomposition
Enumeration defining the decomposition of the cell for.
bool overlaps(const boundBox &) const
Overlaps/touches boundingBox?
defineTypeNameAndDebug(combustionModel, 0)