Mesh function memory corruption
Issue #467
resolved
This example
from dolfin import *
def ff():
mesh = UnitSquareMesh(3, 3)
ff = FacetFunction('size_t', mesh)
#ff._mesh = mesh # Workaround
return ff
ff = ff()
print ff.mesh().geometry().dim() # prints rubish
print ff.mesh().coordinates() # prints rubish
demonstrates that there is a problem with lifetime of mesh within meshfunction. It seems strange as mesh function constructors taking reference mesh are ignored in dolfin/swig/mesh/pre.i
.
Comments (6)
-
reporter -
@blechta Could be. I've just now merged the branch into master.
-
- changed status to resolved
Fix Issue
#467.→ <<cset 8c50ed9d3e15>>
-
reporter Seems like fixed now.
-
- removed milestone
Removing milestone: 1.6 (automated comment)
-
I'm not sure if commenting here is the correct place, but I seem to have found a related issue (2018.1):
import fenics x_values_list = [] for i in range(5): mesh = fenics.IntervalMesh(10, 0, 4) x_values = mesh.coordinates() print(x_values) #all good x_values_list.append(x_values) print(x_values_list) #prints rubbish
- Log in to comment
Is it fixed by a76edd3, @garth-wells?