# Coordinates of DOFs

**URL:** <https://community.freefem.org/t/coordinates-of-dofs/696>\
**Category:** General Discussion\
**Created:** [December 19, 2020, 2:06am UTC](https://community.freefem.org/t/coordinates-of-dofs/696 "2020-12-19T02:06:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alex](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@Alex](https://community.freefem.org/u/Alex)\
**Post date:** [December 19, 2020, 2:06am UTC](https://community.freefem.org/t/coordinates-of-dofs/696/1 "2020-12-19T02:06:18Z")

</div>

Hello,

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.

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [December 19, 2020, 7:55am UTC](https://community.freefem.org/t/coordinates-of-dofs/696/2 "2020-12-19T07:55:56Z")

</div>

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

```

---

<div class="post-metadata">

**Author:** ![Alex](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@Alex](https://community.freefem.org/u/Alex)\
**Post date:** [December 19, 2020, 12:21pm UTC](https://community.freefem.org/t/coordinates-of-dofs/696/3 "2020-12-19T12:21:18Z")

</div>

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