This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Strange Error building mixed FunctionSpace on the "same???" FEniCS version!

0 votes

Hi, I can build a mixed Nedelec-Space in my FEniCS Version 2016.2.0 installed in 12/2016 as follows with no errors:

import dolfin as df

p = 1
mesh = df.UnitCubeMesh(10, 10, 10)
ele = df.FiniteElement("N1curl", mesh.ufl_cell(), p)
print(ele)
W = df.FunctionSpace(mesh, df.MixedElement([ele, ele]))

The output is:

 <N1curl1 on a tetrahedron>

Now a colleague tries exactly the same code snippet with FEniCS 2016.2.0 installed within the last days (also on Ubuntu) and he gets the following output/error on 2 different PC's:

 <N1curl1 on a <Domain built from <tetrahedron cell in 3D> with label None>>
 Traceback (most recent call last):
    File "debug.py", line 19, in <module>
      W = df.FunctionSpace(mesh, df.MixedElement([ele, ele]))
 TypeError: __init__() takes at least 4 arguments (3 given)

Why is this happening? Is there a difference in the two FEniCS 2016.2.0 versions? At least the print function gives something diffent ...

asked Mar 17, 2017 by RR FEniCS User (3,330 points)

Works fine for me both with version 2016.2.0 and the latest development version. I have tested with the Ubuntu packages and using the docker images. No problem with any of them.

Thank you! Annother colleague has no issues as well. So the problem must be somethere else.

Maybe he is mixing multiple versions of FEniCS. For example he can have 2016.2.0 installed in /usr from the Ubuntu packages but have a different version installed in some other location like /usr/local or ~/.local. In that case, it would help to remove the other version. If not, then please show us the complete error message.

1 Answer

0 votes

Everything is fine, my colleague was accidently using a 2016.1 FEniCS version. In this version, you had to define mixed spaces via MixedFunctionSpace, which was deprecated in 2016.2.

answered Mar 23, 2017 by RR FEniCS User (3,330 points)
...