# Grid Co-ordinates of Variables

**URL:** https://community.freefem.org/t/grid-co-ordinates-of-variables/2470
**Category:** General Discussion
**Created:** [May 17, 2023, 2:31pm UTC](https://community.freefem.org/t/grid-co-ordinates-of-variables/2470 "2023-05-17T14:31:48Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![D\_N\_Sarkar](https://avatars.discourse-cdn.com/v4/letter/d/0ea827/32.png) [@D\_N\_Sarkar](https://community.freefem.org/u/D_N_Sarkar)
#### Post date: [May 17, 2023, 2:31pm UTC](https://community.freefem.org/t/grid-co-ordinates-of-variables/2470/1 "2023-05-17T14:31:48Z")

</div>

Say I have two variables: u and p. ‘u’ is discretized by P2 and ‘p’ by P1.

Please see the following code:

//============================================  
mesh Th = square(10,10);  
plot(Th, wait=1);

fespace femp1(Th,P1);  
fespace femp2(Th,P2);

femp1 p; //p:=pressure  
femp2 u; //u:=velocity

p = 3.7;  
u = 5.4;

//======================================  
**Doubt** : How do I get the grid co-ordinates of the variables u and p (‘u’ is discretized by P2 and ‘p’ by P1)?

---

<div class="post-metadata">

### Author: ![marchywka](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@marchywka](https://community.freefem.org/u/marchywka)
#### Post date: [May 17, 2023, 3:01pm UTC](https://community.freefem.org/t/grid-co-ordinates-of-variables/2470/2 "2023-05-17T15:01:27Z")

</div>

femp1 xc=x;  
cout\<\<xc \<\<endl;

I thought this was odd but its a recurring paradigm in FF and handy  
once you are used to it.
