Skip to main content

Fundamental FE Question

Submitted by kajalschopra on

Hi,

This is a very fundamental question

I have a mesh of 2D elements

Now, I have been given a point and know its global coordinates.

I want to find out which element in my mesh includes that point.

Is there an easier way of doing it than looping through each element in my mesh?

 Please help

This is a question that has troubled many designers of advanced FE codes.  The answer is: you need to set up some kind of global search algorithm such as a kdtree or octree.  There is extensive literature on this subject and probably some open source codes, but generally speaking it's not trivial.  Also consider the added difficulty of performing such a search in a distributed-memory parallel environment.  I would be interested to know what you come up with.

Phil

Tue, 02/14/2012 - 20:53 Permalink

A somewhat high-handed solution is to use quadtrees. This is useful if the search operation has to be repeated many times.

The idea is to identify (leaf)nodes in the tree that are intersected by triangles in the mesh. It suffices to do this approximately, using bounding boxes for example. This is a one time operation.

Then use the quadtree to localize which elements in the mesh to search.

Tue, 02/14/2012 - 22:43 Permalink

If the loop over all elements is the primary question, then you could just use bounding boxes to find a certain area where your possible elements lie, and then either use point in polygon test, or use the element's natural coordinate system to check if the point actually lies in the element.

Wed, 02/15/2012 - 10:36 Permalink

Dear All,

Thanks a lot for the reply..yes, I will try on with the quadtree in sometime...We did have this in mind... 

Arun Prakash,

Please can you elaborate the use of bounding boxes? Can you give an example considering a mesh? PErhaps, this would not require much reading than one on quadtrees (As I've not used those alogo's earlier) and could start right away.Looking forward for your response Arun....

Thu, 02/16/2012 - 01:02 Permalink