Go to the documentation of this file.
28 #include "triSurface.H"
29 #include "PatchTools.H"
36 indirectRegionPatches_(),
48 indirectRegionPatches_(),
64 treeByRegion_.clear();
73 if (treeByRegion_.empty())
80 regionSizes(regionI)++;
83 label nRegions = regionSizes.size();
85 indirectRegionPatches_.setSize(nRegions);
86 treeByRegion_.setSize(nRegions);
90 forAll(regionsAddressing, regionI)
92 regionsAddressing[regionI] =
labelList(regionSizes[regionI], -1);
101 regionsAddressing[regionI][nFacesInRegions[regionI]++] = fI;
104 forAll(regionsAddressing, regionI)
106 scalar oldTol = treeType::perturbTol();
107 treeType::perturbTol() = tolerance();
109 indirectRegionPatches_.set
117 regionsAddressing[regionI]
126 if (indirectRegionPatches_[regionI].size())
131 indirectRegionPatches_[regionI],
155 bb.
min() -=
point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
156 bb.
max() +=
point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
167 indirectRegionPatches_[regionI],
177 treeType::perturbTol() = oldTol;
181 return treeByRegion_;
193 if (regionIndices.empty())
199 scalar oldTol = treeType::perturbTol();
200 treeType::perturbTol() = tolerance();
208 if (
findIndex(regionIndices, treeI) == -1)
213 const treeType& octree = octrees[treeI];
232 currentRegionHit.
hit()
244 info[i] = currentRegionHit;
249 treeType::perturbTol() = oldTol;
triSurfaceRegionSearch(const triSurfaceRegionSearch &)
Disallow default bitwise copy construct.
Simple random number generator.
const PtrList< treeType > & treeByRegion() const
Demand driven construction of octree for each region.
List< label > labelList
A List of labels.
const point & max() const
Maximum describing the bounding box.
#define forAll(list, i)
Loop across all elements in list.
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurence of given element and return index,.
void findNearest(const pointField &samples, const scalarField &nearestDistSqr, const labelList ®ionIndices, List< pointIndexHit > &info) const
Find the nearest point on the surface out of the regions.
Standard boundBox + extra functionality for use in octree.
bool hit() const
Is there a hit.
void clearOut()
Clear storage.
void findNearest(const pointField &samples, const scalarField &nearestDistSqr, List< pointIndexHit > &info) const
~triSurfaceRegionSearch()
Destructor.
Helper class to search on triSurface.
scalarField samples(nIntervals, 0)
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
Triangulated surface description with patch information.
treeBoundBox extend(Random &, const scalar s) const
Return slightly wider bounding box.
const Point & hitPoint() const
Return hit point.
A List with indirect addressing.
Non-pointer based hierarchical recursive searching.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
const point & min() const
Minimum describing the bounding box.
void clearOut()
Clear storage.
A list of keyword definitions, which are a keyword followed by any number of values (e....
const double e
Elementary charge.
void setSize(const label)
Reset size of List.
Encapsulation of data needed to search on PrimitivePatches.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void findNearest(const label nodeI, const linePointRef &ln, treeBoundBox &tightest, label &nearestShapeI, point &linePoint, point &nearestPoint, const FindNearestOp &fnOp) const
Find nearest point to line.
vector point
Point is a vector.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
cachedRandom rndGen(label(0), -1)
A list of faces which address into the list of points.