This repository contains a dune module with a test program showing the failure 
of the current implementation of checkInside and the hierarchic search, 
as well as an alternative to fix the issue.

The problem stems from the observation that checkInside uses a fixed tolerance, 
while the precision of points that are converted from global coordinates to the 
local coordinates of the reference element depends on the size of the element.

Usage:
- compile with `dunecontrol all´
- run `./build-cmake/src/bug-checkinside´ or `./build-cmake/src/bug-checkinside_short´
- parameters: distance of test point to the element boundary, element size

Files:
- src/bug-checkinside.cc (verbose test program)
- src/bug-checkinside_short.cc (test program)
- src/real-situation.cc
    (test program showing a snippet of a real use case with the problem occuring)
- dune/bug-checkinside/hierarchicsearch.hh
    (alternative implementation of dune/grid/utility/hierarchicsearch.hh)
- dune/bug-checkinside/checkinsidetolerancerequired.hh
    (helper function computing the required tolerance for checkInside to return true)