diff --git a/applications/utilities/surface/surfaceFind/surfaceFind.C b/applications/utilities/surface/surfaceFind/surfaceFind.C index 26024e28e7..4f3f7f4aea 100644 --- a/applications/utilities/surface/surfaceFind/surfaceFind.C +++ b/applications/utilities/surface/surfaceFind/surfaceFind.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -98,19 +98,19 @@ int main(int argc, char *argv[]) forAll(surf1, facei) { - const point centre = surf1[facei].centre(points); + const pointHit hit = + surf1[facei].nearestPoint(samplePt, points); - const scalar dist = mag(centre - samplePt); - if (dist < minDist) + if (hit.distance() < minDist) { - minDist = dist; + minDist = hit.distance();; minIndex = facei; } } const face& f = surf1[minIndex]; - Info<< "Face with nearest centre:" << nl + Info<< "Nearest face:" << nl << " index : " << minIndex << nl << " centre : " << f.centre(points) << nl << " face : " << f << nl