I am not quite sure what is going wrong here..
when I run the following code
phi = interpolate(Constant(0) ,V)
a_phi = Function(V)
e_n = Function(V)
e_n.vector()[:] = 1
a_phi.vector()[:] = (1 - phi.vector()[:])
a_phi_2 = Constant(1) - phi
a_phi_3 = (e_n.vector()[:] - phi.vector()[:])
plot(phi, interactive = True)
plot(e_n, interactive = True)
plot(a_phi, interactive = True)
plot(a_phi_2, interactive = True)
I get that
phi = 0
e_n = 1
a_phi = -1 (why? I dont get this - shouldnt it be 1?)
a_phi_2 = 1
a_phi_3 = 1
is this a bug?
Or didnt I get the syntax right?