[vtkusers] whoever did have experience in reading PLOT3D data into VTK?

Kevin Wright krw at viz-solutions.com
Fri Apr 26 15:22:24 EDT 2002


At 02:24 PM 4/24/2002 -0700, you wrote:
>I am trying to input my CFD mesh into VTK. The data is
>in PLOT3D format and it's unformatted. But
>vtkPLOT3Dreader cannot read my file correctly. I am
>suffering from it. May you help me and point out the
>reason?
>
>I appreciate your reply.

Actually, the VTK Plot3D reader has some shortfalls. First off, most CFD 
solvers are written in FORTRAN and their output is FORTRAN unformatted, 
which is different from binary that C programs output. The difference is 
that when you write a block of data in binary, it is written as is, in 
FORTRAN unformatted, it is written with a header and footer which is a 
single integer that is the size of the data block. So, for instance, if you 
write out 100 bytes of information, FORTRAN unformatted will write:

100
<data>
100

Your file is most likely FORTRAN unformatted.

The other thing that the VTK reader does not handle that CFD codes may use 
is iblanking. This is block-off, so instead of each point being defined by 
x,y,z it is defined by x,y,z,i where i is either 0 or 1 (blanking on/off). 
You can possibly ignore IBlanking, but it will screw up the read since 
there's an extra 4 bytes for each point.

I had a hacked up version of the reader sitting around at one point. I 
intended to clean it up and submit it, but never got the time, and I'm not 
even sure if I still have it. This problem has come up a couple of times 
that I've noticed, so if you, or anyone else would like to take a pass at 
some cleanup, I can try to dig up the old copy. Otherwise, its a pretty 
straight forward change, just toss away (or check) 4 bytes before and after 
each data block, and check to see if there are (Number of Points) * 3 or 
(Number of Points) * 4 numbers in the point definition.

Kevin.






More information about the vtkusers mailing list