dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #04772
Re: Plotting works for elasticity demo
Ola Skavhaug wrote:
Garth N. Wells skrev den 26/04-2007 følgende:
Ola Skavhaug wrote:
Garth N. Wells skrev den 26/04-2007 følgende:
Ola Skavhaug wrote:
Garth N. Wells skrev den 26/04-2007 følgende:
I get the error
Reading function from elasticity.xml.
Reading vector from file elasticity.xml.
Reading mesh from file elasticity.xml.
Traceback (most recent call last):
File "plot.py", line 4, in ?
plot(u, mode="displacement")
TypeError: plot() got an unexpected keyword argument 'mode'
when trying to plot.
Garth
Sure, you'll need to pull and install the newest version of viper.
Anders had a similar problem (after pulling) yesterday, but we couldn't
figure out the error.
I've pulled the latest version, but I'm still getting the error.
Garth
What does line 93 in viper_dolfin.py look like? Mine (after a fresh clone)
looks like this:
def plot(data, *args, **kwargs):
Mine looks exactly the same.
Then there is a problem with your installation, somehow.
Check viper_dolfin.py in the directory given by the following command:
python -c "import viper; print viper.__file__"
On my computer that is:
/usr/lib/python2.4/site-packages/viper/__init__.pyc
so /usr/lib/python2.4/site-packages/viper is the directory.
Looks like a problem with my VTK-Python bindings. I get
>python2.4 -c "import viper; print viper.__file__"
Traceback (most recent call last):
File "<string>", line 1, in ?
File "/usr/lib/python2.4/site-packages/viper/__init__.py", line 1, in ?
from viper import *
File "/usr/lib/python2.4/site-packages/viper/viper.py", line 10, in ?
import vtk
ImportError: No module named vtk
My python-vtk package is for Python 2.5, whereas I'm using Python 2.4
due to the SWIG bug. If I do
python -c "import viper; print viper.__file__"
I get
/usr/lib/python2.5/site-packages/viper/__init__.pyc
Garth
Ola
Garth
Ola
Ola
Anders Logg wrote:
After som bug fixes and some improvements to Viper, plotting the
solution of the elasticity demo now works:
from dolfin import *
u = Function("elasticity.xml")
plot(u, mode="displacement")
/Anders
_______________________________________________
DOLFIN-dev mailing list
DOLFIN-dev@xxxxxxxxxx
http://www.fenics.org/mailman/listinfo/dolfin-dev
_______________________________________________
DOLFIN-dev mailing list
DOLFIN-dev@xxxxxxxxxx
http://www.fenics.org/mailman/listinfo/dolfin-dev
Follow ups
References