Error assembling tensor and row-wise functions
Issue #97
new
The following throws an error
from dolfin import *
mesh = UnitSquareMesh(10,10)
M = MixedElement([VectorElement('BDM', mesh.ufl_cell(), 1),
VectorElement('DG', mesh.ufl_cell(), 0)])
W = FunctionSpace(mesh, M)
tau, v= TestFunctions(W)
w_n = Function(W)
w_n.vector()[:] = 0.
sigma_n, u_n = w_n.split()
b = dot(v, div(sigma_n))*dx
assemble(b)
As the error message says, it crashes in apply_function_pullbacks.py, because sigma_n is a row wise vector element. There is a comment on the code:
# By placing components in a list and using as_vector at the end,
# we're assuming below that both global function g and its
# reference value r have vector shape, which is the case for most
# elements with the exceptions:
# - TensorElements
# - All cases with scalar subelements and without symmetries
# are covered by the shortcut above
# (ONLY IF REFERENCE VALUE SHAPE PRESERVES TENSOR RANK)
# - All cases with scalar subelements and without symmetries are
# covered by the shortcut above
# - VectorElements of vector-valued basic elements (FIXME)
# - TensorElements with symmetries (FIXME)