Introducing openmc-plot a browser based option for plotting openmc geometry mesh tallies and dagmc geometry

Version 0.2.1 release of openmc-plot is now live
https://openmc-plot.xsplot.com

It includes faster geometry plotting and support for dagmc model plotting.

The locally installed version runs a bit faster and more reliably than the webserver deployed version
pip install openmc_plot then openmc_plot to run

2 Likes

Hi Shimwell
I was using xsplot.com server for viewing OpenMc geometry. It worked fine for a while. It now gives

Saved File to geometry.xml

small icon

Model info
Material IDS found {1, 2, 4, 9}
Material names found {1, 2, 4, 9}
Cell IDS found {1, 2, 3, 4}
Cell names found {‘’}
Bounding box lower left x=-600.0 y=-600.0 z=-600.0
Bounding box upper right x=600.0 y=600.0 z=600.0

Also my install of this on MacBook is having trouble. Any help would be appreciated.

Thanks for letting me know.

Are you able to show a screen shot of the error and i can look into it.

All the best

Jon

geometry.xml file i used

<?xml version='1.0' encoding='UTF-8'?> 1.7 5 0.0 0.0 1 1 1 1 1 1 4 1 1 4 1 1 1 1 1 1 1 1 1 1 1 4 1 1 4 1 1 4 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 1 1 4 1 1 4 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 1 1 4 1 1 4 1 1 4 1 1 1 1 3 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 3 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 3 1 1 1 1 4 1 1 4 1 1 4 1 1 4 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 1 1 4 1 1 4 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 1 1 4 1 1 4 1 1 1 1 1 1 1 1 1 1 1 4 1 1 4 1 1 1 1 1 1

I have just updated the pypi openmc_plot package. Not had time to do the website yet. But you could install and plot locally with

The locally installed version runs a bit faster and more reliably than the webserver deployed version
pip install openmc_plot then openmc_plot to run

1 Like

I have tried local install. Goes through steps until I select xml file. Here is the error I get

File "/Users/dasavr/anaconda3/envs/openmc-env/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 584, in _run_script
    exec(code, module.__dict__)File "/Users/dasavr/anaconda3/envs/openmc-env/lib/python3.12/site-packages/openmc_plot/pages/1_🖼_Geometry_plot.py", line 21, in <module>
    openmc_geometry_plot.main()File "/Users/dasavr/anaconda3/envs/openmc-env/lib/python3.12/site-packages/openmc_geometry_plot/app.py", line 366, in main
    plot = my_geometry.plot(
           ^^^^^^^^^^^^^^^^^File "/Users/dasavr/anaconda3/envs/openmc-env/lib/python3.12/site-packages/openmc/geometry.py", line 795, in plot
    return self.root_universe.plot(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/Users/dasavr/anaconda3/envs/openmc-env/lib/python3.12/site-packages/openmc/universe.py", line 446, in plot
    model.plot_geometry(False, cwd=tmpdir, openmc_exec=openmc_exec)File "/Users/dasavr/anaconda3/envs/openmc-env/lib/python3.12/site-packages/openmc/model/model.py", line 828, in plot_geometry
    openmc.plot_geometry(output=output, openmc_exec=openmc_exec)File "/Users/dasavr/anaconda3/envs/openmc-env/lib/python3.12/site-packages/openmc/executor.py", line 154, in plot_geometry
    _run(args, output, cwd)File "/Users/dasavr/anaconda3/envs/openmc-env/lib/python3.12/site-packages/openmc/executor.py", line 125, in _run
    raise RuntimeError(error_msg)

Ah yes sorry i think it needs the some features on the dev branch of openmc to work. Perhaps the next release of openmc is not far away.

Hello, I tryed to plot the cylindrical source, but it makes error


And here is my settings.xml
settings.xml (2.7 KB)

Hi Richard

Sounds like openmc_plot needs an update. In the meantime perhaps just use the openmc_source_plotter directly if you want that functionality.

Here is an example
openmc_source_plotter/examples/example_plot_source_energy.py at main · fusion-energy/openmc_source_plotter (github.com)

Thanks, I will try it

AttributeError: module ‘matplotlib.cm’ has no attribute ‘get_cmap’

Traceback:

File "/home/minhajj/miniconda3/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 589, in _run_script
    exec(code, module.__dict__)File "/home/minhajj/miniconda3/lib/python3.12/site-packages/openmc_geometry_plot/app.py", line 431, in <module>
    main()File "/home/minhajj/miniconda3/lib/python3.12/site-packages/openmc_geometry_plot/app.py", line 304, in main
    cmap = cm.get_cmap(selected_color_map, len(all_cells))
           ^^^^^^^^^^^
```   error in openmc_plot