[vtkusers] Save as vtu

Cory Quammen cory.quammen at kitware.com
Fri Apr 28 09:06:39 EDT 2017


[snip]

> Now to answer your questions/remarks:
>
> 1. The xmf defines a multiblock: yes, I noticed that. I already tried to
> save as vtm (proposed in the GUI - there was no vtu format available at this
> step) and get what you said David. But the problem is that when I read the
> vtm with vtkUnstructuredGridReader, I get : "vtkUnstructuredGridReader
> (0x55cf2916cc00): Unrecognized file type: <VTKFile
> type="vtkMultiBlockDataSet" version="1.0" byte_order="LittleEndian"
> header_type="UInt64"> for file: tstXmfFEM.vtm"

You must use vtkXMLMultiBlockDataReader to read a .vtm file in VTK.
vtkUnstructuredGridReader will not work.

> 2. I didn't know about the merge blocks filter. I used it: now the "save as"
> GUI propose to save as vtu. I save as vtu but when I read it with
> vtkUnstructuredGridReader, I get : "vtkUnstructuredGridReader
> (0x5650aee5ec00): Unrecognized file type: <VTKFile type="UnstructuredGrid"
> version="1.0" byte_order="LittleEndian" header_type="UInt64"> for file:
> tstXmfFEM.vtu"

You must use a vtkXMLUnstructuredGridReader to read a .vtu file in
VTK. vtkUnstructuredGridReader will not work.

> 3. How to convert a stl to vtu ?

Andy's answer is still the correct one: use ParaView's Merge Blocks filter.

HTH,
Cory

> Franck
>
> Note: I use Paraview-5.1.0 and VTK-7.1.0 (does this trigger version related
> problems ?)
>
> Note: to read with vtkUnstructuredGridreader, I basically do
> reader->SetFileName(), then reader->Update(), then reader->GetOutput()
>
> Le 2017-04-26 19:03, David E DeMarle a écrit :
>>
>> Adding to what Andy said.
>> In this case the xdmf file defines a multiblock with three
>> unstructured grids underneath it. Each of your unstructured grids
>> happens to have just one cell in it. When you save as vtm, you will
>> get a top level .vtm defining the collection, and a directory with
>> three .vtu files, one for each block.
>>
>> David E DeMarle
>> Kitware, Inc.
>> R&D Engineer
>> 21 Corporate Drive
>> Clifton Park, NY 12065-8662
>> Phone: 518-881-4909
>>
>> On Wed, Apr 26, 2017 at 12:55 PM, Andy Bauer <andy.bauer at kitware.com
>> [12]> wrote:
>>
>>> Hi,
>>>
>>> The vtu format is for unstructured (non-multiblock) grids. For
>>> multiblock grids like the ones read in from an xmf file you will
>>> need to convert it to an unstructured grid. You an use the Merge
>>> Blocks filter to do that.
>>>
>>> Is there a strong reason for saving it as a vtu file? It sounds
>>> like there are better file formats available for your data set.
>>>
>>> Andy
>>>
>>> On Wed, Apr 26, 2017 at 12:24 PM, houssen <houssen at ipgp.fr [6]>
>>> wrote:
>>>
>>>> In paraview, I open a xmf file, I would like to export it as vtu
>>>> (to read it later on with vtkUnstructuredGridReader): neither
>>>> "save data" nor "export scene" allows this (save data suggest the
>>>> .vtm format but it turns out that vtm can not be read later on by
>>>> vtkUnstructuredGridReader as vtu is expected - I guess ?). Same
>>>> problem when opening a stl file in paraview: can not export it as
>>>> vtu.
>>>>
>>>> How can I export a xmf/stl fle as vtu ? Do I need a (existing ?)
>>>> plugin ? If yes, which one ? Is there a work around ? Or is this
>>>
>>> a
>>>>
>>>> dead end ?
>>>>
>>>> Franck
>>>>
>>>> PS: I have paraview-5.1.0, should I compile a newer version ?
>>>>
>>>> _______________________________________________
>>>> Powered by www.kitware.com [1]
>>>>
>>>> Visit other Kitware open-source projects at
>>>> http://www.kitware.com/opensource/opensource.html [2]
>>>>
>>>> Please keep messages on-topic and check the VTK FAQ at:
>>>> http://www.vtk.org/Wiki/VTK_FAQ [3]
>>>>
>>>> Search the list archives at:
>>>> http://markmail.org/search/?q=vtkusers [4]
>>>>
>>>> Follow this link to subscribe/unsubscribe:
>>>> http://public.kitware.com/mailman/listinfo/vtkusers [5]
>>>
>>>
>>> _______________________________________________
>>> Powered by www.kitware.com [7]
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html [8]
>>>
>>> Please keep messages on-topic and check the VTK FAQ at:
>>> http://www.vtk.org/Wiki/VTK_FAQ [9]
>>>
>>> Search the list archives at:
>>> http://markmail.org/search/?q=vtkusers [10]
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://public.kitware.com/mailman/listinfo/vtkusers [11]
>>
>>
>>
>>
>> Links:
>> ------
>> [1] http://www.kitware.com
>> [2] http://www.kitware.com/opensource/opensource.html
>> [3] http://www.vtk.org/Wiki/VTK_FAQ
>> [4] http://markmail.org/search/?q=vtkusers
>> [5] http://public.kitware.com/mailman/listinfo/vtkusers
>> [6] mailto:houssen at ipgp.fr
>> [7] http://www.kitware.com
>> [8] http://www.kitware.com/opensource/opensource.html
>> [9] http://www.vtk.org/Wiki/VTK_FAQ
>> [10] http://markmail.org/search/?q=vtkusers
>> [11] http://public.kitware.com/mailman/listinfo/vtkusers
>> [12] mailto:andy.bauer at kitware.com
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers



-- 
Cory Quammen
Staff R&D Engineer
Kitware, Inc.


More information about the vtkusers mailing list