BUG: surfaceFeatureExtract: Fix the search distance for feature proximity

This commit is contained in:
laurence
2013-01-04 12:45:48 +00:00
parent 5879a730fc
commit a517fbfcbe

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -1425,8 +1425,6 @@ int main(int argc, char *argv[])
const scalar searchDistance =
readScalar(surfaceDict.lookup("maxFeatureProximity"));
const scalar radiusSqr = sqr(searchDistance);
scalarField featureProximity(surf.size(), searchDistance);
forAll(surf, fI)
@ -1434,6 +1432,12 @@ int main(int argc, char *argv[])
const triPointRef& tri = surf[fI].tri(surf.points());
const point& triCentre = tri.circumCentre();
const scalar radiusSqr = min
(
sqr(4*tri.circumRadius()),
sqr(searchDistance)
);
List<pointIndexHit> hitList;
feMesh.allNearestFeatureEdges(triCentre, radiusSqr, hitList);
@ -1493,6 +1497,10 @@ int main(int argc, char *argv[])
Info<< endl;
}
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
Info<< "End\n" << endl;
return 0;