[Paraview] [EXT] Re: How to detect element type inside Programmable Filter

Dennis Conklin dennis_conklin at goodyear.com
Fri Aug 14 09:28:16 EDT 2015


David,

Thanks very much, I’ve sorted through my stuff and found out what VTK thinks each of them are.   Since EXODUS limits each block to a single element type, it never occurred to me to test the type of an individual cell, I was sure there would be a block level cell type.

Thanks again

Dennis

From: David E DeMarle [mailto:dave.demarle at kitware.com]
Sent: Friday, August 14, 2015 8:56 AM
To: Dennis Conklin
Cc: Paraview (paraview at paraview.org)
Subject: Re: [EXT] Re: [Paraview] How to detect element type inside Programmable Filter

Shell means locally 2D and Truss means locally 3D?

def process_block(block):

    #print dir(block)

    #print dir(block.VTKObject)

    print block.VTKObject.GetClassName()

    for x in range(0,block.GetNumberOfCells()):

        #print dir(block.GetCell(x))

        print x, block.GetCellType(x)



for block in output:

    process_block(block)
The printed cell types correspond to:
  http://www.vtk.org/doc/nightly/html/vtkCellType_8h_source.html
There is probably a macro somewhere to get a GetCellTypeAsString() but easy enough to do in the filter.

David E DeMarle
Kitware, Inc.
R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909

On Fri, Aug 14, 2015 at 7:47 AM, Dennis Conklin <dennis_conklin at goodyear.com<mailto:dennis_conklin at goodyear.com>> wrote:
David,

Yes, but I am more dense!!


print block.VTKObject.GetClassName()
prints out vtkUnstructuredGrid,  which I already know.

Within my UnstructuredGrid, some blocks are hex elements, some blocks are shell elements and some blocks are truss elements – that is what I am trying to detect!

Dennis

From: David E DeMarle [mailto:dave.demarle at kitware.com<mailto:dave.demarle at kitware.com>]
Sent: Thursday, August 13, 2015 10:43 PM
To: Dennis Conklin
Cc: Paraview (paraview at paraview.org<mailto:paraview at paraview.org>)
Subject: [EXT] Re: [Paraview] How to detect element type inside Programmable Filter


On Thu, Aug 13, 2015 at 10:07 PM, Dennis Conklin <dennis_conklin at goodyear.com<mailto:dennis_conklin at goodyear.com>> wrote:
I may be dense but I'm persistent!

I am more persistent (and more dense). :)



def process_block(block):

  #print dir(block)

  #print dir(block.VTKObject)

  print block.VTKObject.GetClassName()

for block in output:

  process_block(block)



David E DeMarle
Kitware, Inc.
R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909<tel:518-881-4909>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20150814/4c304c06/attachment.html>


More information about the ParaView mailing list