← Back to team overview

dolfin team mailing list archive

Re: error reading .vtu file in mayavi

 

>
>
> Anders Logg wrote:
>> On Thu, Apr 03, 2008 at 03:58:11PM +0100, pedro wrote:
>>> i'm trying to read a .vtu file (e.g. temperature000001.vtu from
>>> convection-diffusion example) in mayavi (version 1.5-4) but i'm getting
>>> the error message:
>>>
>>> Exception:
>>> /var/lib/python-support/python2.5/mayavi/Sources/VtkDataReader.py: 49:
>>> ParseException: Unknown data type: Known data types are:
>>> UNSTRUCTURED_GRID, STRUCTURED_GRID, STRUCTURED_POINTS...
>>>
>>> going to file VtkDataReader.py, supported data files are defined within
>>> the list:
>>>
>>> supported = ["UNSTRUCTURED_GRID", "STRUCTURED_GRID",
>>>                  "STRUCTURED_POINTS", "RECTILINEAR_GRID", "POLYDATA" ]
>>>
>>> changing the header from: ...UnstructuredGrid to UNSTRUCTURED_GRID (or
>>> other trialled variants), the file opens but nothing shows and a
>>> console
>>> error message appears, apparently in a internal "afterPy" vtk routine:
>>>
>>> ERROR: In /build/buildd/vtk-5.0.3/IO/vtkDataReader.cxx, line 432
>>> vtkUnstructuredGridReader (0x86ba690): Unrecognized file type:
>>> <UNSTRUCTURED_GRI                           D> for file:
>>> /home/pedro/Desktop/convection-diffusion_test/temperature000001.vtu
>>>
>>> mayavi version problem or something else?
>>>
>>> ps: can't get paraview working (missing Qt4.2, only Qt4.3 available)
>>> _______________________________________________
>>> DOLFIN-dev mailing list
>>> DOLFIN-dev@xxxxxxxxxx
>>> http://www.fenics.org/mailman/listinfo/dolfin-dev
>>
>> I also have Mayavi 1.5-4 and it works fine.
>>
>> Start Mayavi, then click File -> Open -> VTK XML File. Select *.vtu
>> and then click the VTU file.
>>
>> The tricky part is to select VTK XML format and then change the suffix
>> filter to *.vtu.
>>
>
> It's important to open the file as VTK XML format, otherwise it won't
> work.
>
> The good news for Ubuntu users is that Mayavi2 is now a package in Hardy.
>
> Garth
> _______________________________________________
> DOLFIN-dev mailing list
> DOLFIN-dev@xxxxxxxxxx
> http://www.fenics.org/mailman/listinfo/dolfin-dev
>

After having spent a few days with MayaVi2, I strongly recommend upgrading
to that one if possible. It supports figure building through scripting
plus nice matplotlib like features through the mlab module.

Kristen



References