[Paraview] Paraview crashes on .vtu file load

Alice Gabriel gabriel at geophysik.uni-muenchen.de
Fri Aug 2 03:22:54 EDT 2013


Dear Paraview-user and developers,

Paraview crashes immediately once I try to load ascii .vtu files I 
self-wrote with a small python wrapper.
No error messages are parsed and I am lost in finding the reason for the 
crash.

An example .vtu file causing the crash I uploaded here:
https://dl.dropboxusercontent.com/u/12694118/sample_unstruct_tet.vtu

Thank you very much,
Alice Gabriel

Here the python wrapper:

[...]

fo.write('<VTKFile type=\'UnstructuredGrid\' version=\'0.1\' 
byte_order=\'BigEndian\'>\n')
fo.write('<UnstructuredGrid>\n')
fo.write('<Piece NumberOfPoints=\'' + str(npts) + '\' NumberOfCells=\'' 
+  str(nelem) + '\'>\n')
fo.write('<Points>\n')
fo.write('<DataArray type=\'Float64\' NumberOfComponents=\'3\' 
Format=\'ascii\'>\n')

for i in range(npts):
     fo.write('   ' + str('{: .16E}'.format(data[0,i])) + '   ' + 
str('{: .16E}'.format(data[1,i])) + '   ' + str('{: 
.16E}'.format(data[2,i])) + '\n')

fo.write('</DataArray>\n')
fo.write('</Points>\n')
fo.write('<Cells>\n')
fo.write('<DataArray type=\'Int32\' Name=\'connectivity\' 
Format=\'ascii\'>\n')

for i in range(nelem):
      fo.write(' ' + str('{:6d}'.format(elems[0,i])) + ' ' + 
str('{:6d}'.format(elems[1,i])) + ' ' + str('{:6d}'.format(elems[2,i])) 
+ ' ' + str('{:6d}'.format(elems[3,i])) + '\n')
fo.write('</DataArray>\n')
fo.write('<DataArray type=\'Int32\' Name=\'offsets\' Format=\'ascii\'>\n')

for i in range(nelem):
     fo.write(' ' + str('{:6d}'.format((i+1)*4)) + '\n')

fo.write('</DataArray>\n')
fo.write('<DataArray type=\'UInt8\' Name=\'types\' Format=\'ascii\'>\n')

for i in range(nelem):
     fo.write(' ' + str('{:6d}'.format(10)) + '\n')

fo.write('</DataArray>\n')
fo.write('</Cells>\n')

fo.write('<CellData Scalars=\'scalars\'>\n')

for j, var in enumerate(vars[3:]):

     fo.write('<DataArray type=\'Float64\' Name=\'' + var + '\' 
Format=\'ascii\'>\n')

     for i in range(npts):
         fo.write('   ' + str('{: .16E}'.format(data[j+3,i])) + '\n')

     fo.write('</DataArray>\n')


fo.write('</CellData>\n')
fo.write('</Piece>\n')
fo.write('</UnstructuredGrid>\n')
fo.write('</VTKFile>\n')
fo.close()



-- 

Dr. Alice-Agnes Gabriel

http://mercalli.ethz.ch/~agabriel/

gabriel at geophysik.uni-muenchen.de

Tel.  : +49 (0)89 2180 4214
Fax   : +49 (0)89 2180 4205

Geophysics
Department of Earth and Environmental Sciences
Ludwig-Maximilians-Universität München
Theresienstrasse 41
80333 München
Germany



More information about the ParaView mailing list