[Paraview] Extract cell type from unstructured grid

Berk Geveci berk.geveci at kitware.com
Thu Feb 19 10:05:37 EST 2009


And then use the Cell Types array in the Threshold filter, I guess?

-berk

On Wed, Feb 18, 2009 at 11:55 AM, Moreland, Kenneth <kmorel at sandia.gov> wrote:
> Paul,
>
> I don't know of any existing filter to do that, but a pretty simple
> programmable filter can do it.  Here is the script that will achieve it.
>  Just create a custom filter and copy this into the script.
>
> input = self.GetUnstructuredGridInput() output =
> self.GetUnstructuredGridOutput()
> output.GetPointData().PassData(input.GetPointData())
> output.GetCellData().PassData(input.GetCellData()) cellTypes =
> vtk.vtkUnsignedCharArray() cellTypes.DeepCopy(input.GetCellTypesArray())
> cellTypes.SetName("Cell Types") output.GetCellData().AddArray(cellTypes)
> If you plan to use this multiple times, you probably want to wrap this in a
> custom filter.
>
> -Ken
>
>
> On 2/18/09 5:07 AM, "Paul Edwards" <paul.m.edwards at gmail.com> wrote:
>
> Hello,
>
> Does anyone know an easy way to extract all cells of a particular type from
> an unstructured grid (without writing code either a plugin or python
> script)?  I was thinking it be possible with the calculator and the number
> of points in a cell but I can't get access to that.
>
> Thanks,
> Paul
>
>
>
>    ****      Kenneth Moreland
>     ***      Sandia National Laboratories
> ***********
> *** *** ***  email: kmorel at sandia.gov
> **  ***  **  phone: (505) 844-8919
>     ***      web:   http://www.cs.unm.edu/~kmorel
>
>
> _______________________________________________
> 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 ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
>
>


More information about the ParaView mailing list