Hi all,

I use almost exclusively binary vtk for everything that I export from
GetFEM. I have experienced no issues with that on Linux with Paraview up to
version 5. Do you experience problems on both Windows and Linux?

In addition to that I use the attached script to convert the binary vtk to
compressed vtu files which saves some extra space.

BR
Kostas


On Thu, Jul 20, 2017 at 8:35 PM, franz chouly <[email protected]>
wrote:

> Dear Andriy, dear all,
>
> I'm trying to write binary VTK files with Getfem. Unfortunately the latest
> ParaView cannot read them.
>
> It doesn't issue an error, just the result is rubbish.  I was carefully
> looking at all those issues with big endian,
> needed for binary VTK, Getfem seems to be doing the right job (if you look
> at the source), but no success.
> Did anybody succeed in reading binary VTK's produced with Getfem into
> ParaView?
>
> No, but I had the same problem as you ! And I am as well interested if
> someone has some clues.
>
> Thank you,
> Best regards,
>
>   Franz
>
>
import sys
import os
import glob
from paraview.simple import *

if hasattr(sys, 'argv') and len(sys.argv) > 1:
   namepattern = sys.argv[1]
   files = glob.glob(namepattern)
   cleanup = (len(sys.argv) > 2 and sys.argv[2] == "cleanup")
   for f in files:
      r = LegacyVTKReader( FileNames=[f] )
      w = XMLUnstructuredGridWriter()
      w.DataMode = "Appended"
      w.CompressorType = "ZLib"
      w.FileName = f[:-3]+"vtu"
      w.UpdatePipeline()
      if cleanup:
         os.remove(f)
else:
   print('Usage: pvpython convert_vtk_to_vtu.py "./results/filename_*.vtk" "cleanup"')

Reply via email to