[Paraview] Problems writing binary vtu file

2017-01-19 Thread Aleksejs Fomins
Dear Paraview,

I tried to extend my VTU writer to write into binary format. I have tried 
either writing floats using Float32 format and doubles using Float64 format, 
both fail the same way. I write into binary by using

file.write( (char*) , sizeof(BinaryType));

In both cases, Paraview complains that there is an invalid token immediately at 
the beginning of binary output within the first DataArray clause.

Could someone please hint me as of what I am doing wrong.

Regards,
Aleksejs




ERROR: In 
/home/fomins/Downloads/ParaView-v5.0.1-source/VTK/IO/XMLParser/vtkXMLParser.cxx,
 line 397
vtkXMLDataParser (0x49f23f0): Error parsing XML in stream at line 7, column 0, 
byte index 379: not well-formed (invalid token)


ERROR: In 
/home/fomins/Downloads/ParaView-v5.0.1-source/VTK/IO/XML/vtkXMLReader.cxx, line 
456
vtkXMLUnstructuredGridReader (0x49ff7d0): Error parsing input file.  
ReadXMLInformation aborting.


ERROR: In 
/home/fomins/Downloads/ParaView-v5.0.1-source/VTK/Common/ExecutionModel/vtkExecutive.cxx,
 line 784
vtkCompositeDataPipeline (0x4226820): Algorithm 
vtkXMLUnstructuredGridReader(0x49ff7d0) returned failure for request: 
vtkInformation (0x4c21eb0)
  Debug: Off
  Modified Time: 167613
  Reference Count: 1
  Registered Events: (none)
  Request: REQUEST_INFORMATION
  ALGORITHM_AFTER_FORWARD: 1
  FORWARD_DIRECTION: 0




ERROR: In 
/home/fomins/Downloads/ParaView-v5.0.1-source/VTK/IO/XMLParser/vtkXMLParser.cxx,
 line 397
vtkXMLDataParser (0x49aa790): Error parsing XML in stream at line 7, column 0, 
byte index 379: not well-formed (invalid token)


ERROR: In 
/home/fomins/Downloads/ParaView-v5.0.1-source/VTK/IO/XML/vtkXMLReader.cxx, line 
456
vtkXMLUnstructuredGridReader (0x49ff7d0): Error parsing input file.  
ReadXMLInformation aborting.


ERROR: In 
/home/fomins/Downloads/ParaView-v5.0.1-source/VTK/Common/ExecutionModel/vtkExecutive.cxx,
 line 784
vtkCompositeDataPipeline (0x4226820): Algorithm 
vtkXMLUnstructuredGridReader(0x49ff7d0) returned failure for request: 
vtkInformation (0x4c21eb0)
  Debug: Off
  Modified Time: 167613
  Reference Count: 1
  Registered Events: (none)
  Request: REQUEST_INFORMATION
  ALGORITHM_AFTER_FORWARD: 1
  FORWARD_DIRECTION: 0


___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Search the list archives at: http://markmail.org/search/?q=ParaView

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview


[Paraview] Problems writing an .vtu file

2010-01-28 Thread s . habbinga
Hello everybody,

I've been trying to write a c++ function to convert my data into .vtu
files. Unfortunately, paraview isn't able to read my .vtu files. I get
the following error-message:

ERROR: In
/home/zam/domini/paraview/ParaView3src/VTK/Filtering/vtkExecutive.cxx,
line 757
vtkCompositeDataPipeline (0x8cf34b0): Algorithm
vtkXMLUnstructuredGridReader(0x8d915d0) returned failure for request:
vtkInformation (0x90c34e8)
  Debug: Off
  Modified Time: 383066
  Reference Count: 1
  Registered Events: (none)
  Request: REQUEST_INFORMATION
  FORWARD_DIRECTION: 0
  ALGORITHM_AFTER_FORWARD: 1


I'm obviously doing something wrong... can anyone help? I really can't
find the error. Below, you find a sample .vtu file.
Thanks in advance!!

Sonja

?xml version=1.0?
VTKFile type=UnstructuredGrid version=0.1 byte_order=LittleEndian
  UnstructuredGrid
Piece NumberOfPoints=96 NumberOfCells=12
  PointData Scalars=process_id
