[Paraview] Help needed in writing binary vtu file

manus at hsu-hh.de manus at hsu-hh.de
Thu Dec 18 06:42:16 EST 2008


Hi all

I am currently writing a c++ program that converts a unstructured  
ascii vtk file into vtu binary xml unstructured file and when I tried  
to open the xml file in paraview it gave me an error message saying  
that "Cannot read cell connectivity from Cells in piece 0 because the  
"offsets" array is not monotonically increasing or starts with a value  
less than 1". I am dealing with noncompressed data and I encode the  
data size in bytes and data in a single go.

I tried to decode the my base 64 encoded data using a online decoder  
"http://www.motobit.com/util/base64-decoder-encoder.asp" it works fine.

I kindly request all to have a look at my binary file and help me to  
find out the problem.

Please let me know if you know some documents that explains how to  
write a binary vtu file.

Best regards

Manushanker

-------------- next part --------------
# vtk DataFile Version 2.0
Generated by MEQSICO (revision unknown). Solver Lib: meqsico. Precond Lib: TrilinosML. Subspace Projection: none
ASCII
DATASET UNSTRUCTURED_GRID

POINTS 20 float
   1.1863470000000000e-04    2.1833869999999999e-04   -2.0366670000000002e-04 
   5.0000000000000001e-04    3.5355340000000002e-04   -3.5355340000000002e-04 
   2.4430879999999999e-04    3.3764329999999999e-04    1.5825810000000001e-05 
   5.0000000000000001e-04    0.0000000000000000e+00   -2.3570230000000001e-04 
   5.0000000000000001e-04    0.0000000000000000e+00    2.3570230000000001e-04 
   0.0000000000000000e+00    7.0710680000000004e-04    0.0000000000000000e+00 
   5.0000000000000001e-04    3.5355340000000002e-04    3.5355340000000002e-04 
   0.0000000000000000e+00    0.0000000000000000e+00    7.0710680000000004e-04 
   8.1858210000000002e-05    0.0000000000000000e+00    5.5511149999999993e-20 
  -5.0000000000000001e-04    0.0000000000000000e+00   -2.3570230000000001e-04 
   0.0000000000000000e+00    0.0000000000000000e+00   -7.0710680000000004e-04 
  -5.0000000000000001e-04    3.5355340000000002e-04   -3.5355340000000002e-04 
  -5.0000000000000001e-04    3.5355340000000002e-04    3.5355340000000002e-04 
  -5.0000000000000001e-04    7.0710680000000004e-04    0.0000000000000000e+00 
   5.0000000000000001e-04    0.0000000000000000e+00   -7.0710680000000004e-04 
  -5.0000000000000001e-04    0.0000000000000000e+00    7.0710680000000004e-04 
  -5.0000000000000001e-04    0.0000000000000000e+00    2.3570230000000001e-04 
  -5.0000000000000001e-04    0.0000000000000000e+00   -7.0710680000000004e-04 
   5.0000000000000001e-04    7.0710680000000004e-04    0.0000000000000000e+00 
   5.0000000000000001e-04    0.0000000000000000e+00    7.0710680000000004e-04 

CELLS 31 155
4 0 1 2 3 
4 1 2 3 4 
4 0 1 2 5 
4 1 2 4 6 
4 2 5 6 7 
4 2 5 7 8 
4 0 5 8 9 
4 0 8 9 10 
4 0 2 3 8 
4 0 1 3 10 
4 5 9 10 11 
4 0 5 9 10 
4 5 9 11 12 
4 5 11 12 13 
4 1 3 10 14 
4 0 1 5 10 
4 7 12 15 16 
4 9 10 11 17 
4 8 9 12 16 
4 0 3 8 10 
4 7 8 12 16 
4 5 8 9 12 
4 2 4 6 7 
4 2 5 6 18 
4 2 3 4 8 
4 2 4 7 8 
4 1 2 5 18 
4 5 7 8 12 
4 1 2 6 18 
4 4 6 7 19 
4 0 2 5 8 

CELL_TYPES 31
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10


POINT_DATA 20
SCALARS ScalarPotential float 1
LOOKUP_TABLE default
6.186347000000e-01
1.000000000000e+00
7.443088000000e-01
1.000000000000e+00
1.000000000000e+00
5.000000000000e-01
1.000000000000e+00
5.000000000000e-01
5.818582100000e-01
0.000000000000e+00
5.000000000000e-01
0.000000000000e+00
0.000000000000e+00
0.000000000000e+00
1.000000000000e+00
0.000000000000e+00
0.000000000000e+00
0.000000000000e+00
1.000000000000e+00
1.000000000000e+00


CELL_DATA 31
SCALARS FieldNorm float 1
LOOKUP_TABLE default
1.000000000000e-02
1.000000000000e-02
1.000000000000e-02
1.000000000000e-02
1.000000000000e-02
1.000000000000e-02
1.000000000000e-02
1.000000000000e-02
1.000000000000e-02
1.000000000000e-02
1.000000000000e-02
1.000000000000e-02
1.000000000000e-02
1.000000000000e-02
1.000000000000e-02
1.000000000000e-02
1.000000000000e-02
1.000000000000e-02
1.000000000000e-02
1.000000000000e-02
1.000000000000e-02
1.000000000000e-02
1.000000000000e-02
1.000000000000e-02
1.000000000000e-02
1.000000000000e-02
1.000000000000e-02
1.000000000000e-02
1.000000000000e-02
1.000000000000e-02
1.000000000000e-02
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test2.post_bin.vtu
Type: application/octet-stream
Size: 4904 bytes
Desc: not available
URL: <http://www.paraview.org/pipermail/paraview/attachments/20081218/93bb4f44/attachment-0001.obj>


More information about the ParaView mailing list