Hello everyone, I hope you are all doing well.
I have the following code, one that assigns the value of a constant in a given node.
from dolfin import *
import numpy as np
mesh = UnitSquareMesh(10,10)
V = FunctionSpace(mesh, "CG", 1)
x = V.tabulate_dof_coordinates()
point = [0.5,0.5]
index = np.where((x == point).all(axis=1))[0][0]
u = Function(V)
value = 1
u.vector().vec().setValueLocal(index, value)
print(u.vector().get_local())
I need the same thing done, but for a vector field, such that for example, u in (0.5,0.5) has a value of (-1 , 1). Can it be done?
Thanks in advance