A graphical interface for visualizing and navigating OpenMC models.
Originally created by @landonjmitchell at the University of Chicago (original repository).
OpenMC, Matplotlib, NumPy, PySide6
This package is available from PyPI and conda-forge. To install from PyPI run the following command from the terminal:
python -m pip install openmc-plotter
Alternatively, conda can be used to install the plotter (recommended option for conda enviroments):
conda install -c conda-forge openmc-plotter
From a directory containing an OpenMC model run:
$ openmc-plotter <path_to_openmc_model_dir>
or simply run
$ openmc-plotter
from the directory containing the model.
Once the viewer has opened, press ?
to view a variety of keyboard shortcuts.
Plot view (.pltvw
) files generated in interactive sessions (see Saving and Exporting)
can be used to generate images from the command line without opening the plotter GUI.
$ openmc-plotter -b view1.pltvw view1.pltvw view1.pltvw
The plotter also provides the ability to view tallies with spatial filters (mesh filter, cell filter, etc.). After loading a statepoint file from the "Edit" menu, tallies can be displayed on top of the geometry.
Filters, scores, and nuclides on the tally can be enabled/disabled to isolate data.
Cell and material colors can be customized in the color dialog menu. Overlap coloring can be enabled as well to debug problems in the geometry definition.
The plotter can also present the CAD-based tesellation geometry enabled by the Direct Accelerated Geometry Monte Carlo (DAGMC) toolkit. Below is the cross section of a tokamake model generated using paramak:
As well as a DAGMC model of the Advanced Test Reactor (ATR):
Any image displayed in the plotter can be saved in any format supported by the user's Matplotlib installation.
Tally and geometry data (material/cell IDs) can be exported to a VTK file under "File->Export"
File→Save Image As... : Save an image file of the current plot.
File→Save View Settings... : Save a .pltvw pickle file containing the current plot settings.
File→Open View Settings... : Open and load a .pltvw pickle file containing a previously saved view.
File→Quit : Quit the application.
Edit→Apply Changes : Apply any un-applied plot setting changes, and reload plot image.
Edit→Undo : Undo last applied plot settings changes, and reload plot image.
Edit→Redo : Redo last applied plot settings changes, and reload plot image.
Edit→Restore Default Settings : Restore to default plot settings and reload plot image.
Edit→Basis→xy : Change plot basis to xy, apply changes, and reload plot.
Edit→Basis→xz : Change plot basis to xz, apply changes, and reload plot.
Edit→Basis→yz : Change plot basis to yz, apply changes, and reload plot.
Edit→Color By→Cell : Change plot settings to be colored by cell, apply changes, and reload plot.
Edit→Color By→Material : Change plot settings to be colored by material, apply changes, and reload plot.
Edit→Enable Masking : Enable/Disable masking, apply changes, and reload plot.
Edit→Enable Highlighting : Enable/Disable highlighting, apply changes, and reload plot.
Edit→Enable Overlap Coloring : Enable/Disable display of geometry overlaps, apply changes, and reload plot.
View→Hide[Show] Dock : Hide/Show Dock.
View→Zoom... : Open dialog to input new zoom value.
Window→Main Window : Activate, bring main window to front.
Window→Color Options : [Open], activate, bring color options dialog to front.
Mouse Hover : Display plot coordinates in bottom-right of status bar. Display cell/material ID and name (if any) in bottom-left of status bar.
Left Mouse Button Drag : Crop active plot to selection, apply changes, and reload plot image.
Shift + Left Mouse Button Drag : De-crop active plot so that the current plot dimensions fit within selected area, apply changes, and reload plot image.
Note: To cancel selection, reduce selection size to less than 10 pixels in either dimension and release. Active plot Origin, width, and height values will be returned to current plot settings.
Double-Click Left Mouse Button : Set origin to point clicked, apply changes, and reload plot image.
Shift + Scroll : Increase/Decrease zoom level of plot image.
Right-Click on plot background → activate context menu:
See menu bar for other context menu options.
Right-Click on plot overlap region → activate context menu:
Right-click on plot cell/material : Activate context menu:
See menu bar for other context menu options.
Close : Close the color options dialog.
Note: Fields appear dynamically based on whether Masking/Highlighting are enabled or disabled.
Application windows are restored to their previous locations and sizes. If the .xml files match those of the previous sessions, the plot model will be restored to its previous state.
Application status, including window size and location, will be saved. The current state of the plot model, including current plot and up to 10 previous/subsequent plots (i.e. for undo/redo) will be saved. Active plot changes that have not been applied will be lost.
The plot slice image in the central area of the application.
Plot settings that are changed as dock and color dialog fields are changed. Not necessarily reflected in the plot image.
Plot settings currently displayed in the plot image.
Applying changes causes the active plot to become the current plot, and a new plot image to be generated.