Discussion:
[Paraview] convert a multi-block structured grid into a single unstructured block
Paul Edwards
2008-04-17 14:15:47 UTC
Permalink
Hi,

Is there a way to convert a multi-block structured grid into a single
unstructured block?

Thanks in advance,
Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20080417/6ad31541/attachment.htm>
Renato N. Elias
2008-04-17 14:23:42 UTC
Permalink
There's a filter called "extract datasets" in PV-3.2.1. Try this one.

Renato.
Post by Paul Edwards
Hi,
Is there a way to convert a multi-block structured grid into a single
unstructured block?
Thanks in advance,
Paul
------------------------------------------------------------------------
_______________________________________________
ParaView mailing list
ParaView at paraview.org
http://www.paraview.org/mailman/listinfo/paraview
Paul Edwards
2008-04-17 15:09:47 UTC
Permalink
That option is disabled when I have a multiblock structured mesh loaded in.
Also, I don't think it is what I want as the book says, "it's output is a
multi-block composite data set". I would like to merge all the blocks
together into one unstructured mesh.

Any ideas?

Thanks,
Paul
Post by Renato N. Elias
There's a filter called "extract datasets" in PV-3.2.1. Try this one.
Renato.
Post by Paul Edwards
Hi,
Is there a way to convert a multi-block structured grid into a single
unstructured block?
Thanks in advance,
Paul
------------------------------------------------------------------------
_______________________________________________
ParaView mailing list
ParaView at paraview.org
http://www.paraview.org/mailman/listinfo/paraview
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20080417/31cba569/attachment.htm>
Renato N. Elias
2008-04-17 15:29:14 UTC
Permalink
I see, I have a similar problem with my Ensight files. In an older PV
version (2.2.1) it were possible since we could load a model
piece-by-piece and use the "append datasets" filter followed by "clean
to grid".

I still keep this version on my machine just to do some things that the
newer versions don't do yet. You could try to merge your file in
PV-2.2.1 and export in a VTK format for the newer version (but, I guess,
PV-3.x will load your merged data as a multi-block even having just one
piece of data, weird isn't it?).

Regards

Renato.
Post by Paul Edwards
That option is disabled when I have a multiblock structured mesh
loaded in. Also, I don't think it is what I want as the book says,
"it's output is a multi-block composite data set". I would like to
merge all the blocks together into one unstructured mesh.
Any ideas?
Thanks,
Paul
On 17/04/2008, *Renato N. Elias* <rnelias at nacad.ufrj.br
There's a filter called "extract datasets" in PV-3.2.1. Try this one.
Renato.
Hi,
Is there a way to convert a multi-block structured grid into a
single unstructured block?
Thanks in advance,
Paul
------------------------------------------------------------------------
_______________________________________________
ParaView mailing list
ParaView at paraview.org <mailto:ParaView at paraview.org>
http://www.paraview.org/mailman/listinfo/paraview
Kent Eschenberg
2008-04-17 15:58:34 UTC
Permalink
Post by Paul Edwards
Is there a way to convert a multi-block structured grid into a
single unstructured block?
There will always be tasks like this that ParaView can't do easily. Kitware will never catch up because we will keep inventing new things to do!

A good solution is to build a version of VTK with Python and use it for little tasks like this. In your case the basic sequence would be

- create vtkAppendFilter
- read the multi-block grid
- loop over blocks and add each to the append filter
- write the append filter's output

I used a similar Python program to combine multi-block PVD files sets into a smaller number of files.

When the blocks share vertices we run the append filter's output through vtkCleanUnstructuredGrid before writing it. This requires a little work because this filter is in ParaView but not VTK. I pulled that filter from the ParaView source tree and added it to VTK following the instructions on the VTK Wiki page "Extending VTK".

Hey Kitware - why are some really great classes like vtkCleanUnstructuredGrid in ParaView instead of VTK?

Kent
Pittsburgh Supercomputing Center
Paul Edwards
2008-04-18 09:20:56 UTC
Permalink
Thanks for everyones comments. I made a plugin to merge the blocks. I've
attached the files if anyone is interested.

Regards,
Paul
Post by Kent Eschenberg
Post by Paul Edwards
Is there a way to convert a multi-block structured grid into a
single unstructured block?
There will always be tasks like this that ParaView can't do easily.
Kitware will never catch up because we will keep inventing new things to do!
A good solution is to build a version of VTK with Python and use it for
little tasks like this. In your case the basic sequence would be
- create vtkAppendFilter
- read the multi-block grid
- loop over blocks and add each to the append filter
- write the append filter's output
I used a similar Python program to combine multi-block PVD files sets into
a smaller number of files.
When the blocks share vertices we run the append filter's output through
vtkCleanUnstructuredGrid before writing it. This requires a little work
because this filter is in ParaView but not VTK. I pulled that filter from
the ParaView source tree and added it to VTK following the instructions on
the VTK Wiki page "Extending VTK".
Hey Kitware - why are some really great classes like
vtkCleanUnstructuredGrid in ParaView instead of VTK?
Kent
Pittsburgh Supercomputing Center
_______________________________________________
ParaView mailing list
ParaView at paraview.org
http://www.paraview.org/mailman/listinfo/paraview
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20080418/2d6a4a03/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vtkMergeBlocksFilter.h
Type: text/x-chdr
Size: 827 bytes
Desc: not available
URL: <http://www.paraview.org/pipermail/paraview/attachments/20080418/2d6a4a03/attachment-0001.h>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vtkMergeBlocksFilter.xml
Type: text/xml
Size: 742 bytes
Desc: not available
URL: <http://www.paraview.org/pipermail/paraview/attachments/20080418/2d6a4a03/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vtkMergeBlocksFilter.cxx
Type: text/x-c++src
Size: 1932 bytes
Desc: not available
URL: <http://www.paraview.org/pipermail/paraview/attachments/20080418/2d6a4a03/attachment-0001.cxx>
Paul Edwards
2008-04-17 15:11:07 UTC
Permalink
I didn't get this message before sending the last one.

Thanks,
Paul
We have a feature request for this but we haven't implemented it yet.
On Apr 17, 2008, at 10:15 AM, "Paul Edwards" <paul.m.edwards at gmail.com>
Hi,
Post by Paul Edwards
Is there a way to convert a multi-block structured grid into a single
unstructured block?
Thanks in advance,
Paul
_______________________________________________
ParaView mailing list
ParaView at paraview.org
http://www.paraview.org/mailman/listinfo/paraview
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20080417/a9b9fb8f/attachment.htm>
Loading...