DataArray type=Float32 name=process_id format=ascii
  1 1 1 1 1 1 1 1
  2 2 2 2 2 2 2 2
  3 3 3 3 3 3 3 3
  4 4 4 4 4 4 4 4
  5 5 5 5 5 5 5 5
  6 6 6 6 6 6 6 6
  0 0 0 0 0 0 0 0
  7 7 7 7 7 7 7 7
  8 8 8 8 8 8 8 8
  10 10 10 10 10 10 10 10
  9 9 9 9 9 9 9 9
  11 11 11 11 11 11 11 11

/DataArray
  /PointData
  CellData
  /CellData
  Points
DataArray type=Float32 NumberOfComponents=3 format=ascii
  0 -37.5 -225 37.5 -37.5 -225 0 0 -225 37.5 0 -225 0 -37.5 -75 37.5
-37.5 -75 0 0 -75 37.5 0 -75
  -37.5 0 -225 0 0 -225 -37.5 37.5 -225 0 37.5 -225 -37.5 0 -75 0 0
-75 -37.5 37.5 -75 0 37.5 -75
  0 0 -225 37.5 0 -225 0 37.5 -225 37.5 37.5 -225 0 0 -75 37.5 0 -75
0 37.5 -75 37.5 37.5 -75
  -37.5 -37.5 -75 0 -37.5 -75 -37.5 0 -75 0 0 -75 -37.5 -37.5 75 0
-37.5 75 -37.5 0 75 0 0 75
  0 -37.5 -75 37.5 -37.5 -75 0 0 -75 37.5 0 -75 0 -37.5 75 37.5
-37.5 75 0 0 75 37.5 0 75
  -37.5 0 -75 0 0 -75 -37.5 37.5 -75 0 37.5 -75 -37.5 0 75 0 0 75
-37.5 37.5 75 0 37.5 75
  -37.5 -37.5 -225 0 -37.5 -225 -37.5 0 -225 0 0 -225 -37.5 -37.5
-75 0 -37.5 -75 -37.5 0 -75 0 0 -75
  0 0 -75 37.5 0 -75 0 37.5 -75 37.5 37.5 -75 0 0 75 37.5 0 75 0
37.5 75 37.5 37.5 75
  -37.5 -37.5 75 0 -37.5 75 -37.5 0 75 0 0 75 -37.5 -37.5 225 0
-37.5 225 -37.5 0 225 0 0 225
  -37.5 0 75 0 0 75 -37.5 37.5 75 0 37.5 75 -37.5 0 225 0 0 225
-37.5 37.5 225 0 37.5 225
  0 -37.5 75 37.5 -37.5 75 0 0 75 37.5 0 75 0 -37.5 225 37.5 -37.5
225 0 0 225 37.5 0 225
  0 0 75 37.5 0 75 0 37.5 75 37.5 37.5 75 0 0 225 37.5 0 225 0 37.5
225 37.5 37.5 225

/DataArray
  /Points
  Cells
DataArray type=Int32 Name=connectivity format=ascii
  0 1 2 3 4 5 6 7
  8 9 10 11 12 13 14 15
  16 17 18 19 20 21 22 23
  24 25 26 27 28 29 30 31
  32 33 34 35 36 37 38 39
  40 41 42 43 44 45 46 47
  48 49 50 51 52 53 54 55
  56 57 58 59 60 61 62 63
  64 65 66 67 68 69 70 71
  72 73 74 75 76 77 78 79
  80 81 82 83 84 85 86 87
  88 89 90 91 92 93 94 95

/DataArray
DataArray type=Int32 Name=offsets format=ascii
  8 16 24 32 40 48 56 64 72 80 88 96
/DataArray
DataArray type=UInt8 Name=types format=ascii
  11 11 11 11 11 11 11 11 11 11 11 11
/DataArray
  /Cells
/Piece
  /UnstructuredGrid
/VTKFile




Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt


___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview


Re: [Paraview] Problems writing an .vtu file

2010-01-28 Thread Jean M. Favre
s.habbinga wrote:
 Hello everybody,

 I've been trying to write a c++ function to convert my data into .vtu
 files. Unfortunately, paraview isn't able to read my .vtu files. I get
 the following error-message:


   

there is a typographic error in your file.

Replace the line
 DataArray type=Float32 name=process_id format=ascii
by

DataArray type=Float32 Name=process_id format=ascii



___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview