← Back to team overview

dolfin team mailing list archive

[Bug 783894] Re: Incorrect intersection mesh intersection after changing mesh coordinates.

 

Yes, you are right, there is no mechanism so far, since this  would required an appropriate update mechanism even if you do rather low level manipulation like changing the coordinates. By now that is not trivial to catch with the existing interface.
But you can clear the search structure by calling the IntersectionOperator directly via
mesh.intersection_operator().clear().
The first time you will call an intersected related function, the search will be recreated for the new mesh geometry.

-- 
You received this bug notification because you are a member of DOLFIN
Team, which is subscribed to DOLFIN.
https://bugs.launchpad.net/bugs/783894

Title:
  Incorrect intersection mesh intersection after changing mesh
  coordinates.

Status in DOLFIN:
  New

Bug description:
  It seems like a call to any/all_intersected_entities() bakes in a
  lookup structure that is not updated when mesh coordinates are
  changed. I expected a call to mesh.init() would re-set that data, but
  it makes no difference.

  from dolfin import *
  els1 = [] ; els2 = []
  mesh = UnitCube(1,1,1)
  pt1 = Point(0,0,0)
  els1 = mesh.all_intersected_entities(pt1)
  mesh.coordinates()[:] -= 1/2.
  pt2 = Point(-1/2.,-1/2.,-1/2.)
  els2 = mesh.all_intersected_entities(pt2)
  print els1, els2

  produces: [0 1 2 3 4 5] []

  If the line els1 = mesh.all_intersected_entities(pt1) is commented
  out, it produces: [] [0 1 2 3 4 5]


References