I’m using macOS Mojave (10.14.6), miniconda, and FEniCS 2018 with Python.
Say I have a mesh, a FunctionSpace V and a function u living in V, i.e.
mesh = UnitSquareMesh(25, 25)
V = FunctionSpace(mesh, 'P', 1)
u = interpolate(Constant(1.0), V)
What I want to do is to set the inner nodes of u to 0, so I want to do something like
u.vector()[index of inner nodes] = 0
The thing is that I’m working with time dependent problems and I have to set, for each time, the inner nodes to zero. So I have a Matrix U\in \mathbb{R}^{N_t \times N_h}, where N_t is the amount of time-steps. In each row of U I saved the nodal values of the solution to time, say n. E.g.
U[n, :] = u.vector()[:]
So I want something like U[:, (index of inner nodes)] = 0. I have totally no idea how I could do that.