Voxel coloring

Hi,

I am making a voxel plot, and I’m trying to color the elements by their material.

When I produce the hdf file of the 3D-plot, I get a warning:

“WARNING: Color specifications ignored in voxel plot 2”

When I open the converted VTK file in ParaView, the colormap refers to cell id.

Is there a way to:

  1. Refer the colormap to material id instead?
  2. Export the colormap from OpenMC to the hdf file?

Thanks,
Shai

If you set:

p = openmc.Plot()
p.color_by = ‘material’

that will change it to color the plot by materials rather than cells.

Best,
Paul

Hi Paul,

Thanks for your reply.
The color_by function works fine in 2D plotting.
However, in 3D plotting this doesn’t seem to work.

Thanks,
Shai

Yes, it appears you’re correct. Unfortunately that means there’s nothing you can do to get the material IDs at present. However, I’ve just submitted a bugfix that will allow the color_by option to work for voxel plots, so that should be part of the next version.

Best,
Paul

1 Like

Thank you very much!