diff --git a/src/meshTools/searchableSurface/searchableSurfaceWithGaps.C b/src/meshTools/searchableSurface/searchableSurfaceWithGaps.C index f138daa7a4..50e851296b 100644 --- a/src/meshTools/searchableSurface/searchableSurfaceWithGaps.C +++ b/src/meshTools/searchableSurface/searchableSurfaceWithGaps.C @@ -232,9 +232,9 @@ void Foam::searchableSurfaceWithGaps::findLine // do we accept the hit. List plusInfo; - surface().findLine(start+offset0, end+offset0, plusInfo); + surface().findLine(compactStart+offset0, compactEnd+offset0, plusInfo); List minInfo; - surface().findLine(start-offset0, end-offset0, minInfo); + surface().findLine(compactStart-offset0, compactEnd-offset0, minInfo); // Extract any hits forAll(plusInfo, i) @@ -257,14 +257,28 @@ void Foam::searchableSurfaceWithGaps::findLine compactStart[i] = compactStart[mapI]; compactEnd[i] = compactEnd[mapI]; compactMap[i] = compactMap[mapI]; + offset0[i] = offset0[mapI]; + offset1[i] = offset1[mapI]; } compactStart.setSize(plusMissMap.size()); compactEnd.setSize(plusMissMap.size()); compactMap.setSize(plusMissMap.size()); + offset0.setSize(plusMissMap.size()); + offset1.setSize(plusMissMap.size()); - surface().findLine(start+offset1, end+offset1, plusInfo); - surface().findLine(start-offset1, end-offset1, minInfo); + surface().findLine + ( + compactStart+offset1, + compactEnd+offset1, + plusInfo + ); + surface().findLine + ( + compactStart-offset1, + compactEnd-offset1, + minInfo + ); // Extract any hits forAll(plusInfo, i) diff --git a/src/meshTools/searchableSurface/searchableSurfaceWithGaps.H b/src/meshTools/searchableSurface/searchableSurfaceWithGaps.H index 1bdddb9706..a5392867f1 100644 --- a/src/meshTools/searchableSurface/searchableSurfaceWithGaps.H +++ b/src/meshTools/searchableSurface/searchableSurfaceWithGaps.H @@ -148,6 +148,8 @@ public: // Multiple point queries. + //- Find nearest on original surface. Note:does not use perturbation + // and hence might be inconsistent with intersections. virtual void findNearest ( const pointField& sample,