# Fenics : looking forward to compute displacements at nodes

I just went through the Fenics book to get the nodal displacements and tried this code ....

u_nodal_values = U.vector()
u_array = u_nodal_values.array()
coor = mesh.coordinates()
center = (0.5,0.5,0.5)
print U(center)
if mesh.num_vertices()==len(u_array):
for i in range(mesh.num_vertices()):
print ’U(%8g,%8g,%8g) = %g’% (coor[i][0], coor[i][1], u_array[i])


but i don't get the expected result.. can anyone suggest me the modification ??

• Welcome to scicomp! It would help if you could tell us what the expected result was. To make helping you easier, you should also give a complete example, i.e., one we can copy and paste and compare the results. – Christian Clason May 20 '13 at 19:52

map = V.dofmap().vertex_to_dof_map(mesh)