Computing the divergence of the normal vector

Dear all,
I want to compute the shape derivative of a form and hence i need to solve a problem with int1d(Th)( f (dx(N.x)+dy(N.y)) )*.
This does not work as such, and since I am optimizing my shape, I don’t have an explicit form of my border so I cannot compute the normal by myself.
Do you know how this could be done?