nearestPoint的问题
-
注意到壁面函数中基本都会计算近壁面距离nearWallDist,追踪了下发现有一个关键函数smallestDist()应该是用于计算的,其描述为Return smallest true distance from p to any of wallFaces。
Foam::scalar Foam::cellDistFuncs::smallestDist ( ... ) const { ... for (label wallFacei = 0; wallFacei < nWallFaces; wallFacei++) { label patchFacei = wallFaces[wallFacei]; `pointHit curHit = patch[patchFacei].nearestPoint(p, points);` if (curHit.distance() < minDist) { minDist = curHit.distance(); minFacei = patch.start() + patchFacei; } } return minDist; }
看起来里面真正干活的是nearestPoint,但是继续深入看nearestPoint的代码我就看不懂了。想请问一下大家有对nearestPoint有过研究的么。