[vtkusers] convert unstructured to rectilinear

Fabian Braennstroem f.braennstroem at gmx.de
Mon May 15 03:31:59 EDT 2006


Hi,

I have 'rectilinear' data in a 'unstructured' file format.
Does there exist a simple procdure to convert those
'unstructured' data to a 'rectilinear' file format?

I tried:

import vtk
## simpleFOAM keps smooth
reader1 = vtk.vtkDataSetReader();
reader1.SetFileName("/home/fab/HOME/Dissertation/simulation_calc/Paper/Vergleich_RANS-LES/Ensight_Simulationen/OpenFOAM/VTK/smc_profile_21.vtk")
reader1.Update();

#ugw = vtk.vtkDataSetWriter()
ugw = vtk.vtkRectilinearGridWriter()
ugw.SetInput(reader1.GetOutput())
ugw.SetFileName("simplefoam_ascii_rect.vtk")
ugw.Write()


but I get:

  File "convert_bin_ascii.py", line 9, in ?
    ugw.SetInput(reader1.GetOutput())
ValueError: method requires a vtkRectilinearGrid, a
vtkUnstructuredGrid was provided.


Greetings!
 Fabian




More information about the vtkusers mailing list