openmc.capi – Python bindings to the C API

This module provides bindings to C functions defined by OpenMC shared library. When the openmc package is imported, the OpenMC shared library is automatically loaded. Calls to the OpenMC library can then be via functions or objects in the openmc.capi subpackage, for example:



calculate_volumes Run stochastic volume calculation
finalize Finalize simulation and free memory
find_cell Find the cell at a given point
find_material Find the material at a given point
hard_reset Reset tallies, timers, and pseudo-random number generator state.
init Initialize OpenMC
iter_batches Iterator over batches.
keff Return the calculated k-eigenvalue and its standard deviation.
load_nuclide Load cross section data for a nuclide.
next_batch Run next batch.
num_realizations Number of realizations of global tallies.
plot_geometry Plot geometry
reset Reset tallies and timers.
run Run simulation
run_in_memory Provides context manager for calling OpenMC shared library functions.
simulation_init Initialize simulation
simulation_finalize Finalize simulation
source_bank Return source bank as NumPy array
statepoint_write Write a statepoint file.


Cell Cell stored internally.
Material Material stored internally.
Nuclide Nuclide stored internally.
Tally Tally stored internally.