[vtkusers] Exodus block IDs and vtkExodusIIReader

David Thompson dcthomp at sandia.gov
Fri Feb 18 14:37:46 EST 2011


Hi Nathan,

> Hrm.. I'm not sure where I was looking before, but you are certainly  
> correct; ObjectType is clearly public.  Thanks for the code  
> changes.  I look forward to the new enums!
>
> As a side note, other than the Doxygen documents and the couple  
> examples included with VTK, is there any documentation on the  
> vtkExodusIIReader?  A separate thread on vtkusers  
> (vtk.vtkExodusIIReader: information in GetOutput()?) was  
> particularly enlightening in seeing how the multi-block data sets  
> are used to store the data.  Is that information and its like  
> written down somewhere, or is the interface still developing?

As it happens, I just wrote some documentation for the ParaView  
interface to the reader earlier this week. I'll see it gets moved to  
the Doxygen documentation for the reader itself. If you want to see it  
in the meantime, it is at

http://paraview.org/gitweb?p=ParaView.git;a=blobdiff;f=Servers/ServerManager/Resources/readers.xml;h=9bea8a93c869beb904b41c1749a2b6c0d6e723d1;hp=63ff8379d4db3fa662319144ab465c4bf895292c;hb=80eaa968345c04f7aa9b9b137415ee9f72216f5e;hpb=074c1428c19316235626f338330bb21e45de0a6e

The bottom entry has an overview and the remainder describe individual  
properties corresponding to Get/Set methods of the VTK class.

	David

> On Fri, Feb 18, 2011 at 3:36 AM, David Thompson <dcthomp at sandia.gov>  
> wrote:
> Hi Nathan,
>
> Please "reply all" so that other people can benefit from your  
> experience. I'm glad to hear it worked for you. The ObjectType enum  
> is not protected, but it is excluded from the Python wrapping -- the  
> reader was written before enums could be wrapped. I'll check in a  
> change so that it will get wrapped in the future.
>
>        David
>
>
> On Feb 17, 2011, at 15:55 , Nathan Smith wrote:
>
> Hi David,
>
> Thanks for the help.  I was able to get that to work, but it did  
> require some small hurdles.  The ObjectType enum is listed as  
> protected in the VTK documentation.  In Python, I was unable to  
> locate constants that reflected those values either, so I ended up  
> using vtkExodusIIReader::GetObjectTypeFromName("element"), which  
> returns a value of 1.  For my exodus files, this was the only object  
> type that had any data available.  I had seen  
> vtkExodusIIReader::GetObjectId() earlier, but without calling  
> UpdateInformation(), it seems to not have any data available.   
> Adding that call made everything click!
>
> Thanks again,
>
> Nathan
>
> On Thu, Feb 17, 2011 at 11:52 AM, Thompson, David C <dcthomp at sandia.gov 
> > wrote:
> Hi Nathan,
>
> Yes, there is an easier way to get the block IDs out; any time after  
> you've called UpdateInformation() on the reader with the filename  
> set properly, you can call this method:
>   int GetObjectId( int objectType, int objectIndex );
> to get the numeric ID of any object (which may be a block, set, or  
> map). The first argument should be one of the  
> vtkExodusIIReader::ObjectType enum values (in your case, it sounds  
> like you want vtkExodusIIReader::ELEM_BLOCK) and the next object  
> should be the integer offset of the block you're interested in (from  
> 0 to GetNumberOfObjects(vtkExodusIIReader::ELEM_BLOCK)-1 in your  
> case).
>
> The return value will be the ID or -1 if you pass an invalid argument.
>
>   Hope this helps,
>   David
> ________________________________________
> From: vtkusers-bounces at vtk.org [vtkusers-bounces at vtk.org] On Behalf  
> Of Nathan Smith [nathanjsmith at gmail.com]
> Sent: Thursday, February 17, 2011 09:22
> To: vtkusers at vtk.org
> Subject: [vtkusers] Exodus block IDs and vtkExodusIIReader
>
> Hello all,
>
> I am trying to read the block IDs out of an Exodus file using the  
> vtkExodusIIReader class.  I read through the really helpful  
> "vtk.vtkExodusIIReader: information in GetOutput()?" thread and see  
> how to get the name of the blocks out of the reader object.  In the  
> files that I've looked at, the name includes the block IDs.  Getting  
> at them, though, would require parsing the strings, which seems  
> terribly error prone.  Is there a method to read the block IDs from  
> the reader or its output that does not require string parsing?
>
> Thanks!
>
> Nathan
>
>
>
>
>





More information about the vtkusers mailing list