Segfault when converting a mesh entity iterator to a list (in Python)
Asked by
Maximilian Albert
The following code snippet results in a segfault:
==>
from dolfin import *
mesh = BoxMesh(0, 0, 0, 1, 1, 1, 1, 1, 1)
c = list(cells(
print c.volume() # --> segfault
<==
On the other hand, the following works fine:
==>
from dolfin import *
mesh = BoxMesh(0, 0, 0, 1, 1, 1, 1, 1, 1)
for c in cells(mesh):
print c.volume()
<==
The problem seems to be the conversion of cells(mesh) to a list (since calling any other method on 'c' in the first example also results in a segfault). Is this a bug, or is it simply not recommended to do this? Is there another, robust way of converting cells(mesh) to a list?
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Johan Hake
- Solved:
- Last query:
- Last reply:
To post a message you must log in.