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

Installation of FEniCS under Ubuntu 14.04 64bit

0 votes

I would like to try the fenics project for mesh generation.
For installation purposes on my Ubuntu 14.04 64bit system I followed the instructions on the website (

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

).
During installation proces I received the error message
...

Processing triggers for python-support (1.0.15) ...
/usr/lib/pymodules/python2.7/scitools/pyreport/main.py:268: SyntaxWarning: import * only allowed at module level
def __call__(self, name, globals=None, locals=None, fromlist=None,
/usr/lib/pymodules/python2.7/scitools/pyreport/main.py:285: SyntaxWarning: import * only allowed at module level
def __call__(self, name, globals=None, locals=None, 

However I tried to install FENICS using the given repositories:

$ sudo apt-get install fenics

Running the tutorial CSG3D gives the following Error-Message:

DOLFIN must be compiled with CGAL to run this demo.

Any suggestions how I can fix this would be greatfuly acknowledged.

asked Nov 17, 2014 by konrad.schneider FEniCS Novice (120 points)

1 Answer

0 votes

Mesh generation has been spun out to a project called 'mshr'

https://bitbucket.org/benjamik/mshr

answered Nov 17, 2014 by chris_richardson FEniCS Expert (31,740 points)

Thanks for the quick response.
I looked at the installation documentation (https://bitbucket.org/benjamik/mshr/wiki/Installation)
which says that the mshr is installed with the $ sudo apt-get install fenics. How ever still cannot conduct the 3d-csg-tutorial.
Can you give me directions how to retrieve the source files?

You can retrieve the code with git:

git clone https://git@bitbucket.org/benjamik/mshr.git

should work.

Thanks for the hint.
But when I run

 cmake /home/schneider/Downloads/mshr/src/

I get

CMake Error: The source directory "/home/schneider/Downloads/mshr/src" does not   appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.

Is there something missing or did I use the cmake -command wrong?

I managed to install it now.
The folder I specified was wrong. The right command is:

 cmake /home/schneider/Downloads/mshr/

Now I wanted to try the tutorial CSG3D
but still get the same error-message :(

Maybe just delete the check for CGAL. I guess mshr has it already?

You can always check if mshr is installed correctly first with

from mshr import *

I recommend trying a few things out from the ipython command line.

I commented the relevant lines and tried to run the tutorial fiel again.
Still no sucess.
Here is the corresponding error message:

Compact output of 3D geometry:
((Box(0, 0, 0, 1, 1, 1) + Cone( <Point x = 0 y = 0 z = -1>, <Point x = 0 y = 0 z = 1>, 1, 0.5 )) - Sphere(<Point x = 0 y = 0 z = 0>, 0.3))

Verbose output of 3D geometry:
<Difference>
{
  <Union>
  {
    <Box with first corner at (0, 0, 0) and second corner at (1, 1, 1)>
    <Cone with top at <Point x = 0 y = 0 z = -1>, top radius 1 and bottom at <Point x = 0 y = 0 z = 1>, bottom radius 0.5, with 32 slices>
  }
  <Sphere at <Point x = 0 y = 0 z = 0> with radius 0.3>
}
*** Warning: Mesh is empty, unable to create entities of dimension 0.
Traceback (most recent call last):
  File "test.py", line 22, in <module>
    plot(g3d, "3D geometry (surface)")
  File "/usr/lib/python2.7/dist-packages/dolfin/common/plotting.py", line 132, in plot
    plot_object = cpp.plot(object, p)
  File "/usr/lib/python2.7/dist-packages/dolfin/cpp/io.py", line 318, in plot
    return _io.plot(*args)
RuntimeError: 

*** -------------------------------------------------------------------------
*** DOLFIN encountered an error. If you are not able to resolve this issue
*** using the information listed below, you can ask for help at
***
***     fenics@fenicsproject.org
***
*** Remember to include the error message listed below and, if possible,
*** include a *minimal* running example to reproduce the error.
***
*** -------------------------------------------------------------------------
*** Error:   Unable to create mesh entity.
*** Reason:  Mesh entity index 0 out of range [0, 0] for entity of dimension 0.
*** Where:   This error was encountered inside MeshEntity.cpp.
*** Process: unknown
*** 
*** DOLFIN version: 1.4.0
*** Git changeset:  unknown
*** -------------------------------------------------------------------------

However I tried the example of the tutorial in the getting started section tutorial this works well with python in the sense that I do not get any error messages. But I also did not get any output neither mesh or GUI. Does mshr has a gui interface?
My main goal is to mesh a geometry build up by csg just like in the intenionally investigated 3d csg tutorial.
Is there any chance this will work or does the mshr library needs still some develompment time? May be I could help.

We are working on a fix for mshr and DOLFIN 1.4.0 which should be available soon.

I am also currently stuck with the same problem. I tried it on different ubuntu-type
linux platforms to run the cgs exmaples. But I also got the same error message as
K. Schneider above.

Is there already any update on this available?

I am gratefule for help on this. Thank you in advance ...

...