[vtkusers] vtk.vtkExodusIIReader: information in GetOutput()?

Nico Schlömer nico.schloemer at gmail.com
Mon Dec 6 19:06:49 EST 2010


Thanks David for the info!

I tried the snippet your provided and got

============ *snip* ============
Element Blocks
  block_5
Face Blocks
Edge Blocks
Element Sets
Side Sets
Face Sets
Edge Sets
Node Set
============ *snap* ============

I guess that tells me I got one element block, and that'd be it. I
guess Exodus is minimalistic in the sense that it contains exactly
what was put into the file once, and even though there are egdes in
the mesh naturally, they are not stored in the file. Fair enough.

I think I'll play around with trying to read a file, manipulate, and
write it out again.

Do you happen to know if it's possible to iterate over the edges
and/or faces of a vtkUnstructuredGrid?

Cheers!
Nico

That reminds me:


On Mon, Dec 6, 2010 at 9:21 PM, David Thompson <dcthomp at sandia.gov> wrote:
>> ... when reading an ExodusII file with
>>  reader = vtk.vtkExodusIIReader()
>>  reader.Update()
>>  out = reader.GetOutput()
>> 'out' would contain a whole lot of output the significance of which I
>> don't quite understant;
>
> Hi Nico,
>
> The old vtkExodusReader used to output a single unstructured grid. This made
> it difficult to handle the case when a variable was defined on some cells
> (in one element block) but not on others (in a different element block). It
> was also awkward to provide information about node sets and face sets. At
> the time, there was also no concept of pedigree and global ID arrays in
> vtkDataSetAttributes. This made writing Exodus datasets back out to a file
> after some manipulation difficult since much of the information in the
> original file could not be preserved. The vtkExodusModel and
> vtkModelMetadata classes were attempts to encapsulate some of that
> information for later access by a writer.
>
> The new vtkExodusIIReader outputs a multiblock dataset. Each multiblock
> dataset may have an arbitrary number of blocks, where each block is a
> arbitary dataset (an unstructured grid, an image, or even another multiblock
> dataset). The new reader outputs a multiblock dataset where each of the
> top-level blocks is itself a multiblock dataset holding unstructured grids
> of a single type (element blocks, face blocks, edge blocks, element sets,
> side sets, face sets, edge sets, node sets). When you "print out" you are
> seeing all of the internal variables associated with the one toplevel
> multiblock dataset and its children.
>
> This should print some more concise information about the blocks:
> ====================== *snip* ======================
> for i in range( out.GetNumberOfBlocks() ):
>  print out.GetMetaData( i ).Get( vtkCompositeDataSet.NAME() )
>  blk = out.GetBlock( i )
>  for j in range( blk.GetNumberOfBlocks() ):
>    print '  ' + blk.GetMetaData( j ).Get( vtkCompositeDataSet.NAME() )
>
> ====================== *snip* ======================
> When the reader is told to read a block or set (only element blocks are read
> by default), then an unstructured grid will be inserted into the appropriate
> sub-block of the main reader's output.
>
>        Hope this helps,
>        David
>
>
>
>



More information about the vtkusers mailing list