Legacy VTK files store data always in big endian so there is no compatibility problem. With XML you probably can specify.

Dominik

Shi Jin wrote:
Thank you Bryn and Ivo.

I agree binary format is more efficient. But I am reluctant to do that because of the issue of portability. I may run the code on both Linux clusters and IBM machines. My earlier experience shows me that the binary files on the two system are not compatible, i.e., I cannot load the data generated on a IBM machine on a Linux system. Does the little/big endian parameter solve this problem in paraview? Thanks.

Shi


----- Original Message ----
From: Bryn Lloyd <[EMAIL PROTECTED]>
To: Ivo Roghair <[EMAIL PROTECTED]>
Cc: Shi Jin <[EMAIL PROTECTED]>; [email protected]
Sent: Friday, November 28, 2008 12:17:39 AM
Subject: Re: [Paraview] File Format for Particles

Hi Shi,

Yes, for large amounts of data you should use the binary (not ascii) formats. It is very simple to switch between ascii/binary. In the writer classes (e.g. vtkPolyDataWriter) you can usually call the function SetFileTypeToBinary() or SetFileTypeToASCII().


An unstructured grid can of course be used to visualize your data in paraview. Since you not have cells (tetrahedra, hexahedra, etc.) a vtkPolyData data structure and associated file type might be better, since it uses slightly less storage and if you add the points as "Verts" Paraview will automatically display them using glyphs (sphere,arrow,..)

File formats are described here:
http://www.vtk.org/pdf/file-formats.pdf


--Bryn





Ivo Roghair wrote:
Hi Shi,

Saving such amounts of data in ascii format is not going to be efficient. We
just accepted this fact, otherwise we should go to binary formats.
In our group we have discrete particle simulations, and we export vtk files
(xml format -- an unstructured grid to be precise) that contains all the particle data. I have included an example of such a file below. You write the point positions of the particles first, followed by data concerning the movement of the particle, the diameter and other stuff like rotation, temperature, etc... I don't see what you mean by redundant data. When you load this file into Paraview choose the glyph option, choose 'sphere', set 'radius' to 1 (it is initially set to 0.5), scale mode to 'scalar' and scale factor to 1. You can then draw the particles. You can color them by velocity, temperature, rotation or whatever you included in the file, or you can choose to show arrows (another glyph) to display the particle movement.
For the flow field, which is calculated on a structured grid, you can use
another file format, e.g. rectilinear grid. In all cases the kitware/vtk file formats documentation is going to be useful.
Regards,
Ivo Roghair

PhD student at Fundamentals of Chemical Reaction Engineering
University of Twente, The Netherlands

------------------ BEGIN EXAMPLE FILE ---------------------

format="ascii">
       0 0 0 1 1 1 0 0 1
format="ascii">
       4 4 4 4 0 0 2 2 -2
0.1 0.5 1 273 300 350
---------- END EXAMPLE FILE --------------

Shi Jin wrote:
Hi there,

I am doing a simulation of fluid-particle interactions, in which I generate a
lot of data for particles. I am looking for the efficient file format to store my particle information for visualization with paraview. For example, is there a file format that allows me to store all the particle information at a given time in a single ascii file, which looks like
#1-id 2-radius 3-rho_p 4-fixed 5-x 6-y 7-z 8-u 9-v 10-z 11-w1 12-w2 13-w3
14-alpha 15-theta 17-phi
0 0.500000 1.200000 0 2.077176 2.678227 8.649375 0.000000 0.000000 0.000000
0.000000 0.000000 0.000000 0.000000 0.000000
1 0.500000 0.800 0 2.728281 0.873571 6.806029 0.000000 0.000000 0.000000
0.000000 0.000000 0.000000 0.000000 0.000000
...

I guess for the purpuse of visualization, we need radius, rho_p(for color),
x,y and z at least. The rotation information would be nice to have but is considered optional at this stage.
I am thinking to save different time results in different files to make the
loading efficient in terms of memory since I have a lot of particles here. Then we can produce animation using time control. I guess we could use VTK formats but that has lots of redundant information.
I saw some very early discussion on a similar topic in the forum but didn't
get the conclusive answer. I would appreciate some advice for the current version of paraview.
Thank you very much.

 --
Shi Jin, PhD



      _______________________________________________
ParaView mailing list
[email protected]
http://www.paraview.org/mailman/listinfo/paraview
_______________________________________________
ParaView mailing list
[email protected]
http://www.paraview.org/mailman/listinfo/paraview


-- -------------------------------------------------
Bryn Lloyd
Computer Vision Laboratory
ETH Zürich, Sternwartstrasse 7
CH - 8092 Zürich, Switzerland
Tel: +41 44 63 27690
Fax: +41 44 63 21199
-------------------------------------------------



_______________________________________________
ParaView mailing list
[email protected]
http://www.paraview.org/mailman/listinfo/paraview


--
Dominik Szczerba, PhD
Computational Physics Group
IT'IS Foundation
http://www.itis.ethz.ch
_______________________________________________
ParaView mailing list
[email protected]
http://www.paraview.org/mailman/listinfo/paraview

Reply via email to