Hi, I want to assign values to specific node for one component (vectorFunctionSpace). Please find the attached MWC. current code is not able to assign for vector.
from dolfin import *
import numpy as np
mesh = UnitSquareMesh(10,10)
V = VectorFunctionSpace(mesh, "CG", 1)
w = Function(V)
x = V.tabulate_dof_coordinates()
w_array = w.vector().get_local()
for i in range(mesh.num_vertices()):
if x[i][0]==0 and x[i][1]<=0.5:
w_array[i][0] = 1.0
w.sub(0).vector().set_local(w_array)
p=plot(w[0])
plt.colorbar(p)
plt.show()`