Commit c60419e8 authored by laurence's avatar laurence
Browse files

ENH: foamyHexMesh: insert surface points on close parallel surfaces

parent d2d65142
......@@ -1750,17 +1750,19 @@ bool Foam::conformalVoronoiMesh::nearSurfacePoint
const Foam::point& pt = pHit.first().hitPoint();
pointIndexHit closePoint;
const bool closeToSurfacePt = pointIsNearSurfaceLocation(pt, closePoint);
if
(
closeToSurfacePt
&& mag(pt - closePoint.hitPoint()) > pointPairDistance(pt)
&& (
magSqr(pt - closePoint.hitPoint())
> sqr(pointPairDistance(pt))
)
)
{
const scalar cosAngle
= angleBetweenSurfacePoints(pt, closePoint.hitPoint());
const scalar cosAngle =
angleBetweenSurfacePoints(pt, closePoint.hitPoint());
// @todo make this tolerance run-time selectable?
if (cosAngle < searchAngleOppositeSurface)
......@@ -1770,11 +1772,6 @@ bool Foam::conformalVoronoiMesh::nearSurfacePoint
const scalar searchDist = targetCellSize(closePoint.hitPoint());
if (searchDist < SMALL)
{
Pout<< "WARNING: SMALL CELL SIZE" << endl;
}
geometryToConformTo_.findSurfaceNearest
(
closePoint.hitPoint(),
......@@ -1791,15 +1788,15 @@ bool Foam::conformalVoronoiMesh::nearSurfacePoint
norm
);
const vector nA = norm[0];
const vector& nA = norm[0];
pointIndexHit oppositeHit;
label oppositeSurfaceHit = -1;
geometryToConformTo_.findSurfaceNearestIntersection
(
closePoint.hitPoint() + SMALL*nA,
closePoint.hitPoint() + mag(pt - closePoint.hitPoint())*nA,
closePoint.hitPoint() + 0.5*pointPairDistance(pt)*nA,
closePoint.hitPoint() + 5*targetCellSize(pt)*nA,
oppositeHit,
oppositeSurfaceHit
);
......@@ -1810,21 +1807,10 @@ bool Foam::conformalVoronoiMesh::nearSurfacePoint
pHit.first() = oppositeHit;
pHit.second() = oppositeSurfaceHit;
// appendToSurfacePtTree(pHit.first().hitPoint());
// surfaceToTreeShape.append
// (
// existingSurfacePtLocations_.size() - 1
// );
return !closeToSurfacePt;
}
}
}
else
{
// appendToSurfacePtTree(pt);
// surfaceToTreeShape.append(existingSurfacePtLocations_.size() - 1);
}
return closeToSurfacePt;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment