Reading vtk generated py pizza

Submitted by SergeiD on
SergeiD

In reply to by anonymous_stub (not verified)

No, I use gran_pizza_17Aug10.
Subject is not relevant for me now. I solved the problem by using only the dump module. But perhaps is there a bug in the pizza-vtk?

ps. Why is the pizza not a python package? I did it a package by adding __init__.py into /src and rename it to /pizza. So, I can import pizza modules by "from pizza.dump import dump" for example.

Fri, 15 Apr 2011 - 10:51 Permalink
ckloss

In reply to by anonymous_stub (not verified)

>>ps. Why is the pizza not a python package?
good question. What would be the advantages? if you create an alias for pizza with python - i .../src/pizza.py, you can still write your own script for pizza by starting pizza -f script.

Christoph

Sun, 17 Apr 2011 - 15:25 Permalink
SergeiD

In reply to by anonymous_stub (not verified)

For example, if I want to use vtk package (not pizza-vtk), I can do

import vtk
from pizza.dump import dump

In other case I can't use vtk because pizza's path is in front, so instead vtk will imports pizza-vtk.

Sun, 17 Apr 2011 - 17:19 Permalink
ckloss

In reply to by anonymous_stub (not verified)

If you would find this useful, feel free to change the pizza implementation, and send me the code so that we can release it (with attribution to you)

Christoph

Mon, 18 Apr 2011 - 11:08 Permalink

Hello.
I want to post process LIGGGHTS results with my python script.
So, I do convert from the dump to vtk by pizza.py and next want to read that vtk in my script in order to add some data to it. But I have a problem with reading. I do:

from vtk import *
rdr=vtkPolyDataReader()
rdr.SetFileName(fileIn)
rdr.Update()
grd=rdr.GetOutput()
pdata=grd.GetPointData()

Problem is pdata have only 2 arrays:

In [22]: pdata.GetNumberOfArrays()
Out[22]: 2
In [23]: pdata.GetArrayName(0)
Out[23]: 'v'
In [24]: pdata.GetArrayName(1)
Out[24]: 'atom_type'

So, no 'radius' and other arrays.
Please, could not explain me why is it?

ps. I did the test on examples/LIGGGHTS/packing case.

pps. In fact, I want to use voro++ to add to the LIGGGHTS results of the Voronoi volumes and perform further processing in ParaView. So, is there a ready-made solution for that?

Thanks!