User login

Navigation

You are here

Fundamental FE Question

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

wallstedt's picture

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

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.

Arun Prakash's picture

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.

Temesgen Markos's picture

You can find the node closest to your point. Then you can find a patch of elements around that node. Now do a point in a polygon search to find which element from the patch contains your point.

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....

Subscribe to Comments for

Recent comments

More comments

Syndicate

Subscribe to Syndicate