Go to the documentation of this file.
43 const edge&
e = edges_[edgeI];
45 const point& p1 = points_[
e[1]];
51 void Foam::treeDataEdge::update()
55 bbs_.setSize(edgeLabels_.size());
59 bbs_[i] = calcBb(edgeLabels_[i]);
77 edgeLabels_(edgeLabels),
94 edgeLabels_(std::move(edgeLabels)),
125 const edge&
e = edges_[edgeLabels_[i]];
127 eMids[i] =
e.centre(points_);
149 const edge&
e = edges_[edgeLabels_[index]];
151 const point& start = points_[
e.start()];
164 const scalar radiusSqr
167 const edge&
e = edges_[edgeLabels_[index]];
169 const pointHit nearHit =
e.line(points_).nearestDist(centre);
173 return (distSqr <= radiusSqr);
177 void Foam::treeDataEdge::findNearestOp::operator()
182 scalar& nearestDistSqr,
189 for (
const label index : indices)
197 if (distSqr < nearestDistSqr)
199 nearestDistSqr = distSqr;
207 void Foam::treeDataEdge::findNearestOp::operator()
221 scalar nearestDistSqr =
magSqr(linePoint - nearestPoint);
223 for (
const label index : indices)
231 scalar dist =
e.line(shape.
points()).nearestDist(
ln, ePoint, lnPt);
232 scalar distSqr =
sqr(dist);
234 if (distSqr < nearestDistSqr)
236 nearestDistSqr = distSqr;
239 nearestPoint = ePoint;
243 minPt =
min(
ln.start(),
ln.end());
250 maxPt =
max(
ln.start(),
ln.end());
260 bool Foam::treeDataEdge::findIntersectOp::operator()
findNearestOp(const indexedOctree< treeDataEdge > &tree)
volumeType getVolumeType(const indexedOctree< treeDataEdge > &, const point &) const
Get type (inside,outside,mixed,unknown) of point w.r.t. surface.
const Cmpt & x() const
Access to the vector x component.
treeDataEdge(const bool cacheBb, const edgeList &edges, const pointField &points, const labelUList &edgeLabels)
Construct from selected edges.
const Point & rawPoint() const
Return point with no checking.
Standard boundBox with extra functionality for use in octree.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
const Cmpt & z() const
Access to the vector z component.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
#define forAll(list, i)
Loop across all elements in list.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
bool overlaps(const label index, const treeBoundBox &sampleBb) const
Does (bb of) shape at index overlap bb.
findIntersectOp(const indexedOctree< treeDataEdge > &tree)
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
scalar distance() const
Return distance to hit.
An enumeration wrapper for classification of a location as being inside/outside of a volume.
bool intersects(const point &overallStart, const vector &overallVec, const point &start, const point &end, point &pt, direction &ptBits) const
Intersects segment; set point to intersection position and face,.
const edgeList & edges() const
Non-pointer based hierarchical recursive searching.
Holds data for octree to work on an edges subset.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
const pointField & points() const
const Cmpt & y() const
Access to the vector y component.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
pointField shapePoints() const
const dimensionedScalar e
Elementary charge.
const labelList & edgeLabels() const
bool ln(const fileName &src, const fileName &dst)
Create a softlink. dst should not exist. Returns true if successful.
const volScalarField & p0
vector point
Point is a vector.
defineTypeNameAndDebug(combustionModel, 0)