How to directly convert geo file to vtk?

Asked by Feng Chen

HI, All:

Is there a direct command to convert geo file to vtk?
For example, I have a very simple .geo file like this:

LSMGeometry 1.2
BoundingBox 0 0 0 11 22 11
PeriodicBoundaries 0 0 0
Dimension 3D
BeginParticles
Simple
4
1 1 1 1 0 12345
1 1 1 1 0 12345
1 1 1 1 0 12345
1 1 1 1 0 12345
EndParticles
BeginConnect
3
0 1 0
1 2 0
2 3 0
EndConnect

If this will be the initial packing of my simulation, is there a way to directly convert it to vtk format and then use paraview to visualize the packing? I tried dump2vtk, however it seems that the input file needs to be a CheckPointer output (2 files as in the examples mentioned in the Manual), although the CheckPointer output is no much different with the .geo file.

Although I found MICHELE GRIFFA's blog (Thanks to his work!!), is there a complete reference for the dump2vtk?:

http://scientificandhpcomputing.blogspot.com/2009_07_01_archive.html

Thanks a lot!

Feng

Question information

Language:
English Edit question
Status:
Solved
For:
ESyS-Particle Edit question
Assignee:
No assignee Edit question
Solved by:
Feng Chen
Solved:
Last query:
Last reply:
Revision history for this message
Dion Weatherley (d-weatherley) said :
#1

Hi Feng,

There's no direct way to convert a geo file to VTK format, unless the geo file was generated using GenGeo. GenGeo.MNTable3D.write(..) can be used to write out a VTK version of the particle geometry as well as a geo file.

Since I assume you have created your geo file by hand, the simplest way to convert to VTK using existing tools would be to run an ESyS-Particle simulation for one timestep having imported the geometry and set up a CheckPointer. Once the simulation is done, just use dump2vtk to convert the checkpoint files to VTK. This is not an elegant solution but it works...

Currently there is no complete reference for dump2vtk, but as it would happen, one of my colleagues is working on that at the moment. I'm also planning to add a chapter to the Tutorial on dump2vtk and other post-processing tools. That probably won't be released until 2011 though.

Cheers,

Dion.

P.S. Your example geo file has all four particles located at the same location and with the same particle ID. You will probably want to change this for a real simulation. In particular, every particle should have a unique ID. There's more information about the geo file format here:
https://answers.launchpad.net/esys-particle/+faq/877

Revision history for this message
Feng Chen (fchen3-gmail) said :
#2

Thanks Professor Dion for your prompt answer,

My current solution is hand write (or generate using a script) the CheckPointer file and then rename the file to match CheckPointer output name format, then use the dump2vtk to convert the data to vtk format.

The file I put on the initial post was something I wrote randomly, and you also reminded me an issue that if hand write or scripting the initial input, how to check the correctness/integrity of the input data.

Feng