compute_first_entity_collision fails for "small" mesh interval

Issue #725 new
Chaffra Affouda created an issue

The code below illustrate the issue. This is a problem when defining a Function on such a mesh. Because Function::eval uses compute_first_entity_collision, the evaluation fails telling you to allow extrapolation although the point is inside the mesh.

from dolfin import *
mesh = IntervalMesh(100,0,1e-13)
tree = mesh.bounding_box_tree()
p = Point(5.5e-14) #this point is clearly inside the mesh

#return not  found;
tree.compute_first_entity_collision(p)

#return 54
tree.compute_first_collision(p)

Comments (5)

  1. Chaffra Affouda reporter

    What's the difference between compute_first_entity_collision and compute_first_collision? It tried replacing the compute_first_entity_collision with compute_first_collision in the Function::eval and compute_first_collision seems to work without need to extrapolate.

  2. Jan Blechta

    That's not a correct fix probably. compute_first_collision returns an index of bounding box (which may or may not be the same as index of colliding entity). compute_first_entity_collision returns an index of mesh entity (normally cell).

  3. Log in to comment