mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: cvMesh: Move feature point tree into extendedFeatureEdgeMesh from cvMesh
This commit is contained in:
@ -522,43 +522,20 @@ void Foam::conformalVoronoiMesh::insertEdgePointGroups
|
||||
}
|
||||
|
||||
|
||||
const Foam::indexedOctree<Foam::treeDataPoint>&
|
||||
Foam::conformalVoronoiMesh::featurePointTree() const
|
||||
{
|
||||
if (featurePointTreePtr_.empty())
|
||||
{
|
||||
treeBoundBox overallBb
|
||||
(
|
||||
geometryToConformTo_.globalBounds().extend(rndGen_, 1e-4)
|
||||
);
|
||||
|
||||
overallBb.min() -= Foam::point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
|
||||
overallBb.max() += Foam::point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
|
||||
|
||||
featurePointTreePtr_.reset
|
||||
(
|
||||
new indexedOctree<treeDataPoint>
|
||||
(
|
||||
treeDataPoint(featurePointLocations_),
|
||||
overallBb, // overall search domain
|
||||
10, // max levels
|
||||
10.0, // maximum ratio of cubes v.s. cells
|
||||
100.0 // max. duplicity; n/a since no bounding boxes.
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return featurePointTreePtr_();
|
||||
}
|
||||
|
||||
|
||||
bool Foam::conformalVoronoiMesh::nearFeaturePt(const Foam::point& pt) const
|
||||
{
|
||||
const indexedOctree<treeDataPoint>& tree = featurePointTree();
|
||||
|
||||
scalar exclusionRangeSqr = featurePointExclusionDistanceSqr(pt);
|
||||
|
||||
pointIndexHit info = tree.findNearest(pt, exclusionRangeSqr);
|
||||
pointIndexHit info;
|
||||
label featureHit;
|
||||
|
||||
geometryToConformTo_.findFeaturePointNearest
|
||||
(
|
||||
pt,
|
||||
exclusionRangeSqr,
|
||||
info,
|
||||
featureHit
|
||||
);
|
||||
|
||||
return info.hit();
|
||||
}
|
||||
@ -1207,7 +1184,6 @@ Foam::conformalVoronoiMesh::conformalVoronoiMesh
|
||||
limitBounds_(),
|
||||
featureVertices_(),
|
||||
featurePointLocations_(),
|
||||
featurePointTreePtr_(),
|
||||
edgeLocationTreePtr_(),
|
||||
surfacePtLocationTreePtr_(),
|
||||
sizeAndAlignmentLocations_(),
|
||||
|
||||
@ -169,9 +169,6 @@ private:
|
||||
// Single pointField required by the featurePointTree.
|
||||
pointField featurePointLocations_;
|
||||
|
||||
//- Search tree for feature point locations
|
||||
mutable autoPtr<indexedOctree<treeDataPoint> > featurePointTreePtr_;
|
||||
|
||||
//- Search tree for edge point locations
|
||||
mutable autoPtr<dynamicIndexedOctree<dynamicTreeDataPoint> >
|
||||
edgeLocationTreePtr_;
|
||||
@ -487,9 +484,6 @@ private:
|
||||
//- Reinsert stored feature point defining points
|
||||
void reinsertFeaturePoints(bool distribute = false);
|
||||
|
||||
//- Demand driven construction of octree for feature points
|
||||
const indexedOctree<treeDataPoint>& featurePointTree() const;
|
||||
|
||||
//- Check if a location is in exclusion range around a feature point
|
||||
bool nearFeaturePt(const Foam::point& pt) const;
|
||||
|
||||
|
||||
@ -619,6 +619,37 @@ void Foam::conformationSurfaces::findSurfaceNearest
|
||||
}
|
||||
|
||||
|
||||
void Foam::conformationSurfaces::findFeaturePointNearest
|
||||
(
|
||||
const point& sample,
|
||||
scalar nearestDistSqr,
|
||||
pointIndexHit& fpHit,
|
||||
label& featureHit
|
||||
) const
|
||||
{
|
||||
// Work arrays
|
||||
scalar minDistSqr = nearestDistSqr;
|
||||
pointIndexHit hitInfo;
|
||||
|
||||
forAll(features_, testI)
|
||||
{
|
||||
features_[testI].nearestFeaturePoint
|
||||
(
|
||||
sample,
|
||||
minDistSqr,
|
||||
hitInfo
|
||||
);
|
||||
|
||||
if (hitInfo.hit())
|
||||
{
|
||||
minDistSqr = magSqr(hitInfo.hitPoint()- sample);
|
||||
fpHit = hitInfo;
|
||||
featureHit = testI;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::conformationSurfaces::findEdgeNearest
|
||||
(
|
||||
const point& sample,
|
||||
|
||||
@ -246,6 +246,14 @@ public:
|
||||
labelList& hitSurfaces
|
||||
) const;
|
||||
|
||||
//- Find the nearest point on any feature edge
|
||||
void findFeaturePointNearest
|
||||
(
|
||||
const point& sample,
|
||||
scalar nearestDistSqr,
|
||||
pointIndexHit& fpHit,
|
||||
label& featureHit
|
||||
) const;
|
||||
|
||||
//- Find the nearest point on any feature edge
|
||||
void findEdgeNearest
|
||||
|
||||
Reference in New Issue
Block a user