mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-29 06:35:48 -04:00
generalized the insertion of the momemt order in statepoint.py
This commit is contained in:
parent
4fcdd7f0d6
commit
82483b6490
1 changed files with 7 additions and 9 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import copy
|
||||
import sys
|
||||
|
||||
import re
|
||||
import numpy as np
|
||||
|
||||
import openmc
|
||||
|
|
@ -429,14 +429,12 @@ class StatePoint(object):
|
|||
|
||||
# Add the scores to the Tally
|
||||
for j, score in enumerate(scores):
|
||||
score = score.decode()
|
||||
# If this is a scattering moment, insert the scattering order
|
||||
if '-n' in score and 'delayed' not in score:
|
||||
score = score.replace('-n', '-' + moments[j].decode())
|
||||
elif '-pn' in score:
|
||||
score = score.replace('-pn', '-' + moments[j].decode())
|
||||
elif '-yn' in score:
|
||||
score = score.replace('-yn', '-' + moments[j].decode())
|
||||
|
||||
# If this is a moment, use generic moment order
|
||||
regexp = re.compile(r'-n$|-pn$|-yn$')
|
||||
if regexp.search(score) is not None:
|
||||
score = score.strip(regexp.findall(score)[0])
|
||||
score += '-' + moments[j]
|
||||
|
||||
tally.add_score(score)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue