[Dune-devel] Checking whether a given point is contained in a given element

Oliver Sander sander at igpm.rwth-aachen.de
Thu Nov 8 13:09:43 CET 2012


Dear Dune,
I have recently run into the following issue: I have a given point in world
space and an element.  I want to decide whether the element contains
the point.
So far, I have solved this by computing the coordinates of the point
wrt to the element (using Geometry::local(point)), and then calling
checkInside on the appropriate reference element.  That used to work
nicely.
Unfortunately, some grids have recently changed to MultiLinearGeometry
for their geometry implementations.  MLG has fairly tight preconditions:
in particular, its 'local' method aborts with an assertion failure if the
input argument is not contained in the element.
That does not seem like an unreasonable restriction to make.  After all,
strictly speaking, local element coordinates only exist on the element.
Unfortunately, now my old trick doesn't work anymore.  And I can't
think of another elegant why to decide whether a given point is contained
in a given element.

Any ideas?

cheers,
Oliver





More information about the Dune-devel mailing list