Helper class to search on triSurface. More...
Public Member Functions | |
triSurfaceSearch (const triSurface &) | |
Construct from surface. Holds reference to surface! More... | |
triSurfaceSearch (const triSurface &, const dictionary &dict) | |
Construct from surface and dictionary. More... | |
triSurfaceSearch (const triSurface &surface, const scalar tolerance, const label maxTreeDepth) | |
Construct from components. More... | |
~triSurfaceSearch () | |
Destructor. More... | |
void | clearOut () |
Clear storage. More... | |
const indexedOctree< treeDataTriSurface > & | tree () const |
Demand driven construction of the octree. More... | |
const triSurface & | surface () const |
Return reference to the surface. More... | |
scalar | tolerance () const |
Return tolerance to use in searches. More... | |
label | maxTreeDepth () const |
Return max tree depth of octree. More... | |
boolList | calcInside (const pointField &searchPoints) const |
Calculate for each searchPoint inside/outside status. More... | |
void | findNearest (const pointField &samples, const scalarField &nearestDistSqr, List< pointIndexHit > &info) const |
pointIndexHit | nearest (const point &, const vector &span) const |
Calculate nearest point on surface for single searchPoint. Returns. More... | |
void | findLine (const pointField &start, const pointField &end, List< pointIndexHit > &info) const |
void | findLineAny (const pointField &start, const pointField &end, List< pointIndexHit > &info) const |
void | findLineAll (const pointField &start, const pointField &end, List< List< pointIndexHit > > &info) const |
Calculate all intersections from start to end. More... | |
Private Member Functions | |
bool | checkUniqueHit (const pointIndexHit &currHit, const DynamicList< pointIndexHit, 1, 1 > &hits, const vector &lineVec) const |
Check whether the current hit on the surface which lies on lineVec. More... | |
triSurfaceSearch (const triSurfaceSearch &) | |
Disallow default bitwise copy construct. More... | |
void | operator= (const triSurfaceSearch &) |
Disallow default bitwise assignment. More... | |
Private Attributes | |
const triSurface & | surface_ |
Reference to surface to work on. More... | |
scalar | tolerance_ |
Optional tolerance to use in searches. More... | |
label | maxTreeDepth_ |
Optional max tree depth of octree. More... | |
autoPtr< indexedOctree< treeDataTriSurface > > | treePtr_ |
Octree for searches. More... | |
Helper class to search on triSurface.
Definition at line 55 of file triSurfaceSearch.H.
|
private |
Disallow default bitwise copy construct.
|
explicit |
Construct from surface. Holds reference to surface!
Definition at line 133 of file triSurfaceSearch.C.
triSurfaceSearch | ( | const triSurface & | surface, |
const dictionary & | dict | ||
) |
Construct from surface and dictionary.
Definition at line 143 of file triSurfaceSearch.C.
References dict, Foam::endl(), Foam::Info, and dictionary::readIfPresent().
triSurfaceSearch | ( | const triSurface & | surface, |
const scalar | tolerance, | ||
const label | maxTreeDepth | ||
) |
Construct from components.
Definition at line 168 of file triSurfaceSearch.C.
~triSurfaceSearch | ( | ) |
Destructor.
Definition at line 183 of file triSurfaceSearch.C.
|
private |
Check whether the current hit on the surface which lies on lineVec.
is unique. point : return 1 unique hit edge : return 1 hit if in the cone of the edge faces : return 2 hits if outside or on the cone.
Definition at line 34 of file triSurfaceSearch.C.
References f(), forAll, PointIndexHit< Point >::hitPoint(), PointIndexHit< Point >::index(), points, and Foam::pos().
|
private |
Disallow default bitwise assignment.
void clearOut | ( | ) |
Clear storage.
Definition at line 189 of file triSurfaceSearch.C.
Referenced by triSurfaceRegionSearch::clearOut().
const Foam::indexedOctree< Foam::treeDataTriSurface > & tree | ( | ) | const |
Demand driven construction of the octree.
Definition at line 198 of file triSurfaceSearch.C.
References PatchTools::calcBounds(), Foam::e, Foam::endl(), treeBoundBox::extend(), boundBox::max(), boundBox::min(), nPoints, indexedOctree::perturbTol(), points, rndGen(), WarningInFunction, and Vector< scalar >::zero.
Referenced by surfaceIntersection::doCutEdges(), and cellClassification::markFaces().
|
inline |
Return reference to the surface.
Definition at line 125 of file triSurfaceSearch.H.
References triSurfaceSearch::surface_.
Referenced by surfaceToCell::differingPointNormals(), surfaceIntersection::doCutEdges(), orientedSurface::findZoneSide(), edgeIntersections::intersectEdges(), cellClassification::markFaces(), edgeIntersections::removeDegenerates(), and surfaceIntersection::surfaceIntersection().
|
inline |
Return tolerance to use in searches.
Definition at line 131 of file triSurfaceSearch.H.
References triSurfaceSearch::tolerance_.
Referenced by searchableSurfaces::checkIntersection().
|
inline |
Return max tree depth of octree.
Definition at line 137 of file triSurfaceSearch.H.
References triSurfaceSearch::maxTreeDepth_.
Foam::boolList calcInside | ( | const pointField & | searchPoints | ) | const |
Calculate for each searchPoint inside/outside status.
Definition at line 254 of file triSurfaceSearch.C.
References forAll, volumeType::INSIDE, and samples().
Referenced by surfaceToPoint::combine().
void findNearest | ( | const pointField & | samples, |
const scalarField & | nearestDistSqr, | ||
List< pointIndexHit > & | info | ||
) | const |
Definition at line 282 of file triSurfaceSearch.C.
References indexedOctree::findNearest(), forAll, indexedOctree::perturbTol(), samples(), and List::setSize().
Referenced by triSurfaceRegionSearch::findNearest(), and triSurfaceMesh::findNearest().
Foam::pointIndexHit nearest | ( | const point & | pt, |
const vector & | span | ||
) | const |
Calculate nearest point on surface for single searchPoint. Returns.
in pointIndexHit:
Definition at line 312 of file triSurfaceSearch.C.
References Foam::magSqr().
Referenced by immersedBoundaryFvPatch::addIbCornerCells(), surfaceToPoint::combine(), surfaceToCell::combine(), surfaceToCell::getNearest(), and immersedBoundaryFvPatch::makeIbPointsAndNormals().
void findLine | ( | const pointField & | start, |
const pointField & | end, | ||
List< pointIndexHit > & | info | ||
) | const |
Definition at line 325 of file triSurfaceSearch.C.
References indexedOctree::findLine(), forAll, indexedOctree::perturbTol(), and List::setSize().
Referenced by triSurfaceMesh::findLine().
void findLineAny | ( | const pointField & | start, |
const pointField & | end, | ||
List< pointIndexHit > & | info | ||
) | const |
Definition at line 348 of file triSurfaceSearch.C.
References indexedOctree::findLineAny(), forAll, indexedOctree::perturbTol(), and List::setSize().
Referenced by triSurfaceMesh::findLineAny().
void findLineAll | ( | const pointField & | start, |
const pointField & | end, | ||
List< List< pointIndexHit > > & | info | ||
) | const |
Calculate all intersections from start to end.
Definition at line 371 of file triSurfaceSearch.C.
References DynamicList::append(), DynamicList::clear(), indexedOctree::findLine(), forAll, PointIndexHit< Point >::hit(), PointIndexHit< Point >::index(), Foam::mag(), indexedOctree::perturbTol(), List::setSize(), and List::transfer().
Referenced by triSurfaceMesh::findLineAll(), orientedSurface::findZoneSide(), and edgeIntersections::intersectEdges().
|
private |
Reference to surface to work on.
Definition at line 60 of file triSurfaceSearch.H.
Referenced by triSurfaceSearch::surface().
|
private |
Optional tolerance to use in searches.
Definition at line 63 of file triSurfaceSearch.H.
Referenced by triSurfaceSearch::tolerance().
|
private |
Optional max tree depth of octree.
Definition at line 66 of file triSurfaceSearch.H.
Referenced by triSurfaceSearch::maxTreeDepth().
|
mutableprivate |
Octree for searches.
Definition at line 69 of file triSurfaceSearch.H.
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.