Skip to content

Commit

Permalink
reconfigure indexing of surface velocities
Browse files Browse the repository at this point in the history
  • Loading branch information
ilhamv committed Sep 4, 2024
1 parent be359dc commit 793e4e5
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
18 changes: 9 additions & 9 deletions mcdc/src/surface/plane.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ def _evaluate_moving(particle, surface):
idx = common._get_move_idx(particle["t"], surface)

# Translation velocity
Vx = surface["move_velocities"][idx][0]
Vy = surface["move_velocities"][idx][1]
Vz = surface["move_velocities"][idx][2]
Vx = surface["move_velocities"][idx, 0]
Vy = surface["move_velocities"][idx, 1]
Vz = surface["move_velocities"][idx, 2]

# Translated position
t_local = particle["t"] - surface["move_time_grid"][idx]
Expand Down Expand Up @@ -134,9 +134,9 @@ def _get_normal_component_moving(particle, speed, surface):
idx = common._get_move_idx(particle["t"], surface)

# Translation velocity
Vx = surface["move_velocities"][idx][0]
Vy = surface["move_velocities"][idx][1]
Vz = surface["move_velocities"][idx][2]
Vx = surface["move_velocities"][idx, 0]
Vy = surface["move_velocities"][idx, 1]
Vz = surface["move_velocities"][idx, 2]

# Relative direction
rVx = particle["ux"] - Vx / speed
Expand Down Expand Up @@ -198,9 +198,9 @@ def _get_distance_moving(particle, speed, surface):
# Evaluate the current and the subsequent intervals until intersecting
while idx < surface["N_move"]:
# Apply translation velocity
Vx = surface["move_velocities"][idx][0]
Vy = surface["move_velocities"][idx][1]
Vz = surface["move_velocities"][idx][2]
Vx = surface["move_velocities"][idx, 0]
Vy = surface["move_velocities"][idx, 1]
Vz = surface["move_velocities"][idx, 2]
particle["ux"] -= Vx / speed
particle["uy"] -= Vy / speed
particle["uz"] -= Vz / speed
Expand Down
6 changes: 3 additions & 3 deletions mcdc/src/surface/plane_x.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def _evaluate_moving(particle, surface):
idx = common._get_move_idx(particle["t"], surface)

# Translation velocity
Vx = surface["move_velocities"][idx][0]
Vx = surface["move_velocities"][idx, 0]

# Translated position
t_local = particle["t"] - surface["move_time_grid"][idx]
Expand Down Expand Up @@ -80,7 +80,7 @@ def _get_normal_component_moving(particle, speed, surface):
idx = common._get_move_idx(particle["t"], surface)

# Translation velocity
Vx = surface["move_velocities"][idx][0]
Vx = surface["move_velocities"][idx, 0]

# Return relative direction
return particle["ux"] - Vx / speed
Expand Down Expand Up @@ -134,7 +134,7 @@ def _get_distance_moving(particle, speed, surface):
# Evaluate the current and the subsequent intervals until intersecting
while idx < surface["N_move"]:
# Apply translation velocity
Vx = surface["move_velocities"][idx][0]
Vx = surface["move_velocities"][idx, 0]
particle["ux"] -= Vx / speed

# Get distance
Expand Down
6 changes: 3 additions & 3 deletions mcdc/src/surface/plane_y.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def _evaluate_moving(particle, surface):
idx = common._get_move_idx(particle["t"], surface)

# Translation velocity
Vy = surface["move_velocities"][idx][1]
Vy = surface["move_velocities"][idx, 1]

# Translated position
t_local = particle["t"] - surface["move_time_grid"][idx]
Expand Down Expand Up @@ -80,7 +80,7 @@ def _get_normal_component_moving(particle, speed, surface):
idx = common._get_move_idx(particle["t"], surface)

# Translation velocity
Vy = surface["move_velocities"][idx][1]
Vy = surface["move_velocities"][idx, 1]

# Return relative direction
return particle["uy"] - Vy / speed
Expand Down Expand Up @@ -134,7 +134,7 @@ def _get_distance_moving(particle, speed, surface):
# Evaluate the current and the subsequent intervals until intersecting
while idx < surface["N_move"]:
# Apply translation velocity
Vy = surface["move_velocities"][idx][1]
Vy = surface["move_velocities"][idx, 1]
particle["uy"] -= Vy / speed

# Get distance
Expand Down
6 changes: 3 additions & 3 deletions mcdc/src/surface/plane_z.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def _evaluate_moving(particle, surface):
idx = common._get_move_idx(particle["t"], surface)

# Translation velocity
Vz = surface["move_velocities"][idx][2]
Vz = surface["move_velocities"][idx, 2]

# Translated position
t_local = particle["t"] - surface["move_time_grid"][idx]
Expand Down Expand Up @@ -80,7 +80,7 @@ def _get_normal_component_moving(particle, speed, surface):
idx = common._get_move_idx(particle["t"], surface)

# Translation velocity
Vz = surface["move_velocities"][idx][2]
Vz = surface["move_velocities"][idx, 2]

# Return relative direction
return particle["uz"] - Vz / speed
Expand Down Expand Up @@ -134,7 +134,7 @@ def _get_distance_moving(particle, speed, surface):
# Evaluate the current and the subsequent intervals until intersecting
while idx < surface["N_move"]:
# Apply translation velocity
Vz = surface["move_velocities"][idx][2]
Vz = surface["move_velocities"][idx, 2]
particle["uz"] -= Vz / speed

# Get distance
Expand Down

0 comments on commit 793e4e5

Please sign in to comment.