Errors exporting and plotting geometry

I have created a fairly straightforward (but very long) model in OpenMC 0.9.0 and am running into trouble when trying to plot the geometry or export it to xml. I’ve used universe.plot to inspect the geometry at several levels to ensure that it is as expected.

When attempting to export the geometry to xml, I get the following error:

`

Hi Sourena,

My apologies for taking a while to get back to you. I’m not 100% sure about the first issue, but looking at the relevant source code, I suspect this may be caused by having two different objects of the same class with the same ID. For example, if you have two different cells that are both assigned the same ID, this error might result. Take a look through your model and see if you can identify anything like that. For what it’s worth, the code in question that is causing this error was completely refactored in version 0.10.0, so upgrading to that version might get rid of the error at the time of export.

The second problem (regarding the convert command) is likely because you do not have ImageMagick installed, which is what is used by default to convert the PPM file that the OpenMC executable spits out into a PNG. I’m not sure what distribution you’re running on, but ImageMagick can usually be found in the package manager for a Linux distribution. For example, on Ubuntu, you would need to:

sudo apt install imagemagick

Best regards,
Paul

Hi Paul,

Sorry for not updating the thread myself earlier. It did in fact turn out to be an error in the geometry which was not evident from the universe.plots I was doing for verification.

I believe the same problem caused the error I was getting with plot_inline, since imagemagick is definitely already installed. Oddly enough, I managed to get around that problem (which is how I eventually found my geometry error) by using openmc.plot_geometry():

`
plots = openmc.Plots([plot1, plot2])
plots.export_to_xml()

openmc.plot_geometry()

os.system(‘convert ‘+plot1.filename+’.ppm ‘+plot1.filename+’.png’)
os.system(‘convert ‘+plot2.filename+’.ppm ‘+plot2.filename+’.png’)
`

Thanks for your help, I do need to updated to 0.10.0, I just hadn’t gotten around to it yet.

Sourena

PS The error with the geometry was with how I was creating a vertical stack. I had not realized that a universe with Z limits [0,50] would need to be translated in the Z direction to say [50,100], [100,150] and so on if repeated vertically.