Hi,
I cannot figure out what is the vertice order.
mesh = UnitSquareMesh(4, 4)
mesh.translate(Point(-.5,-.5))
V = VectorFunctionSpace(mesh, "Lagrange", 1)
W = FunctionSpace(mesh, "Lagrange", 1)
c = TrialFunction(W)
u = TrialFunction(V)
nv = mesh.num_vertices()
arr = numpy.zeros((nv*2,))
crr = numpy.zeros((nv*1,))
coor = mesh.coordinates()
for i in range(nv) :
x = coor[i][0]
y = coor[i][1]
r = sqrt( x**2 + y**2 )
arr[i] = x
arr[i*2] = y
crr[i] = r
u.vector().set_local(arr)
c.vector().set_local(crr)
plot(c)
vector c and vector u aren't what I'm trying to set up.
coor[i] doesn't correspond to what is in c[i].
I'm trying to avoid the use of Expression, because I'll have very complicated expression.
Thanks for any help.