Problem with ubuntu installation

Asked by Mostafa Khosrownejad on 2013-02-07

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

>python demo_eigenvalue.py
Traceback (most recent call last):
  File "demo_eigenvalue.py", line 43, in <module>
    mesh = Mesh("box_with_dent.xml.gz")
  File "/usr/lib/python2.7/dist-packages/dolfin/cpp.py", line 9367, in __init__
    _cpp.Mesh_swiginit(self,_cpp.new_Mesh(*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
***
*** https://answers.launchpad.net/dolfin
***
*** 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

Language:
English Edit question
Status:
Solved
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Solved by:
Mostafa Khosrownejad
Solved:
2013-02-08
Last query:
2013-02-08
Last reply:
2013-02-08
Johannes Ring (johannr) said : #1

Is there a file box_with_dent.xml.gz in the same directory as demo_eigenvalue.py? 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
  python demo_eigenvalue.py

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 demo_poisson.py
Traceback (most recent call last):
  File "demo_poisson.py", 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?

Thanks

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

Thanks

Johannes Ring (johannr) said : #5

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

http://fenicsproject.org/documentation/all.html

Thanks anyway for your help.

On 02/08/2013 12:26 PM, Johannes Ring wrote:
> Your question #221293 on DOLFIN changed:
> https://answers.launchpad.net/dolfin/+question/221293
>
> 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:
>
> http://fenicsproject.org/documentation/all.html
>