mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 13:45:36 -04:00
Avert bad numpy slices unpacking fission yields with no materials
For the case where there are more processes than burnable materials, e.g. single pin cell or assembly with one burnable material, then the local_indexes attribute on some FissionYieldHelpers will be an empty array. This causes errors trying to use this as an indexer into the tally results. Instead, simply return from the unpacking if this is the case. The compute_yields function is called inside the Operator's unpacking of it's local materials, so that __should__ not be in a position to call compute_yields for a process with no burnable materials.
This commit is contained in:
parent
27f2c6b15f
commit
c732336536
1 changed files with 7 additions and 1 deletions
|
|
@ -277,8 +277,14 @@ class FissionYieldHelper(object):
|
|||
"""Unpack fission rate tallies to produce :attr:`results`
|
||||
|
||||
Resets :attr:`libraries` under the assumption this is called
|
||||
during the :class:`openmc.deplete.Operator` unpackign process
|
||||
during the :class:`openmc.deplete.Operator` unpacking process
|
||||
"""
|
||||
# if this process is not responsible for depleting anything
|
||||
# [more processes than burnable materials]
|
||||
# don't do anything
|
||||
if self.local_indexes.size == 0:
|
||||
return
|
||||
|
||||
# clear old libraries
|
||||
self.libraries = []
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue