# Get dof values of nodes

Hi, I am using Gridap to solve and FE and then use it in optimization. i have non zero dirichlet boundary condition as displacement on a load line. to solve the finite element part i used below function

``````function  stepDisp(fem_params,pth)
A_Disp(u,v,pth) = ((p->Em(p))∘pth) * ε(v) ⊙ (σfun∘(ε(u)))
a_Disp(u,v) = ∫(A_Disp(u,v,pth))fem_params.dΩ
b_Disp(v) = 0.0
op_Disp = AffineFEOperator(a_Disp ,b_Disp ,fem_params.U0_Disp ,fem_params.V0_Disp)
uh_out = solve(op_Disp)
return  get_free_dof_values(uh_out)
end
``````

and U0 is trial space

``````uApp1(x) = VectorValue(0.0,0.0)
uApp2(x) = VectorValue(0.0,0.0)
uApp3(x) = VectorValue(0.0,-vAppMax)
U0_Disp = TrialFESpace(V0_Disp ,[uApp1 ,uApp2 ,uApp3])
``````

then i use results for topology optimization to do this i uses below objective

``````    u_vec = stepDisp(fem_params,pth)

u_vec' * O_mat * u_vec
``````

where o is a matrix defined on space.
however, as i run the problem it seems every thing is ok except in load line. as optimization delete material in places that there is no necessity, it delete material exactly on load line. and this is wring. could you please tell me where i am wrong in the code? my guess is that i get free dof from fe part and as there is dirichlet BC on load line, it doesn’t implement this into optimization part. but i cant solve this problem.