# Obtaining corresponding point values from GridFunction

Hello. I have a GridFunction where my solution at a timestep is defined for my mesh (in a .sol file). I projected this data on a second uniform mesh successfully by doing the following:

[code]
#mesh is my original mesh, mesh_uniform is my uniform mesh.

#DEFINING FINITE ELEMENT SPACE

V = VectorH1(mesh, order=poly)

# Pressure Space

Q = H1(mesh, order=poly-1)

# Mixed Finite Element space

fes = FESpace([V, Q])
#For uniform grid
V_2 = VectorH1(mesh_uniform, order=poly)
Q_2 = H1(mesh_uniform, order=poly-1)
fes_2 = FESpace([V_u,Q_u])

gfu1 = GridFunction(fes)
gfu2 = GridFunction(fes_2)

gfu2.components[0].Set(gfu1.components[0])

velocity2 = gfu2.components[0][/code]

When I visualize velocity2, which is my velocity data projected on the uniform mesh, I see the expected results.

Now that I know I have the correct data stored in gfu2, how do I access the actual velocity/pressure data and their corresponding points? I’ve been doing the following, but got confused because what I thought was the velocity turned out to be a 2x2 vector, I was expecting a 2x1 for Ux, Uy.

```for p in mesh_uniform.vertices: print(velocity2(mesh_uniform(p.point)), "point = ", p.point)```

This gives the following output (just pasted a few of many):

```[[-5.38850269e-05 8.02748156e-07] [ 3.10929498e-05 -1.96726351e-07]] point = (0.5, 1.0) [[-6.66841541e-05 6.56785237e-09] [ 3.10929498e-05 -1.96726351e-07]] point = (0.44999999999999996, 1.0) [[-6.12298336e-05 -1.44793065e-05] [ 3.10929498e-05 -1.96726351e-07]] point = (0.3999999999999999, 1.0) [[-3.04427322e-05 -1.85570629e-05]```

I think I solved this by doing: velocity2(mesh_uniform(*p.point)) instead

Yes, short explanation of the pitfall:
The mesh has in its call operator default values = 0 for y and z component (so that for a 1d mesh you dont have to write mesh(xval, 0, 0)), and it is a vectorized function, so if called with a numpy array/list/… it will be called for every element of the list.
So what you did was evaluate the function at (x, 0), (y, 0) instead of at (x,y).

Hope this explains the confusing behaviour…

Best
Christopher