Browse Source

fix crash in shifted_exyz

master
Jan Petykiewicz 9 months ago
parent
commit
a900946890
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      gridlock/grid.py
  2. +1
    -1
      gridlock/position.py

+ 1
- 1
gridlock/grid.py View File

@@ -139,7 +139,7 @@ class Grid(object):
# If shift is negative, use left cell's dx to determine shift
for a in range(3):
if shifts[a] < 0:
dxyz[a] = numpy.roll(dxyz, 1)
dxyz[a] = numpy.roll(dxyz[a], 1)

return [self.exyz[a] + dxyz[a] * shifts[a] for a in range(3)]



+ 1
- 1
gridlock/position.py View File

@@ -99,7 +99,7 @@ def pos2ind(self,
x = self.shifted_xyz(which_shifts)[a][xi]
dx = self.shifted_dxyz(which_shifts)[a][xi]
f = (r[a] - x) / dx
# Clip to centers
grid_pos[a] = numpy.clip(xi + f, 0, self.shape[a] - 1)
return grid_pos

Loading…
Cancel
Save