DPF Plot scoping on based on material number
I am trying to use DPF to plot custom results on a mesh. I need to specify the elements plotted by material number (specifically material number = 1). I've pulled together the following code from the help and examples. Specifically, I need to only display the selected elements. There is help on scoping, but can't figure out how to connect the scoping to the mesh_set.
model = dpf.Model("C:/example.rst")
mesh_set = model.metadata.meshed_region
plot = DpfPlotter()
plot.add_field(field_to_keep, meshed_region=mesh_set)
plot.show_figure(show_axes=True)
Answers
-
hello @ChrisC if you dig into the post below, there is a line showing how to get out the material/element data: https://discuss.ansys.com/discussion/2775/how-to-put-multiple-results-on-one-plot#latest
0