[vtkusers] XML file format

Nicolas Bigaouette bigaouette at emt.inrs.ca
Thu Feb 22 19:04:35 EST 2007


Hi,

I developed a Fortran 95 code for electromagnetism (FDTD). I'm saving
the fields values (Ex, Ey, Ez, Hx, Hy, and Hz) into binary files. I
would like to use the VTK file format instead. So I checked the
vtkXMLWriter, on witch there is a fortran/C binding.

Unfortunately, I can't get a grip of VTK file format, or maybe of the
vtkXMLWriter. I have a finite diference mesh so I though it should be
VTK_STRUCTURED_GRID (.vts) I have a 3D array named "ex" which contains
electric field values on each point. This is what I do :
integer*4, parameter, dimension(6)  :: extent = (/ 0, nz, 0, ny, 0, nx/)
call vtkXMLWriterF_New(writer)
call vtkXMLWriterF_SetDataObjectType(writer, 2) ! 2=VTK_STRUCTURED_GRID
call vtkXMLWriterF_SetFileName(writer, 'vtk_test.vts')
call vtkXMLWriterF_SetExtent(writer, extent)
[...]
call vtkXMLWriterF_Write(writer, success)
call vtkXMLWriterF_Delete(writer)

What should I put for the "[...]" ??? Whats the difference between
"CellData", "PointData" and "Points" ?

Anyone knows where I could find tutorials/examples about the
vtkXMLWriter ? I couldn't find any...

Thank you

Nicolas



More information about the vtkusers mailing list