- edited description
compute_first_entity_collision fails for "small" mesh interval
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)
-
reporter -
reporter - edited description
-
See
#296and pull request #186. Numerical robustness for triangles and tetrahedrons has been improved there. Maybe similar tweaks can be done for intervals. -
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.
-
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). - Log in to comment