OpenMC VSCode Extension
A Visual Studio Code extension for inspecting OpenMC statepoint files. This extension provides a user-friendly interface to view tallies, meshes, general information, and simulation results from OpenMC HDF5 statepoint files.
Features
- Statepoint File Viewer: Open and inspect OpenMC statepoint files (
.h5, .hdf5)
- General Information Display: View simulation parameters, batch information, and runtime data
- Interactive Tally Inspection: Click on tallies to view detailed information including:
- Spectrum visualization with multiple chart types (line, bar, scatter)
- Logarithmic and linear scale options for both axes
- Error bars visualization (±σ)
- Energy-dependent axis labels when energy filters are present
- Detailed filter information (energy bins, cell IDs, mesh associations)
- Results data table with mean, standard deviation, and relative error
- Mesh Visualization: Examine mesh definitions including dimensions and spatial bounds
- Summary Statistics: View key simulation metrics like k-effective and entropy
- Depletion Results Viewer: Open and inspect OpenMC depletion results files (e.g.
depletion_results.h5) to see:
- Overview: format version, number of time steps, total depletion time, materials, nuclides and tracked reactions
- Time step table with time (s and days), k-effective ± σ, source rate and depletion (wall-clock) time
- k-effective evolution chart
- Material composition at any time step (atoms, atom density in atom/b-cm, and atom fraction)
- Nuclide search in both the composition table and the evolution chart — filter by element (
Pu), mass number (137) or full name (Cs137), and combine several terms
- Evolution chart that overlays multiple nuclides at once, with an optional logarithmic axis
- User-Friendly Interface: Clean, VSCode-themed interface with organized sections
Installation
From VSIX
- Download the
.vsix file
- Open VSCode
- Go to Extensions view (Ctrl+Shift+X)
- Click the "..." menu at the top
- Select "Install from VSIX..."
- Choose the downloaded
.vsix file
From Source
# Clone the repository
git clone https://github.com/Villadslj/openmc-vscode-extension.git
cd openmc-vscode-extension
# Install dependencies
npm install
# Compile the extension
npm run compile
# Package the extension (optional)
npm run package
Usage
Opening Statepoint Files
There are two ways to open statepoint files:
Command Palette Method:
- Press
Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (Mac)
- Type "OpenMC: Open Statepoint File"
- Select your
.h5 or .hdf5 file
File Explorer Method:
- Right-click on an
.h5 file in the VSCode file explorer
- Select "Open With..."
- Choose "OpenMC Statepoint Viewer"
Opening Depletion Results Files
Command Palette Method:
- Press
Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (Mac)
- Type "OpenMC: Open Depletion Results File"
- Select your
depletion_results.h5 file
File Explorer Method:
- Files whose name contains
depletion (e.g. depletion_results.h5) open in the depletion viewer directly
- For other names, right-click the
.h5 file, select "Open With..." and choose "OpenMC Statepoint Viewer" — depletion files are detected from their contents and shown in the depletion viewer automatically
Filtering Nuclides
Both the Material Composition table and the Nuclide Evolution chart have a search box:
| Query |
Matches |
Pu |
every plutonium isotope (element symbol prefix) |
137 |
every nuclide with mass number 137 (Cs137, Ba137, Xe137, …) |
Cs137 |
that nuclide and its metastable states |
Am242_m1 |
only that metastable state |
U235 Pu239 Cs137 |
any of the listed nuclides (terms are separated by spaces or commas) |
In Nuclide Evolution, tick any number of nuclides to overlay them on the chart, use Add matching to add the current search results in one go, and remove a nuclide by clicking the × on its chip.
Once a statepoint file is opened, you'll see:
- General Information: Simulation parameters, version, number of particles, batches, etc.
- Tallies: List of all tallies with their properties and results (click to see detailed view)
- Meshes: Details about mesh definitions used in the simulation
- Summary Statistics: Key results like k-effective value
Tally Detail View
Click on any tally to open a detailed modal view with:
- Basic Information: Tally ID, name, estimator type, and number of score bins
- Scores and Nuclides: Lists of score types and nuclides being tracked
- Filter Details: Information about filters applied to the tally, including:
- Energy filter bins (in eV)
- Cell filter IDs
- Mesh filter associations
- Spectrum Visualization: Interactive chart with controls for:
- Chart type (line, bar, scatter)
- Y-axis scale (logarithmic/linear)
- X-axis scale (logarithmic/linear)
- Error bars toggle
- Results Data Table: Detailed table showing bin index, x-value, mean, standard deviation, and relative error
Requirements
- Visual Studio Code 1.108.0 or higher
- Node.js 18 or higher (only needed to build from source)
- OpenMC statepoint or depletion results files in HDF5 format
Extension Settings
This extension does not add any VSCode settings at this time.
Known Issues
- Large statepoint files may take some time to load
- Some advanced OpenMC features may not be fully displayed yet
Development
Building
npm run compile
Packaging
npm run package
Running in Development
- Open the project in VSCode
- Run
npm install if you have not already
- Press F5 to launch the Run Extension configuration in a new Extension Development Host window
- Test the extension with sample statepoint files
The F5 launch compiles the extension first via the npm: compile task. Use npm run watch in a
terminal if you prefer incremental rebuilds while the host window stays open.
Contributing
Contributions are welcome! Please feel free to submit issues and pull requests.
License
MIT
Credits
This extension uses:
- h5wasm for reading HDF5 files
- VSCode Extension API
Support
For issues and feature requests, please visit the GitHub repository.
| |