Starting with
from dolfin import *
mesh = UnitSquareMesh(nx, ny)
V = FunctionSpace(mesh, "CG", 1)
I obtain an object u of class Function(V).
Is there a way to build and store a 2-dimensional numpy array arr of size nx-by-ny such that
arr[i][j] = u(i * 1.0 / nx, j * 1.0 / ny)
for each i in range(nx) and each j in range(ny)?