Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
spasmann committed Nov 8, 2023
1 parent 0376a2d commit 71f7ea0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
4 changes: 3 additions & 1 deletion mcdc/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -1650,6 +1650,8 @@ def move_to_event(P, mcdc):
store_ray_data(t, x, y, z, outside, P, distance, mcdc)
score_iqmc_tallies(t, x, y, z, outside, P, distance, mcdc)
continuous_weight_reduction(P, distance, mcdc)
if np.abs(P["w"]) <= mcdc["technique"]["iqmc_w_min"]:
P["alive"] = False


# Score tracklength tallies
Expand Down Expand Up @@ -2501,7 +2503,7 @@ def iqmc_recalculate_particle_weights(mcdc):
for idx_work in range(N_work):
P = bank[idx_work]
P_idx = P["iqmc_first_idx"]
t,x,y,z = iqmc_mesh_get_index(P, mesh)
t,x,y,z,outside = iqmc_mesh_get_index(P, mesh)
q = Q[:, t, x, y, z].copy()
dV = iqmc_cell_volume(x, y, z, mesh)
# Source tilt
Expand Down
15 changes: 5 additions & 10 deletions mcdc/loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,15 +331,11 @@ def iqmc_loop_source(mcdc):
@njit
def iqmc_loop_particle(P, mcdc):
ray_history = mcdc["technique"]["iqmc_ray_history"]

mesh = mcdc["technique"]["iqmc_mesh"]
idx = P["iqmc_first_idx"]
idx = ray_history[idx]["next_idx"]
while (idx != -1) and P['alive']:
t = ray_history[idx]["mesh_idx"][0]
x = ray_history[idx]["mesh_idx"][1]
y = ray_history[idx]["mesh_idx"][2]
z = ray_history[idx]["mesh_idx"][3]
outside = ray_history[idx]["mesh_idx"][4]
t,x,y,z,outside = kernel.iqmc_mesh_get_index(P, mesh)
P["material_ID"] = ray_history[idx]["material_ID"]
distance = ray_history[idx]["distance"]
kernel.score_iqmc_tallies(t, x, y, z, outside, P, distance, mcdc)
Expand Down Expand Up @@ -653,10 +649,9 @@ def power_iteration(mcdc):

while not simulation_end:
# iterate over scattering source
if solver == "source_iteration":
source_iteration(mcdc)
if solver == "gmres":
gmres(mcdc)
mcdc["technique"]["iqmc_maxitt"] = 1
source_iteration(mcdc)
mcdc["technique"]["iqmc_maxitt"] = maxit
# reset counter for inner iteration
mcdc["technique"]["iqmc_itt"] = 0

Expand Down

0 comments on commit 71f7ea0

Please sign in to comment.