# Coord of DoF on vectorial space

**URL:** <https://community.freefem.org/t/coord-of-dof-on-vectorial-space/2451>\
**Category:** General Discussion\
**Created:** [May 10, 2023, 12:17am UTC](https://community.freefem.org/t/coord-of-dof-on-vectorial-space/2451 "2023-05-10T00:17:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![larismartins](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/larismartins/32/2712_2.png) [@larismartins](https://community.freefem.org/u/larismartins)\
**Post date:** [May 10, 2023, 12:17am UTC](https://community.freefem.org/t/coord-of-dof-on-vectorial-space/2451/1 "2023-05-10T00:17:40Z")

</div>

Hello,

I’m trying to get the coordinates for a RT space. I’ve tried the following:

```auto
mesh Th = square(1,1);
fespace RTm(Th, RT1);

int ndofRTmK = RTm.ndofK;

real[int] dofPmd(ndofRTmK);
  for(int i=0;i<ndofRTmK;i++){
   dofPmd(i) = RTm(0,i);
  }
  cout << dofPmd << "\n";

  RTm [tX, tY] = [x, y];
  real[int,int] coorddofPmd(ndofRTmK,2);
  for(int i= 0; i <ndofRTmK; i++){
   coorddofPmd(i,0) = tX[][i];
   coorddofPmd(i,1) = tY[][i];
  }
cout << coorddofPmd << "\n";

```

but the values are all wrong. Can anyone help?

---

<div class="post-metadata">

**Author:** ![cmd](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/cmd/32/67_2.png) [@cmd](https://community.freefem.org/u/cmd)\
**Post date:** [May 10, 2023, 7:43am UTC](https://community.freefem.org/t/coord-of-dof-on-vectorial-space/2451/2 "2023-05-10T07:43:37Z")

</div>

I think you will need two vectors to get this:

```auto
  RTm [tx1, tx2] = [x, x];
  RTm [ty1, ty2] = [y, y];

```

---

<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 10, 2023, 9:52am UTC](https://community.freefem.org/t/coord-of-dof-on-vectorial-space/2451/3 "2023-05-10T09:52:35Z")

</div>

I’ve had problems with this but I guess you could put x into a scalar fespace  
and then do similar to the above suggestions , RTm xscl =x; RTm [tx1,tx2]=[xscl,xscl];

Although for better insight it may be best to create a simple varf on a small mesh  
and dump the matrix and RHS,

```auto
varf seedof([a,b],[va,vb],tgv=-1) = int2d(Th)(a*va)+int2d(Th)(tX*va)
+int2d(Th)(b*vb)+int2d(Th)(tY*vb);
matrix A=seedof(RTm,RTm);
cout<<A<<endl; cout.flush;

real[int] b =seedof(0,RTm);
cout<<b<<endl; cout.flush;

```
