← Back to team overview

dolfin team mailing list archive

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

 

Also, mesh.init() will only calculate the connectivity between the topological 
entities. These will not change if you change the coordinates of a mesh.

Johan


On Tuesday May 17 2011 02:31:22 Neilen Marais wrote:
> Public bug reported:
> 
> 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]
> 
> ** Affects: dolfin
>      Importance: Undecided
>          Status: New

-- 
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:
  Invalid

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]


Follow ups

References