diff --git a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C index 7e3f5cd883b4986ce6a7cf0b5e7c401a0b9114a2..b41934ae01962f193f76c9a74e73d587902a58b9 100644 --- a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C +++ b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C @@ -1073,7 +1073,7 @@ const if (ray.hit()) { - // tgtPoint = ray.rawPoint(); + tgtPoint = ray.rawPoint(); return srcFacei; } else if (ray.distance() < nearest.distance()) @@ -1085,7 +1085,7 @@ const if (nearest.hit() || nearest.eligibleMiss()) { - // tgtPoint = nearest.rawPoint(); + tgtPoint = nearest.rawPoint(); return nearestFacei; } @@ -1118,21 +1118,23 @@ const pointHit ray = f.ray(srcPoint, n, tgtPoints); - if (ray.hit() || ray.eligibleMiss()) + if (ray.hit()) { - // srcPoint = ray.rawPoint(); + srcPoint = ray.rawPoint(); return tgtFacei; } - else if (ray.distance() < nearest.distance()) + const pointHit near = f.nearestPoint(srcPoint, tgtPoints); + + if (near.distance() < nearest.distance()) { - nearest = ray; + nearest = near; nearestFacei = tgtFacei; } } if (nearest.hit() || nearest.eligibleMiss()) { - // srcPoint = nearest.rawPoint(); + srcPoint = nearest.rawPoint(); return nearestFacei; }