mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-21 14:35:27 -04:00
14 lines
352 B
Python
14 lines
352 B
Python
import matplotlib.pyplot as plt
|
|
import openmc
|
|
|
|
# Get the flux from the statepoint
|
|
with openmc.StatePoint('statepoint.10.h5') as sp:
|
|
flux = sp.tallies[1].mean
|
|
flux.shape = (50, 50)
|
|
|
|
# Plot the flux
|
|
fig, ax = plt.subplots()
|
|
ax.imshow(flux, origin='lower', extent=(-5.0, 5.0, -5.0, 5.0))
|
|
ax.set_xlabel('x [cm]')
|
|
ax.set_ylabel('y [cm]')
|
|
plt.show()
|