Problem with ubuntu installation

Asked by Mostafa Khosrownejad on 2013-02-07

I encountered following error just after installation and testing the first demo

Traceback (most recent call last):
  File "", line 43, in <module>
    mesh = Mesh("box_with_dent.xml.gz")
  File "/usr/lib/python2.7/dist-packages/dolfin/", line 9367, in __init__

*** -------------------------------------------------------------------------
*** DOLFIN encountered an error. If you are not able to resolve this issue
*** using the information listed below, you can ask for help at
*** Remember to include the error message listed below and, if possible,
*** include a *minimal* running example to reproduce the error.
*** -------------------------------------------------------------------------
*** Error: Unable to read data from XML file.
*** Reason: Unable to open file "box_with_dent.xml.gz".
*** Where: This error was encountered inside XMLFile.cpp.
*** -------------------------------------------------------------------------

Question information

English Edit question
DOLFIN Edit question
No assignee Edit question
Solved by:
Mostafa Khosrownejad
Last query:
Last reply:
Johannes Ring (johannr) said : #1

Is there a file box_with_dent.xml.gz in the same directory as It should be.

On Ubuntu, the demos are located in /usr/share/dolfin. Copy this into a directory where you have write permissions, for instance in your home directory:

  cp -r /usr/share/dolfin $HOME/

Then start the demo from this folder:

  cd $HOME/dolfin/demo/la/eigenvalue/python

Thanks for your response
I also have another problem running demo_poisson and other demos which use built in meshing function. The error that I am getting is :

$ python
Traceback (most recent call last):
  File "", line 40, in <module>
    mesh = UnitSquareMesh(32, 32)
NameError: name 'UnitSquareMesh' is not defined

I did check with C++ and had pretty the same error, i.e. error in constructing a mesh.

I really appreciate any comments

Johannes Ring (johannr) said : #3

UnitSquareMesh was first introduced in DOLFIN 1.1.0. Which version are you using?


The problem was I downloaded demos from the website and did not use a demo from the file structure.


Johannes Ring (johannr) said : #5

It is fine to download demos from the website, however, one should make sure to use the correct version:

Thanks anyway for your help.

On 02/08/2013 12:26 PM, Johannes Ring wrote:
> Your question #221293 on DOLFIN changed:
> Johannes Ring posted a new comment:
> It is fine to download demos from the website, however, one should make
> sure to use the correct version: