Hi all,
I have a scalar function (c) which gets multiplied by a vector (v) and inserted into a vector function space (d):
d = c*v
I can do this using projection (below) but I'm sure there is a better way using vector operations with c.vector(), but I can't figure out how to do it. Can anyone suggest?
from dolfin import *
mesh = RectangleMesh(0.0,0.0,1.0, 1.0,10,10)
V = FunctionSpace(mesh, "Lagrange", 1)
V_vec = VectorFunctionSpace(mesh, "Lagrange", 1)
c = project(Expression('x[0]'), V)
v = as_vector((1,2))
d = project(c*v,V_vec)
Thanks