[vtkusers] I need helping for use properly the simple legacy format
Aradenatorix Veckhom Vacelaevus
aradnix at gmail.com
Tue May 17 20:07:49 EDT 2011
Hi everybody:
Well, I'm working with a textfile obtained from FORTRAN with information of
positions, displacements, and the value of the pressure or velocity from a
model analyzed by FEM. We are analizing how two miscible fluids move over a
general geometry.
So I need to implement a visualization using VTK. I thought that perhaps I
could do it easily with Mayavi2, so searching info about it in the
documentation I found a PDF document called VTK file formats, it's a small
part taken from the VVTK User's Guide.
So I read the document and I found how to structure a VTK data file format,
but I have not enough information yet and many doubts. I used the examples
and I could visualize them quite well inside Mayavi, but now I don't know
how to do it for my real example.
>From my Fortran file I have this:
1 .000E+00 .000E+00 .000E+00 .200E+01 .200E+01 .200E+01
485879165.658
2 .200E+01 .000E+00 .000E+00 .200E+01 .200E+01 .200E+01
362994604.232
3 .400E+01 .000E+00 .000E+00 .200E+01 .200E+01 .200E+01
287889668.714
4 .600E+01 .000E+00 .000E+00 .200E+01 .200E+01 .200E+01
249984468.929
5 .800E+01 .000E+00 .000E+00 .200E+01 .200E+01 .200E+01
224851296.708
there are the first five lines with information, the first col is simply the
number of the row, the following three columns are the x, y and z values of
the position for each point, the next three are the values of the
displacements, and the final column is the value of the pressure in each
point.
So in the analysis we divide the phenomenon in 5 subdomains, so in each case
we have this array.
Well I understand I should build a VTK file like this:
# vtk Datafile Version 3.0
Visualization of subdomains 1
ASCII
DATASET STRUCTURED_GRID
DIMENSIONS 3 3 3
POINTS 5 float
.000E+00 .000E+00 .000E+00
.200E+01 .000E+00 .000E+00
.400E+01 .000E+00 .000E+00
.600E+01 .000E+00 .000E+00
.800E+01 .000E+00 .000E+00
SCALARS dataName dataType numComp
LOOKUP_TABLE tableName
s0
s1
...
sn-1
CELL_DATA
I gave a name, later I say the data are in ASCII format, and according we
want to see, from what I read I think the DataSet should be Structured grid,
I'm not sure what should I write as dimension, but I guess if my
visualization is 3d perhaps I should use 3 for x, y and z; later the real
number of points are 125, but I preffer use only five for now, that's what I
wrote. Later as in the examples I saw I took the first points from the
quoted Fortran file (cols 2-4), and my real problem is how to describe the
data structure.
I know I have 125 scalar dots, so I think this is the right structure. But
I'm not sure what shoudl I write as dataName, dataType and numComp, later I
have another parameter, the Lookup table, but I don't understand how to use
it or if I don't need to use ite, finally the point_data and cell_data
parameters, how to use them?
I hope you can help me, I'm in a hurry with this and I don't have enough
examples or documentation for solve my doubts.
Thaks:
Aradnix
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110517/6d5b427b/attachment.htm>
More information about the vtkusers
mailing list