You could use KDTree, based on nanoflann. 

If you installed the development version of dealii with NANOFLANN support, then 
you’d have access to algorithms that work in order log(N) complexity for each 
search, and N log(N) to build the tree. 

You’d have to massage it a little, as at the moment it does not use cells but 
points. I’d construct a vector of active cell centers, and use kdtree on this 
vector to obtain the “k nearest neighbours”  (get_closest_points), as well as 
"neighbours within distance” (get_points_within_ball).

http://dealii.org/developer/doxygen/deal.II/classKDTree.html

L.

> On 24 Jan 2018, at 21:37, Sukhminder Singh <sunny99...@gmail.com> wrote:
> 
> Is there any way to find element neighbors with in a particular radius from 
> its center? One approach is to compare distance with every other element in 
> the whole mesh but then the algorithmic complexity will be O(N^2). Another 
> approach is to map all the elements to a coarse structured grid with h=radius 
> and assign each element a cell number of this structured grid. Then I know 
> what are the neighbors of an element which lie in the same cell of the grid 
> and then check the distance only with these neighbors (this will have O(N) 
> algorithmic complexity).
> Is there any simpler way to find neighbors in Dealii, in MPI parallel 
> framework? 
> 
> -- 
> The deal.II project is located at http://www.dealii.org/
> For mailing list/forum options, see 
> https://groups.google.com/d/forum/dealii?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "deal.II User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to dealii+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to