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

Demo example is not running

0 votes

Hi,
I am new to fenics. It seems that Fenics has been installed properly as I can import it
by the command python -c 'import fenics', but demo example is giving the error message
as follows:

pandeya@KW12092:/usr/share/dolfin/demo/documented/poisson/python$ python demo_poisson.py 
Solving linear variational problem.
Traceback (most recent call last):
  File "demo_poisson.py", line 185, in <module>
    file << u
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-support@googlegroups.com
***
*** Remember to include the error message listed below and, if possible,
*** include a *minimal* running example to reproduce the error.
***
*** -------------------------------------------------------------------------
*** Error:   Unable to write to file.
*** Reason:  Unable to open file "poisson.pvd" for writing.
*** Where:   This error was encountered inside GenericFile.cpp.
*** Process: 0
*** 
*** DOLFIN version: 2016.2.0
*** Git changeset:  unknown
*** -------------------------------------------------------------------------

Aborted (core dumped)

Please help me out, thanks in advance for the co-operation.

With Best Regards
Anamika

asked Apr 30, 2017 by anamika FEniCS Novice (120 points)

1 Answer

0 votes

Dear Anamika,
Are you sure you have permission to write files?
Maybe try something like this in a directory where you are sure to have writing permission.


from dolfin import *
mesh = UnitCubeMesh(1,1,1)
file = File("/home/place/mesh.pvd")
file << mesh
answered May 2, 2017 by meron FEniCS User (2,340 points)
...