Element signature is fragile

Issue #441 resolved
Jan Blechta created an issue

There is something wrong with element signature. The following

from dolfin import *

mesh =  UnitSquareMesh(5, 5)
V = VectorFunctionSpace(mesh, "CG", 2)
Q = FunctionSpace(mesh, "CG", 1)
T = TensorFunctionSpace(mesh, "CG", 1)
W = MixedFunctionSpace([V, Q, Q, Q, T, Q])

boundary = lambda x, onb: True
e = Expression(('-x[1]*(x[1]-1.0)', '0.0'))
bc = DirichletBC(W.sub(0), e, boundary)

w = Function(W)
F_ns = inner(w, TestFunction(W))*dx
solve(F_ns == 0, w, bc)

fails with the message

*** Error:   Unable to assemble form.
*** Reason:  Wrong type of function space for argument 1.
*** Where:   This error was encountered inside Form.cpp.

The bug seems very strange as changing almost anything regarding BC avoids the failure.

Comments (5)

  1. Log in to comment