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

Oliver Sander sander at igpm.rwth-aachen.de
Thu Nov 8 14:29:06 CET 2012


Am 08.11.2012 13:20, schrieb Dedner, Andreas:
> I think that the local method should not abort if the point is inside the reference element
> or not - and one of the reasons is that you need as Oliver said you need the local method
> to verify if a point is inside. Also I can think of applications where I would like to
> represent for example the barycenter of neighbors in the local coordinate system
> of an element - requiring me to use its local method...
> I would thus suggest to remove that check (and think its mathematically fine because these
> transformations are global mappings in all the cases I can think of...)
I certainly wouldn't object to that solution.  Strangely enough, though,
after removing all assertions from MultiLinearGeometry, the code still
crashed due to infs and nans appearing (only for simplices, now that I
think about it).  Does the MLG code rely on the points being inside the
reference element?
best,
Oliver

>
> Andreas
> ________________________________________
> From: dune-devel-bounces+a.s.dedner=warwick.ac.uk at dune-project.org [dune-devel-bounces+a.s.dedner=warwick.ac.uk at dune-project.org] on behalf of Oliver Sander [sander at igpm.rwth-aachen.de]
> Sent: 08 November 2012 12:09
> To: dune-devel at dune-project.org
> Subject: [Dune-devel] Checking whether a given point is contained in a given    element
>
> 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
>
>
> _______________________________________________
> Dune-devel mailing list
> Dune-devel at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune-devel
>
>




More information about the Dune-devel mailing list