36 Foam::triSurfaceRegionSearch::triSurfaceRegionSearch(
const triSurface& surface)
39 indirectRegionPatches_(),
44 Foam::triSurfaceRegionSearch::triSurfaceRegionSearch
51 indirectRegionPatches_(),
67 treeByRegion_.clear();
76 if (treeByRegion_.empty())
81 const label regionI = surface()[fI].region();
82 maxRegion =
max(maxRegion, regionI);
84 const label nRegions = maxRegion+1;
89 const label regionI = surface()[fI].region();
90 nFacesInRegions[regionI]++;
93 indirectRegionPatches_.
setSize(nRegions);
94 treeByRegion_.setSize(nRegions);
98 forAll(regionsAddressing, regionI)
100 regionsAddressing[regionI].
setSize(nFacesInRegions[regionI]);
102 nFacesInRegions =
Zero;
105 const label regionI = surface()[fI].region();
106 regionsAddressing[regionI][nFacesInRegions[regionI]++] = fI;
109 forAll(regionsAddressing, regionI)
111 scalar oldTol = treeType::perturbTol();
112 treeType::perturbTol() = tolerance();
114 indirectRegionPatches_.set
122 regionsAddressing[regionI]
131 if (indirectRegionPatches_[regionI].size())
136 indirectRegionPatches_[regionI],
172 indirectRegionPatches_[regionI],
182 treeType::perturbTol() = oldTol;
186 return treeByRegion_;
198 if (regionIndices.empty())
204 scalar oldTol = treeType::perturbTol();
205 treeType::perturbTol() = tolerance();
213 if (!regionIndices.found(treeI))
218 const treeType& octree = octrees[treeI];
237 currentRegionHit.
hit()
249 info[i] = currentRegionHit;
254 treeType::perturbTol() = oldTol;