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

Demo programs fail due to UFL incompatibility

0 votes

Hello everybody.

I have compiled the source code of Fenics 1.6.0 on my own and cannot run the example programs in Python. The C++ implementation works.

I have downloaded all required packages (instant, fiat, ffc, ufl, dolfin, etc., all version 1.6.0) from the Bitbucket Repository and followed the installation instructions. Everything is installed in /usr/local and the Python-Modules into /usr/local/lib/python2.7/dist-packages which is also added to PYTHONPATH.

When I try to run a demo program i get the error message:

> python demo_poisson.py 
Traceback (most recent call last):
  File "demo_poisson.py", line 41, in <module>
    V = FunctionSpace(mesh, "Lagrange", 1)
  File "/usr/local/lib/python2.7/dist-packages/dolfin/functions/functionspace.py", line 460, in __init__
    ufl_domain, mesh = _analyse_mesh_argument(mesh)
  File "/usr/local/lib/python2.7/dist-packages/dolfin/functions/functionspace.py", line 85, in _analyse_mesh_argument
    if not isinstance(mesh, (cpp.Mesh, cpp.Restriction, ufl.Domain)):
AttributeError: 'module' object has no attribute 'Domain' 

Removing the last argument (ufl.Domain) solves this error, but then the program crashes at another point with a similar error.

I am a little bit surprised about the following:

> ufl-version 
2016.1.0

Shouldn't it return 1.6.0? I have downloaded the file ufl-1.6.0.tar.gz from https://bitbucket.org/fenics-project/ufl/downloads and there is no other Fenics version installed. I compiled and installed ufl with the command

python setup.py install

as proposed in the README file.

I have no idea what the mistake is.

Thanks already in advance.
Regards,
Max

asked Aug 29, 2016 by max3000 FEniCS Novice (120 points)

According to lib/python2.7/site-packages/ufl/__init__.py you should get 1.6.0.

ufl-version should return the version of the

from ufl import __version__   
print(__version__)            

2016.1.0 is the latest stable release of UFL (and FEniCS). If ufl-version shows you 2016.1.0, then this is the version you have installed.

...