Skip to content

Commit 575f1e2

Browse files
committed
fix various typos and bugs causing tests to fail
1 parent 4c4ccdc commit 575f1e2

2 files changed

Lines changed: 9 additions & 10 deletions

File tree

mcdc/transport/physics/interface.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,12 @@ def total_xs(particle_container, simulation, data):
5151
"""
5252
particle = particle_container[0]
5353
if particle["particle_type"] == PARTICLE_NEUTRON:
54-
module = neutron
55-
type_total = NEUTRON_REACTION_TOTAL
54+
total = NEUTRON_REACTION_TOTAL
55+
return neutron.macro_xs(total, particle_container, simulation, data)
5656
elif particle["particle_type"] == PARTICLE_ELECTRON:
57-
module = electron
58-
type_total = ELECTRON_REACTION_TOTAL
59-
else:
60-
return 0.0
61-
return module.macro_xs(type_total, particle_container, simulation, data)
57+
total = ELECTRON_REACTION_TOTAL
58+
return electron.macro_xs(total, particle_container, simulation, data)
59+
return 0.0
6260

6361

6462
@njit

mcdc/transport/technique.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import math
33

44
from numba import njit
5+
import numba
56

67
####
78

@@ -139,6 +140,8 @@ def forced_collision_roulette(particle_container, program, data):
139140

140141
# get index into arrays
141142
index = get_forced_collision_cell_index(particle_container, fc_object, data)
143+
if index < 0:
144+
return
142145

143146
# get weights
144147
threshold = mcdc_get.forced_collisions.threshold_weights(index, fc_object, data)
@@ -178,9 +181,7 @@ def get_forced_collision_cell_index(particle_container, fc_object, data):
178181
return index
179182

180183
# should never hit this, but just to be safe
181-
print_error(
182-
f"Failed to find {particle['cell_ID']} in list of cell ids for forced collisions"
183-
)
184+
return -1
184185

185186

186187
@njit

0 commit comments

Comments
 (0)