Package: libvtk5 Version: 5.0.2-4 Severity: normal Hi!
A bugreport submitted to upstream (bugid=4041)[1] addresses the main
issue that I detected and fixed in bug #397186 (see [2]).
The purpose of the first patch ('plot3d.patch') that was submitted to
upstream in bugid=4041 is indeed to fix the reading of two-dimensional
PLOT3D solution files.
In bugid=4041, there's a second patch ('plot3d_2.patch') that also
fixes a second issue, namely the failure to correctly read multiblock
(Fortran unformatted) PLOT3D solution files.
[1] http://vtk.org/Bug/bug.php?op=show&bugid=4041
[2] http://bugs.debian.org/397186
I verified the presence of this second problem, and I can confirm
that the problem is present in version 5.0.2-4 of the Debian package.
The test case I prepared is based on a little PLOT3D grid ('tiny.xyz')
and solution ('tiny.q'), generated by a simple Fortran program
('gen_tinyplot3d.f') on a little-endian machine.
The PLOT3D grid is composed of 5 blocks, each one of which consists
of a single cubic cell. The PLOT3D solution has uniform values
(Q1=0.9, Q2=1.17, Q3=1.08, Q4=0.99, Q5=7.703).
In the test I attempt to read the PLOT3D file pair with a Python script
('list_plot3d.py') that writes to stdout every read value.
You should find these four files in the attached gzipped tar archive.
With vtk version 5.0.2-4, I get the following output:
$ ./list_plot3d.py
ErrorCode: 0
NumberOfOutputs: 5
=====> Block #1: 8 nodes <=====
x y z density momentum_x momentum_y momentum_z energy
node #1: 1.0 1.0 1.0 0.9 1.17 1.08 0.99 7.703
node #2: 2.0 1.0 1.0 0.9 1.17 1.08 0.99 7.703
node #3: 1.0 2.0 1.0 0.9 1.17 1.08 0.99 7.703
node #4: 2.0 2.0 1.0 0.9 1.17 1.08 0.99 7.703
node #5: 1.0 1.0 2.0 0.9 1.17 1.08 0.99 7.703
node #6: 2.0 1.0 2.0 0.9 1.17 1.08 0.99 7.703
node #7: 1.0 2.0 2.0 0.9 1.17 1.08 0.99 7.703
node #8: 2.0 2.0 2.0 0.9 1.17 1.08 0.99 7.703
=====> Block #2: 8 nodes <=====
x y z density momentum_x momentum_y momentum_z energy
node #1: 2.0 1.0 1.0 2.242e-43 0.9 1.17 1.08 0.99
node #2: 3.0 1.0 1.0 0.9 1.17 1.08 0.99 7.703
node #3: 2.0 2.0 1.0 0.9 1.17 1.08 0.99 7.703
node #4: 3.0 2.0 1.0 0.9 1.17 1.08 0.99 7.703
node #5: 2.0 1.0 2.0 0.9 1.17 1.08 0.99 7.703
node #6: 3.0 1.0 2.0 0.9 1.17 1.08 0.99 7.703
node #7: 2.0 2.0 2.0 0.9 1.17 1.08 0.99 7.703
node #8: 3.0 2.0 2.0 0.9 1.17 1.08 0.99 7.703
=====> Block #3: 8 nodes <=====
x y z density momentum_x momentum_y momentum_z energy
node #1: 3.0 1.0 1.0 2.242e-44 0.9 1.17 1.08 0.99
node #2: 4.0 1.0 1.0 2.242e-43 0.9 1.17 1.08 0.99
node #3: 3.0 2.0 1.0 0.9 1.17 1.08 0.99 7.703
node #4: 4.0 2.0 1.0 0.9 1.17 1.08 0.99 7.703
node #5: 3.0 1.0 2.0 0.9 1.17 1.08 0.99 7.703
node #6: 4.0 1.0 2.0 0.9 1.17 1.08 0.99 7.703
node #7: 3.0 2.0 2.0 0.9 1.17 1.08 0.99 7.703
node #8: 4.0 2.0 2.0 0.9 1.17 1.08 0.99 7.703
=====> Block #4: 8 nodes <=====
x y z density momentum_x momentum_y momentum_z energy
node #1: 4.0 1.0 1.0 0 0.9 1.17 1.08 0.99
node #2: 5.0 1.0 1.0 2.242e-44 0.9 1.17 1.08 0.99
node #3: 4.0 2.0 1.0 2.242e-43 0.9 1.17 1.08 0.99
node #4: 5.0 2.0 1.0 0.9 1.17 1.08 0.99 7.703
node #5: 4.0 1.0 2.0 0.9 1.17 1.08 0.99 7.703
node #6: 5.0 1.0 2.0 0.9 1.17 1.08 0.99 7.703
node #7: 4.0 2.0 2.0 0.9 1.17 1.08 0.99 7.703
node #8: 5.0 2.0 2.0 0.9 1.17 1.08 0.99 7.703
=====> Block #5: 8 nodes <=====
x y z density momentum_x momentum_y momentum_z energy
node #1: 5.0 1.0 1.0 1e+05 0.9 1.17 1.08 0.99
node #2: 6.0 1.0 1.0 0 0.9 1.17 1.08 0.99
node #3: 5.0 2.0 1.0 2.242e-44 0.9 1.17 1.08 0.99
node #4: 6.0 2.0 1.0 2.242e-43 0.9 1.17 1.08 0.99
node #5: 5.0 1.0 2.0 0.9 1.17 1.08 0.99 7.703
node #6: 6.0 1.0 2.0 0.9 1.17 1.08 0.99 7.703
node #7: 5.0 2.0 2.0 0.9 1.17 1.08 0.99 7.703
node #8: 6.0 2.0 2.0 0.9 1.17 1.08 0.99 7.703
The explanation for this incorrect output is that VTK forgets to skip
the last record marker of each solution block, and thus incorrectly
interprets the values that are left behind.
If I apply the patch 'plot3d_2.patch' (well, only the part that addresses
this problem, since the other one is already fixed in Debian package
version 5.0.2-4) and recompile VTK, my test succeeds giving the following
output:
$ ./list_plot3d.py
ErrorCode: 0
NumberOfOutputs: 5
=====> Block #1: 8 nodes <=====
x y z density momentum_x momentum_y momentum_z energy
node #1: 1.0 1.0 1.0 0.9 1.17 1.08 0.99 7.703
node #2: 2.0 1.0 1.0 0.9 1.17 1.08 0.99 7.703
node #3: 1.0 2.0 1.0 0.9 1.17 1.08 0.99 7.703
node #4: 2.0 2.0 1.0 0.9 1.17 1.08 0.99 7.703
node #5: 1.0 1.0 2.0 0.9 1.17 1.08 0.99 7.703
node #6: 2.0 1.0 2.0 0.9 1.17 1.08 0.99 7.703
node #7: 1.0 2.0 2.0 0.9 1.17 1.08 0.99 7.703
node #8: 2.0 2.0 2.0 0.9 1.17 1.08 0.99 7.703
=====> Block #2: 8 nodes <=====
x y z density momentum_x momentum_y momentum_z energy
node #1: 2.0 1.0 1.0 0.9 1.17 1.08 0.99 7.703
node #2: 3.0 1.0 1.0 0.9 1.17 1.08 0.99 7.703
node #3: 2.0 2.0 1.0 0.9 1.17 1.08 0.99 7.703
node #4: 3.0 2.0 1.0 0.9 1.17 1.08 0.99 7.703
node #5: 2.0 1.0 2.0 0.9 1.17 1.08 0.99 7.703
node #6: 3.0 1.0 2.0 0.9 1.17 1.08 0.99 7.703
node #7: 2.0 2.0 2.0 0.9 1.17 1.08 0.99 7.703
node #8: 3.0 2.0 2.0 0.9 1.17 1.08 0.99 7.703
=====> Block #3: 8 nodes <=====
x y z density momentum_x momentum_y momentum_z energy
node #1: 3.0 1.0 1.0 0.9 1.17 1.08 0.99 7.703
node #2: 4.0 1.0 1.0 0.9 1.17 1.08 0.99 7.703
node #3: 3.0 2.0 1.0 0.9 1.17 1.08 0.99 7.703
node #4: 4.0 2.0 1.0 0.9 1.17 1.08 0.99 7.703
node #5: 3.0 1.0 2.0 0.9 1.17 1.08 0.99 7.703
node #6: 4.0 1.0 2.0 0.9 1.17 1.08 0.99 7.703
node #7: 3.0 2.0 2.0 0.9 1.17 1.08 0.99 7.703
node #8: 4.0 2.0 2.0 0.9 1.17 1.08 0.99 7.703
=====> Block #4: 8 nodes <=====
x y z density momentum_x momentum_y momentum_z energy
node #1: 4.0 1.0 1.0 0.9 1.17 1.08 0.99 7.703
node #2: 5.0 1.0 1.0 0.9 1.17 1.08 0.99 7.703
node #3: 4.0 2.0 1.0 0.9 1.17 1.08 0.99 7.703
node #4: 5.0 2.0 1.0 0.9 1.17 1.08 0.99 7.703
node #5: 4.0 1.0 2.0 0.9 1.17 1.08 0.99 7.703
node #6: 5.0 1.0 2.0 0.9 1.17 1.08 0.99 7.703
node #7: 4.0 2.0 2.0 0.9 1.17 1.08 0.99 7.703
node #8: 5.0 2.0 2.0 0.9 1.17 1.08 0.99 7.703
=====> Block #5: 8 nodes <=====
x y z density momentum_x momentum_y momentum_z energy
node #1: 5.0 1.0 1.0 0.9 1.17 1.08 0.99 7.703
node #2: 6.0 1.0 1.0 0.9 1.17 1.08 0.99 7.703
node #3: 5.0 2.0 1.0 0.9 1.17 1.08 0.99 7.703
node #4: 6.0 2.0 1.0 0.9 1.17 1.08 0.99 7.703
node #5: 5.0 1.0 2.0 0.9 1.17 1.08 0.99 7.703
node #6: 6.0 1.0 2.0 0.9 1.17 1.08 0.99 7.703
node #7: 5.0 2.0 2.0 0.9 1.17 1.08 0.99 7.703
node #8: 6.0 2.0 2.0 0.9 1.17 1.08 0.99 7.703
I suggest backporting the fix proposed by Mark Stucky in bugid=4041
to the Debian package as soon as it is accepted by upstream and appears
in VTK CVS repository.
-- System Information:
Debian Release: 3.1
Architecture: i386 (i686)
Kernel: Linux 2.4.33.4
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)
Versions of packages libvtk5 depends on:
ii libc6 2.3.2.ds1-22sarge4 GNU C Library: Shared libraries an
ii libexpat1 1.95.8-3 XML parsing C library - runtime li
ii libfreetype6 2.1.7-6 FreeType 2 font engine, shared lib
ii libgcc1 1:3.4.3-13sarge1 GCC support library
ii libice6 4.3.0.dfsg.1-14sarge2 Inter-Client Exchange library
ii libjpeg62 6b-10 The Independent JPEG Group's JPEG
ii libpng12-0 1.2.8rel-1 PNG library - runtime
ii libsm6 4.3.0.dfsg.1-14sarge2 X Window System Session Management
ii libstdc++5 1:3.3.5-13 The GNU Standard C++ Library v3
ii libtiff4 3.7.2-7 Tag Image File Format (TIFF) libra
ii libx11-6 4.3.0.dfsg.1-14sarge2 X Window System protocol client li
ii libxext6 4.3.0.dfsg.1-14sarge2 X Window System miscellaneous exte
ii libxt6 4.3.0.dfsg.1-14sarge2 X Toolkit Intrinsics
ii xlibmesa-gl [libgl 4.3.0.dfsg.1-14sarge2 Mesa 3D graphics library [XFree86]
ii xlibs 4.3.0.dfsg.1-14sarge2 X Keyboard Extension (XKB) configu
ii zlib1g 1:1.2.2-4.sarge.2 compression library - runtime
-- no debconf information
vtk-multiblockPLOT3D-bug-test.tar.gz
Description: Binary data

