Compute quantity in terms of N.x and N.y on boundary

Hello,
I would like to compute a quantity of the form atan2(N.y,N.x) on the boundary. I need to store this and use it multiple times in my code. (It allows me to find a reverse parametrization…)

Can you suggest a way to do this? Is it possible to recover the normal vector at a point of the boundary (without recomputing it)?

Thank you.
Best regards,
Beniamin

just build a interpolation of

var vtheta(Uvarov) = on(1,2,u=atan2(N.y,N.x) o);
fespace Wh(Th,P0edge);

Wh theta= vtheta(0,Wh,tgv=1);

now you avec a store the value in finite element function.

Thank you for your answer. I will try it!