|
[Sponsors] |
Be careful when calling meshSearch::findNearestFace with a seed face |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 6, 2018, 08:38 |
Be careful when calling meshSearch::findNearestFace with a seed face
|
#1 |
Senior Member
Thomas Oliveira
Join Date: Apr 2015
Posts: 114
Rep Power: 12 |
Hi,
I was using meshSearch::findNearestFace (OpenFOAM v5) to find a face label from its coordinates. The function declaration is Code:
label findNearestFace ( const point& location, const label seedFacei = -1, const bool useTreeSearch = true ) const; 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'; for every face of cell A and cell B { if ( (distance between 'X' and the center of face) < distanceSqr ) { face is the new best candidate for nearest face; distanceSqr = (distance between 'X' and the center of face); } } 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 |
|
Tags |
find face, mesh search |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
area does not match neighbour by ... % -- possible face ordering problem | St.Pacholak | OpenFOAM | 10 | February 7, 2024 21:50 |
[ICEM] Error in mesh writing | helios | ANSYS Meshing & Geometry | 21 | August 19, 2021 14:18 |
[snappyHexMesh] Error snappyhexmesh - Multiple outside loops | avinashjagdale | OpenFOAM Meshing & Mesh Conversion | 53 | March 8, 2019 09:42 |
(gambit)projecting just a part of mesh on another face? | gholamghar | ANSYS Meshing & Geometry | 2 | March 14, 2011 17:14 |
WARNING: non-positive face area exist. | Alan | Main CFD Forum | 4 | August 17, 2006 07:33 |