mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
Teach openmc.StatePoint about internal tallies
When reading tally data from the statepoint file, tallies that are marked as internal are not created nor added to the StatePoint.tallies property
This commit is contained in:
parent
a83f4d2bb2
commit
4b688e5efa
1 changed files with 7 additions and 2 deletions
|
|
@ -375,13 +375,18 @@ class StatePoint(object):
|
|||
for tally_id in tally_ids:
|
||||
group = tallies_group['tally {}'.format(tally_id)]
|
||||
|
||||
# Read the number of realizations
|
||||
n_realizations = group['n_realizations'][()]
|
||||
# Check if tally is internal and therefore has no data
|
||||
if group.attrs.get("internal"):
|
||||
continue
|
||||
|
||||
# Create Tally object and assign basic properties
|
||||
tally = openmc.Tally(tally_id)
|
||||
tally._sp_filename = self._f.filename
|
||||
tally.name = group['name'][()].decode() if 'name' in group else ''
|
||||
|
||||
# Read the number of realizations
|
||||
n_realizations = group['n_realizations'][()]
|
||||
|
||||
tally.estimator = group['estimator'][()].decode()
|
||||
tally.num_realizations = n_realizations
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue