Be careful when calling meshSearch::findNearestFace with a seed face
1 Attachment(s)
Hi,
I was using meshSearch::findNearestFace (OpenFOAM v5) to find a face label from its coordinates. The function declaration is Code:
label findNearestFace If seedFacei != -1 is provided, findNearestFace calls findNearestFaceWalk. From what I understood reading findNearestFaceWalk's implementation, it does not find the correct face in cases such as the one below. Consider the attached figure. 'X' marks the location and 'f' is the seed face. findNearestFaceWalk does the following: Code:
distanceSqr = distance between 'X' and the center of 'f'; I decided not to use seedFacei when calling findNearestFace. It defaults to seedFacei=-1 and, if useTreeSearch is true (its default value), findNearestFace uses findNearestFaceTree instead of findNearestFaceWalk. I did not check if the performance got worse. The result of the search is now as expected. Kind regards, Thomas |
All times are GMT -4. The time now is 22:01. |