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

Can't import UnitSquare

0 votes

I am trying to run the first example of the tutorial but fails,
turns out that does not import

>>> from dolfin import UnitSquare
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
 ImportError: cannot import name UnitSquare

The installation was done in ubuntu with

 sudo add-apt-repository ppa:fenics-packages/fenics
sudo apt-get update
sudo apt-get install fenics
sudo apt-get dist-upgrade

Maybe is nedded some package

asked Jun 15, 2014 by user478 FEniCS Novice (230 points)

1 Answer

+2 votes
 
Best answer

A bunch of mesh classes were renamed in FEniCS version 1.1 in order to avoid name clashes with similar geometry classes (see "Interface Changes" in the Release Notes: http://libelemental.org/releases/1.1/index.html). I'm surprised that this has not been changed in the tutorial yet, but if you replace UnitSquare with UnitSquareMesh is should work.

answered Jun 15, 2014 by Maximilian Albert FEniCS User (1,750 points)
selected Jun 16, 2014 by user478

thanks, it worked.

...