[vtk-developers] [EXTERNAL] inconsistencies in vtkExodusIIReader

Andy Bauer andy.bauer at kitware.com
Mon Oct 7 17:22:12 EDT 2013


Hi David,

Thanks for the response but I'm still a bit confused. I have an ExodusII
file with 4 side sets (file attached) but when I do, in vtkpython,
r.GetNumberOfObjects(r.SIDE_SET) I get 4 but when I do
r.GetNumberOfObjects(r.SIDE_SET_CONN) I get 0. The Python code that I'm
using where I'm trying to load the single element block and all of the side
sets is:
=============
from vtk import *

r = vtkExodusIIReader()
r.SetFileName("/home/acbauer/CODE/ALBANY/albany-git-script/albany-git/albany-src/Albany/examples/Necking3DSTKAdapt/smooth_tension_coarse_tet4.exo")
r.GenerateGlobalNodeIdArrayOn()
r.GenerateGlobalElementIdArrayOn()
r.ExodusModelMetadataOn()

r.UpdateInformation()

nssa = r.GetNumberOfObjects(r.SIDE_SET)
for i in range(nssa):
  r.SetObjectStatus(r.SIDE_SET, i, 1)
  print 'setting side set ', i

def printblocks(mb, spacing):
  for i in range(mb.GetNumberOfBlocks()):
    if mb.GetBlock(i):
      print spacing, mb.GetBlock(i).GetClassName()
      if mb.GetBlock(i).IsA("vtkMultiBlockDataSet") == 1:
        printblocks(mb.GetBlock(i), spacing+"  ")
      if mb.GetBlock(i).IsA("vtkUnstructuredGrid") == 1:
        print 'ugrid has np ne ', mb.GetBlock(i).GetNumberOfPoints(),
mb.GetBlock(i).GetNumberOfCells()

r.Update()
mb = r.GetOutput()
printblocks(mb, "")
============

Is that correct then to use r.SIDE_SET instead of r.SIDE_SET_CONN here with
r.SetObjectStatus()?

Thanks,
Andy




On Mon, Oct 7, 2013 at 2:31 PM, David Thompson
<david.thompson at kitware.com>wrote:

> Hi Andy,
>
> > I bet you already know this, but I believe that David Thompson is  the
> most knowledgeable person with regards to that reader.
>
> Sorry, I am here... but slow.
>
> > I'm a bit confused with the ExodusII reader between the sets and the
> arrays of sets. I'm wondering if the following is a bug or a lack of my
> understanding. To set the SIDE_SET status it does the following in the
> header file using the SetObjectStatus() method:
> >
> >   void SetSideSetArrayStatus(const char* name, int flag)
> >     { this->SetObjectStatus(SIDE_SET, name, flag); }
> >
> > For the SetAllArrayStatus() method, if I call that with otyp = SIDE_SET
> it looks like it wants to use the SetObjectArrayStatusMethod() through the
> following:
> >
> > void vtkExodusIIReader::SetAllArrayStatus( int otyp, int status )
> > { ...
> >
> > In my testing using Python, the r.SetAllArrayStatus(r.SIDE_SET, 1) call
> doesn't load any side sets even though I was expecting it to.
>
> There are two types of status variables: connectivity status and array
> status. Connectivity status is used to select whether VTK cells will be
> created for the corresponding block or set. Array status is used to select
> which point-data or cell-data arrays in the Exodus file should be loaded
> and stored on the cells. Thus if you have a boundary condition variable
> named "A" defined on side set 100, you must set the connectivity status for
> side set 100 to true *and* the variable status for "A" to true in order to
> visualize the boundary condition.
>
> By default, element blocks have their connectivity status set to true and
> all others are false. You should use SIDE_SET_CONN to indicate that you
> want the side set loaded and SIDE_SET when indicating which scalars you
> want loaded onto the connectivity.
>
> In ParaView, note that side sets are considered "Advanced" functionality,
> so you must click on the gear icon in order to select side sets to load.
>
>         David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20131007/bcadf743/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smooth_tension_coarse_tet4.exo
Type: application/octet-stream
Size: 130388 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20131007/bcadf743/attachment-0002.obj>


More information about the vtk-developers mailing list