Hello !
I am new to fenics and something puzzles me when i was trying this:
from fenics import *
import matplotlib.pyplot as plt
mesh = UnitSquareMesh(8,8)
V = FunctionSpace(mesh, "P", 1)
u = Function(V)
u.vector()[0] = 10
print(mesh.coordinates()[0])
plot(u)
plt.show()
In my opinion, after modifying the u.vector()[0]
, the value of u at point mesh.coordinates()[0]
should be changed. However, the picture painted shows that the value of u at point (0.0, 1.0) was changed.
How strange! Who can explain it?