- changed status to resolved
Calling DirichletBC.set_value() in a function causes segfault
Running the script below with dolfin 1.2.0 causes the error "Segmentation fault (core dumped)" to appear. If however the two lines under "this works" are commented back in the code works.
from dolfin import *
def update_BC(bc_to_update, value): new_value = project(value, bc_to_update.function_space()) bc_to_update.set_value(new_value)
mesh = UnitSquareMesh(2,2) V = FunctionSpace(mesh, "CG",1)
uflexp = triangle.x[0] bc = DirichletBC(V , uflexp, "on_boundary")
#Doing this causes a crash update_BC(bc, uflexp)
#Doing this works #new_value = project(uflexp, bc.function_space()) #bc.set_value(new_value)
print bc.get_boundary_values().values()
Comments (2)
-
-
This is becaused the passed new_value is garbage collected in the update_bc function. I have fixed this in master.
Johan
- Log in to comment
Should be fixed by: https://bitbucket.org/fenics-project/dolfin/commits/fc0959916e43d5464f0cb4cbd5ca13d50e7212f2