Coord of DoF on vectorial space

Hello,

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

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?

I think you will need two vectors to get this:

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

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,

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;