I would like to form a dot product of the first two components of a three-dimenstional vector with grad(u)
from a two-dimensional mesh. How can I select the components of conv
such that the following code works?
from dolfin import *
mesh = UnitSquareMesh(10, 10)
V = FunctionSpace(mesh, 'CG', 1)
conv = Constant([1.0, 2.0, 3.0]) # comes from elsewhere
u = TrialFunction(V)
# ufl.log.UFLException: Dimension mismatch in dot product.
dot(conv, grad(u))