vtkExodusIIWriter / Side Set Example

Hello,

I’m trying to write out a model as Exodus II and want to include side set and node set information in it. Is this possible and are there any examples around? Looking at the help, it looks like it is possible with vtkModelMetadata but I can’t figure out what all needs to be populated to make it work.

vtkExodusIIReader brings in the side sets as individual unstructured grids, and ParaView exports the side sets as blocks and not actually as sets so those haven’t been useful for me to look at. For my use, I need the information in the Exodus II file to be side sets so that it can be used in an analysis program.

Thanks for any help or guidance anyone can provide,

Robby

And I suppose the more important question is can you do it from Python? Continuing to trudge my way through it, the method to set the node set ids on vtkModelMetadata (SetNodeSetIds) wants a pointer to the memory which I don’t think is possible from Python.

It looks like I should be able to use ctypes and byref() to pass the pointer, but now I’ve run into a more concrete problem: The documentation says I should tell vtkModelMetadata how many side sets I have before I set all the other information, but it crashes as soon as I do.

from vtkmodules.vtkIOExodus import vtkModelMetadata
metadata = vtkModelMetadata()
metadata.SetNumberOfNodeSets(1)

Is there another step in there that I’m supposed to do, or why does this crash?

Thanks!