Coordinates of DOFs


I am trying to find the easiest way to get the coordinates of dofs for a piecewise quadratic function u1 over a 3D mesh:
mesh3 Th3 = tetg(ThSurf, regionlist=domain);
fespace Vh2(Th3,P2, periodic=[[XminVal, y, z], [XmaxVal, y, z], [ZminVal, x, y], [ZmaxVal, x, y]]);
Vh2 u1;

I know that having access to Th3, Vh2 and u1[][i] is enough to get the coordinates of the i-th dof, but how do I do it?

Thank you.

Vh2 uX = x, uY = y, uZ = z;
for(int i = 0; i < Vh2.ndof; ++i)
  cout << uX[][i] << " "<< uY[][i] << " " << uZ[][i] << endl;

Yes, thank you, this idea came to me two minutes after I created the post:) and it works. Thanks again.