|
[Sponsors] |
September 4, 2015, 07:01 |
How to accelerate findCell?
|
#1 |
New Member
Join Date: Jul 2015
Posts: 9
Rep Power: 11 |
Hello,
I have the coordinates of a large amount of points and have to find the cooresponding points inside the mesh. For this I'm using the findCell command. I expect that this search has the longest duration in my code. Is there a possibilty to accelerate this command? Thank you very much Jens |
|
September 6, 2015, 10:06 |
|
#2 | |
Member
Bruno Blais
Join Date: Sep 2013
Location: Canada
Posts: 64
Rep Power: 13 |
I think it depends on the search method you use.
There is a way to use a tree-based search which is significantly faster than the generic find cell. This is what is used within the CFDEM framework and its relatively fast. Quote:
|
||
September 6, 2015, 12:23 |
|
#3 |
New Member
Join Date: Jul 2015
Posts: 9
Rep Power: 11 |
Thanks for the answer. Do you have some more information about it or a hint, webside or documentation where I can read more about it?
Thank you |
|
September 6, 2015, 12:33 |
|
#4 |
Member
Bruno Blais
Join Date: Sep 2013
Location: Canada
Posts: 64
Rep Power: 13 |
Sure,
the class is meshSearch Then if you intiate your meshSearch engine using something like: Code:
meshSearch searchEngine_; searchEngine_(particleCloud_.mesh(),polyMesh::FACE_PLANES); |
|
September 7, 2015, 11:25 |
|
#5 |
New Member
Join Date: Jul 2015
Posts: 9
Rep Power: 11 |
Thank you very much. It is not completly clear for me.
I have to define the meshSearch engine right? I don't know which parameter I have to set for the definition of the search engine. Obviously I have to change the variable particleCloud_.mesh() but I don't know how it is called in my chase. What is this variable exactly and how can I find it? Can I use the second part (polyMesh::FACE_PLANES) or do I have to change it to? If I have defined it I can use the mesh.findCell[cellnumber] command to find the cell and openfoam uses the tree search. I have found the following command: . Do I have to set the variables in brakets to use the tree search? Sorry I'm new to openfoam. Thank you very much. |
|
September 8, 2015, 13:17 |
|
#6 |
New Member
Join Date: Jul 2015
Posts: 9
Rep Power: 11 |
Ok, I have tried something but I don't get it work.
Here is what I tried: First of all I copied the meshSearch.H and used the #include command to make it accessable in my code. Edit: I integrated this code Code:
meshSearch ms(mesh); label cellNumber=ms.findCell(Point,-1,true) Thank you very much! Last edited by fst-student; September 17, 2015 at 11:25. |
|
September 25, 2015, 07:57 |
|
#7 |
New Member
Join Date: Jul 2015
Posts: 9
Rep Power: 11 |
I have tested the perfomance of the findCell using several parameters.
The fastest way was this command: Code:
meshSearch ms(mesh); label cellNumber=ms.findCell(Point,0,true) The speed of search can also be improved by using the findNearestCell command. It is used in the same way: Code:
meshSearch ms(mesh); label cellNumber=ms.findNearestCell(Point,0,true) |
|
November 12, 2015, 14:17 |
|
#8 |
Senior Member
Pete Bachant
Join Date: Jun 2012
Location: Boston, MA
Posts: 173
Rep Power: 14 |
Have you tested this in parallel? I am profiling some code and it seems findCell and reduce are gobbling up lots of CPU when run in parallel.
|
|
November 12, 2015, 18:00 |
|
#9 |
Senior Member
Pete Bachant
Join Date: Jun 2012
Location: Boston, MA
Posts: 173
Rep Power: 14 |
I just tried this out and got a ~20X speedup on a case that should not even be parallel (20k cells). The speed in serial using meshSearch::findNearestCell(point, 0, true) is about the same as polyMesh::findCell.
|
|
July 20, 2016, 03:30 |
|
#10 |
New Member
Flo
Join Date: Jun 2015
Posts: 1
Rep Power: 0 |
Could anybody explain the differences between the two available options of the meshSearch class:
polyMesh::FACE_PLANES and polyMesh::FACE_DIAGTETS ? Furthermore, we discovered that implementations of the meshSearch::findCell() algorithm differ between ESI-OpenFOAM and foam-extend-3.2. Could anybody comment on this and explain which algorithm is used in foam-extend-3.2 ? Cheeers. |
|
July 20, 2016, 09:24 |
|
#11 | |
Member
Bruno Blais
Join Date: Sep 2013
Location: Canada
Posts: 64
Rep Power: 13 |
The two should be different search options. The first one I guess uses the face positions, the other one might decompose cells into tetahedron to search? I am not sure?
I cannot comment on the foam-extend vs ESI-OpenFOAM. Honestly, it is too hard to track the différences between these codes... Quote:
|
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
accelerate the convergence | entropie | OpenFOAM Running, Solving & CFD | 2 | October 10, 2014 19:58 |
Is it possible to accelerate the ode solver of reactingFoam? | pajofego | OpenFOAM Running, Solving & CFD | 2 | August 10, 2014 06:38 |
Problems with accelerate flow. Underwater Vehicle | AntonioG | Main CFD Forum | 0 | March 18, 2014 05:36 |
Accelerate the assembling of 3D convection matrix | Isabel | Main CFD Forum | 6 | December 22, 2005 13:22 |
Accelerate convergence in coupled solver | Balaji | FLUENT | 3 | June 23, 2005 19:16 |