Dear all,
I'm playing around with voro++ and was wondering if anyone out there managed to write a script to show the voronoi cells in paraview. I know voro comes with POV ray support but I would rather have all the data/postprocessing in one program (=Paraview). I am thinking about extending the voro++ code to have some functions that could be used to write VTK files for paraview but I am still wondering which of the possible Paraview input formats is the best for this purpose.
Any recommendations, code fragments or help on this ?
Thanks.
msbentley | Thu, 05/03/2012 - 10:01
Good question :)
I was also thinking about this, but haven't implemented anything yet. My plan was to use the Voro++ custom output (http://math.lbl.gov/voro++/doc/custom.html) to dump the vertices to a file, and then to write a python script to produce VTK output.
Previously I used the pyEVTK package (https://bitbucket.org/pauloh/pyevtk) to do something similar and produce force chain output in VTK (https://code.google.com/p/liggghts-force-chains/) which is essentially also a set of straight line segments (vertices).
So I think it shouldn't be so hard, but I haven't actually tried yet...
Cheers, Mark
flobot | Fri, 05/04/2012 - 13:24
Did it: Voro++ to VTK
Dear Mark, dear all,
ok so I wrote some C++ lines writing voro++ cell information to VTK data format and it works fine It is quick and dirty but it works. I thought of going into voro++'s source code to add something like a "draw_cells_vtk(..)" method. But in the end I build upon the polygons example. Nevertheless the code could be easily incorporated into the library and I might also send it to Chris Rycroft (maybe for a future release).
If anyone is interested I am happy to share. Could please someone give me some suggestions on how to efficiently post the source code here. Its only about 150-200 lines but even with code-tags I cannot post all of it (preview ?).
Cheers,
Flo
ckloss | Mon, 05/07/2012 - 09:18
Hi Flo, good to hear it
Hi Flo,
good to hear it worked out! If you want to share source code, you can attach it in the forums by starting a new thread.
Cheers, Christoph
psoo | Thu, 08/01/2019 - 19:07
Voro++ to VTK still available?
Hello Flobot,
It's been more than 7 years from your post, but I would like to do exactly what you did. Do you still have the code and would be willing to share?
Thanks a lot!
wmfarmer | Wed, 08/14/2019 - 18:42
Voro++ to vtk still available?
Hey psoo,
Have figured out how flobot did this? I am stuck in a similar place, and any insight into this problem, even if not solved, would be helpful.
Thanks!