37template<
class PatchType>
42 bbs_.setSize(patch_.size());
46 bbs_[i] = treeBoundBox(patch_.points(), patch_[i]);
54template<
class PatchType>
58 const PatchType& patch,
59 const scalar planarTol
70template<
class PatchType>
80template<
class PatchType>
90template<
class PatchType>
102template<
class PatchType>
117template<
class PatchType>
124 cc[i] = patch_[i].centre(patch_.points());
131template<
class PatchType>
152 if (info.
index() == -1)
155 <<
"Could not find " <<
sample <<
" in octree."
160 label facei = info.
index();
165 <<
" nearest face:" << facei;
168 const typename PatchType::face_type& localF = patch_.localFaces()[facei];
169 const typename PatchType::face_type&
f = patch_[facei];
171 const labelList& mp = patch_.meshPoints();
190 Pout<<
" -> face hit:" << curPt
191 <<
" comparing to face normal " << area <<
endl;
202 Pout<<
" -> face miss:" << curPt;
210 const scalar typDimSqr =
mag(area) + VSMALL;
224 patch_.pointNormals()[localF[fp]],
232 if ((
magSqr(fc - curPt)/typDimSqr) < planarTol_)
239 Pout<<
" -> centre hit:" << fc
240 <<
" distance:" <<
magSqr(fc - curPt)/typDimSqr <<
endl;
256 const labelList& fEdges = patch_.faceEdges()[facei];
260 label edgeI = fEdges[fEdgeI];
261 const edge&
e = patch_.edges()[edgeI];
271 const labelList& eFaces = patch_.edgeFaces()[edgeI];
277 edgeNormal += patch_.faceNormals()[eFaces[i]];
283 <<
" comparing to edge normal:" << edgeNormal
320 Pout<<
" -> internal edge hit point:" << edgeHit.
rawPoint()
321 <<
" comparing to edge normal "
322 << 0.5*(nLeft + nRight)
330 0.5*(nLeft + nRight),
339 <<
" anywhere related to nearest face " << facei <<
endl
344 Pout<<
" vertex:" <<
f[fp]
360template<
class PatchType>
382 const typename PatchType::face_type&
f = patch_[index];
427template<
class PatchType>
432 const scalar radiusSqr
439 ? !bbs_[index].
overlaps(centre, radiusSqr)
447 const face&
f = patch_[index];
462template<
class PatchType>
468 scalar& nearestDistSqr,
478 for (
const label index : indices)
480 const typename PatchType::face_type&
f =
patch[index];
485 if (distSqr < nearestDistSqr)
487 nearestDistSqr = distSqr;
495template<
class PatchType>
511template<
class PatchType>
517 point& intersectionPoint
524template<
class PatchType>
530 point& intersectionPoint
533 if (shapeMask_.found(index))
542template<
class PatchType>
548 point& intersectionPoint
554 <<
"EdgeID not set. Please set edgeID to the index of"
555 <<
" the edge you are testing"
562 const typename PatchType::face_type&
f =
patch.localFaces()[index];
574template<
class PatchType>
581 point& intersectionPoint
588 const typename PatchType::face_type&
f =
patch[index];
602 const vector dir(end - start);
618 inter =
f.intersection
633 intersectionPoint = inter.
hitPoint();
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Minimal example by using system/controlDict.functions:
int overlaps
Flag to control which overlap calculations are performed.
Describes the interaction of a face and a point. It carries the info of a successful hit and (if succ...
const point_type & rawPoint() const noexcept
The point, no checks.
scalar distance() const noexcept
Return distance to hit.
bool hit() const noexcept
Is there a hit.
const point_type & hitPoint() const
Return the hit point. Fatal if not hit.
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
label index() const noexcept
Return the hit index.
bool found(const T &val, label pos=0) const
True if the value if found in the list.
iterator end() noexcept
Return an iterator to end traversing the UList.
label rcIndex(const label i) const noexcept
void size(const label n)
Older name for setAddressableSize.
label fcIndex(const label i) const noexcept
bool containsAny(const UList< point > &points) const
Contains any of the points? (inside or on edge)
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
friend Ostream & operator(Ostream &, const faMatrix< Type > &)
A face is a list of labels corresponding to mesh vertices.
Non-pointer based hierarchical recursive searching.
static volumeType getSide(const vector &outsideNormal, const vector &vec)
Helper function to return the side. Returns outside if.
Standard boundBox with extra functionality for use in octree.
bool overlaps(const boundBox &bb) const
Overlaps other bounding box?
direction posBits(const point &pt) const
Position of point relative to bounding box.
Encapsulation of data needed to search on PrimitivePatches.
volumeType getVolumeType(const indexedOctree< treeDataPrimitivePatch< PatchType > > &, const point &) const
Get type (inside,outside,mixed,unknown) of point w.r.t. surface.
bool overlaps(const label index, const treeBoundBox &sampleBb) const
Does shape at index overlap bb.
static bool findIntersection(const indexedOctree< treeDataPrimitivePatch< PatchType > > &tree, const label index, const point &start, const point &end, point &intersectionPoint)
Helper: find intersection of line with shapes.
const PatchType & patch() const
Return access to the underlying patch.
pointField shapePoints() const
static bool intersectBb(const point &p0, const point &p1, const point &p2, const treeBoundBox &cubeBb)
Intersect triangle with bounding box.
An enumeration wrapper for classification of a location as being inside/outside of a volume.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
quaternion normalised(const quaternion &q)
Return the normalised (unit) quaternion of the given quaternion.
line< point, const point & > linePointRef
A line using referred points.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
triangle< point, const point & > triPointRef
A triangle using referred points.
errorManip< error > abort(error &err)
static constexpr const zero Zero
Global zero (0)
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
errorManipArg< error, int > exit(error &err, const int errNo=1)
bool ln(const fileName &src, const fileName &dst)
Create a softlink. dst should not exist. Returns true if successful.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
#define forAll(list, i)
Loop across all elements in list.