Example #1
0
// Return smallest true distance from p to any of wallFaces.
// Note that even if normal hits face we still check other faces.
// Note that wallFaces is untruncated and we explicitly pass in size.
Foam::scalar Foam::cellDistFuncs::smallestDist
(
    const point& p,
    const polyPatch& patch,
    const label nWallFaces,
    const labelList& wallFaces,
    label& minFaceI
) const
{
    const pointField& points = patch.points();

    scalar minDist = GREAT;
    minFaceI = -1;

    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;
}
void Foam::PointEdgeWave<Type, TrackingData>::leaveDomain
(
    const polyPatch& patch,
    const labelList& patchPointLabels,
    List<Type>& pointInfo
) const
{
    const labelList& meshPoints = patch.meshPoints();

    forAll(patchPointLabels, i)
    {
        label patchPointI = patchPointLabels[i];

        const point& pt = patch.points()[meshPoints[patchPointI]];

        pointInfo[i].leaveDomain(patch, patchPointI, pt, td_);
    }