[Dune] (no subject)
Jö Fahlke
jorrit at jorrit.de
Thu Mar 12 15:39:58 CET 2015
Hi!
Is here any expert who knows how to use vtk from python? I'm writing a unit
test for out vtkwriter, and I would like to check the produced vtk files by
loading them into vtk. I currently have the following python script:
======================================================================
#!/usr/bin/python
from vtk import *
reader = vtkXMLUnstructuredGridReader()
reader.SetFileName("fs1539test.vtu")
reader.Update()
======================================================================
There is a broken vtk file attached. When I try to load that file from this
vtk skript I get an error message on stderr. But I cannot get python to tell
me that loading failed. Ideally I'd like to "exit(1)" if loading has failed.
Anyone has hints?
Regards,
Jö.
--
Jorrit (Jö) Fahlke, Institute for Computational und Applied Mathematics,
University of Münster, Orleans-Ring 10, D-48149 Münster
Tel: +49 251 83 35146 Fax: +49 251 83 32729
Der Horizont vieler Menschen ist ein Kreis mit Radius Null - und das
nennen sie ihren Standpunkt.
-- A. Einstein
-------------- next part --------------
<?xml version="1.0"?>
<VTKFile type="UnstructuredGrid" version="0.1" byte_order="LittleEndian">
<UnstructuredGrid>
<Piece NumberOfCells="1" NumberOfPoints="4">
<Points>
<DataArray type="Float32" Name="Coordinates" NumberOfComponents="3" format="binary">
MAAAAAAAAAA=AAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAgD8AAAAAAACAPwAAgD8AAAAA
</DataArray>
</Points>
<Cells>
<DataArray type="Int32" Name="connectivity" NumberOfComponents="1" format="binary">
EAAAAAAAAAA=AAAAAAEAAAADAAAAAgAAAA==
</DataArray>
<DataArray type="Int32" Name="offsets" NumberOfComponents="1" format="binary">
BAAAAAAAAAA=BAAAAA==
</DataArray>
<DataArray type="UInt8" Name="types" NumberOfComponents="1" format="binary">
AQAAAAAAAAA=CQ==
</DataArray>
</Cells>
</Piece>
</UnstructuredGrid>
</VTKFile>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 828 bytes
Desc: Digital signature
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20150312/62b02b03/attachment.sig>
More information about the Dune
mailing list