Exodus import, toggle by element type

For many finite element analysis (e.g., the Sierra suite of solvers) solvers, many field variables are only applicable to certain types of elements (e.g., stresses at particular integration points through the thickness of shells). Considering only the Exodus database format, loading all element blocks and visualizing such a field variable results in other elements being displayed in a color that starkly contrasts with the rest of the visualization, polluting the display. For output Exodus databases containing numerous (100s to 1000s) element blocks of different element formulations, the process of manually selecting or deselecting element blocks based on element formulation is a tedious process. If instead the element formulations were gathered upon reading the metadata of an Exodus output database, a user had the ability to toggle particular types of elements (e.g., BEAM, TRIANGLE, SHELL, …), the process of visualizing and postprocessing results would be streamlined.

I see the utility of this functionality. I’ve certainly been overwhelmed at times with dealing with the number of blocks when I want a specific subset of them.

I personally wouldn’t want to make modifications to the ParaView ExodusII reader since there is a lot of infrastructure build up inside of that code that I’d worry about creating problems with that.

Maybe another solution would be to create a Python Plugin for ParaView. Since the cell types are homogeneous inside of an ExodusII block (this won’t be true for other types of multiblock datasets though), a block could be extracted based on the first cell type and whether it matches a cell type or dimension.

I wanted to try developing a Python Plugin so I wrote one for this functionality. I tried to document it some. It’s based off of get all cells using a certain point id - #7 by boonth.

I didn’t add in all the cell types but if you look at the bottom of the script you can see how to add in more cell types. Also, I couldn’t figure out how to add in a boolean check box for filter input so I just used integer inputs where 0 or no value means not to extract blocks of a certain cell type.
processMultiBlocks.py (6.5 KB)

1 Like

Hey Andy. Thanks for looking into this. I just tried using your Plugin, which seems to work well! Incidentally while testing it with 5.11.1, I discovered the “Extract Cells by Type” Filter, which seems to be very similar. Going about this as a Filter rather than a Reader was something that I had not considered. It looks like you and whoever wrote the other filter are more creative than I am.

The Extract Cells By Type filter may be more convenient since loading a plugin isn’t needed for that. It will do dataset modification though. So a completely new grid object will be created, which could be bad for large datasets if you want either no or all cells of a block and the cells aren’t homogeneous. The Extract Cells By Type does check for homogeneous cells though and if the cells are all of the same type the filter generates a shallow copy for output from the input, which makes the filter efficient for your use case.

After getting some more information in boolean input for Python Plugin - #2 by theodorebaltis I figured out how to properly set boolean filter inputs so I updated my plugin –
processMultiBlocks2.py (8.4 KB)

The Extract Cells By Type is probably a better solution since it is doesn’t need to be loaded as a plugin, efficient and maintains the block hierarchy. At least I learned how to implement a ParaView Python plugin though so it was a worthwhile exercise for me :slight_smile: