← Back to team overview

dolfin team mailing list archive

intersect_any() and intersects_exactly(): bug or misunderstanding?

 

Hi,

I understand the definition of cell.intersects_exaclty(point) to be
such that it will return true if point is inside cell, and false if it
is outside. However, the following code results in a point marked as
intersecting with all elements in the mesh. This AFAIK could only be
true if point was coincident with a vertex that all the cells in the
mesh were connected to. Am I misunderstanding, or is it a bug?

from __future__ import division

import numpy as N
from dolfin import *

# Define mesh
mesh = UnitCube(1,1,1)
source_coords = N.array([1/20, 1/20, 1/20], dtype='d')
source_pt = Point(*source_coords)
intersected_elements = mesh.all_intersected_entities(source_pt)
for cell_index in intersected_elements:
    c = Cell(mesh, cell_index)
    # Check that the source point is in this element
    assert(c.intersects_exactly(source_pt))
print intersected_elements

returns:

In [15]: run list_example.py
[0 1 2 3 4 5]

Cheers
Neilen



Follow ups