Skip to content
Snippets Groups Projects
Commit 1af58463 authored by Rafael Ravedutti's avatar Rafael Ravedutti
Browse files

Remove redundant definition of last_id

parent 3fa05468
Branches
No related tags found
No related merge requests found
...@@ -89,14 +89,13 @@ class SetupPBC: ...@@ -89,14 +89,13 @@ class SetupPBC:
npbc.set(0) npbc.set(0)
for d in range(0, ndims): for d in range(0, ndims):
for i in For(sim, 0, nlocal + npbc): for i in For(sim, 0, nlocal + npbc):
#last_id = nlocal + npbc last_id = nlocal + npbc
# TODO: VecFilter? # TODO: VecFilter?
for _ in Filter(sim, positions[i][d] < grid.min(d) + cutneigh): for _ in Filter(sim, positions[i][d] < grid.min(d) + cutneigh):
for capacity_exceeded in Branch(sim, npbc >= pbc_capacity): for capacity_exceeded in Branch(sim, npbc >= pbc_capacity):
if capacity_exceeded: if capacity_exceeded:
resize.set(Select(sim, resize > npbc, resize + 1, npbc)) resize.set(Select(sim, resize > npbc, resize + 1, npbc))
else: else:
last_id = nlocal + npbc
pbc_map[npbc].set(i) pbc_map[npbc].set(i)
pbc_mult[npbc][d].set(1) pbc_mult[npbc][d].set(1)
positions[last_id][d].set(positions[i][d] + grid.length(d)) positions[last_id][d].set(positions[i][d] + grid.length(d))
...@@ -112,7 +111,6 @@ class SetupPBC: ...@@ -112,7 +111,6 @@ class SetupPBC:
if capacity_exceeded: if capacity_exceeded:
resize.set(Select(sim, resize > npbc, resize + 1, npbc)) resize.set(Select(sim, resize > npbc, resize + 1, npbc))
else: else:
last_id = nlocal + npbc
pbc_map[npbc].set(i) pbc_map[npbc].set(i)
pbc_mult[npbc][d].set(-1) pbc_mult[npbc][d].set(-1)
positions[last_id][d].set(positions[i][d] - grid.length(d)) positions[last_id][d].set(positions[i][d] - grid.length(d))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment