Skip to content

Commit

Permalink
fix numba bug in iqmc_cooper. fix unit test bug due to the passing of…
Browse files Browse the repository at this point in the history
… particle container
  • Loading branch information
ilhamv committed Oct 4, 2024
1 parent f1dddd8 commit 09730ef
Show file tree
Hide file tree
Showing 3 changed files with 379 additions and 187 deletions.
2 changes: 1 addition & 1 deletion mcdc/iqmc/iqmc_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ def iqmc_surface_crossing(P_arr, prog):
if surface["BC"] == BC_VACUUM:
P["alive"] = False
elif surface["BC"] == BC_REFLECTIVE:
surface_.reflect(P, surface)
surface_.reflect(P_arr, surface)

# Need to check new cell later?
if P["alive"] and not surface["BC"] == BC_REFLECTIVE:
Expand Down
8 changes: 4 additions & 4 deletions test/unit/src/surface/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def test_translate_particle_position():
t = 6.0
P = particle(5.0, 3.0, 8.0, t, u, -u, u)
idx = _get_move_idx(t, surface)
_translate_particle_position(P, surface, idx)
_translate_particle_position([P], surface, idx)
x = 5.0 - move_translations[3][0]
y = 3.0 - move_translations[3][1]
z = 8.0 - move_translations[3][2]
Expand All @@ -79,7 +79,7 @@ def test_translate_particle_position():
t = 6.5
P = particle(5.0, 3.0, 8.0, t, u, -u, u)
idx = _get_move_idx(t, surface)
_translate_particle_position(P, surface, idx)
_translate_particle_position([P], surface, idx)
x = 5.0 - move_translations[3][0] - move_velocities[3][0] * (t - time_grid[3])
y = 3.0 - move_translations[3][1] - move_velocities[3][1] * (t - time_grid[3])
z = 8.0 - move_translations[3][2] - move_velocities[3][2] * (t - time_grid[3])
Expand All @@ -100,7 +100,7 @@ def test_translate_particle_direction():
t = 6.0
P = particle(5.0, 3.0, 8.0, t, u, -u, u)
idx = _get_move_idx(t, surface)
_translate_particle_direction(P, speed, surface, idx)
_translate_particle_direction([P], speed, surface, idx)
ux = u - move_velocities[3][0] / speed
uy = -u - move_velocities[3][1] / speed
uz = u - move_velocities[3][2] / speed
Expand All @@ -116,7 +116,7 @@ def test_translate_particle_direction():
t = 6.5
P = particle(5.0, 3.0, 8.0, t, u, -u, u)
idx = _get_move_idx(t, surface)
_translate_particle_direction(P, speed, surface, idx)
_translate_particle_direction([P], speed, surface, idx)
ux = u - move_velocities[3][0] / speed
uy = -u - move_velocities[3][1] / speed
uz = u - move_velocities[3][2] / speed
Expand Down
Loading

0 comments on commit 09730ef

Please sign in to comment.