Skip to content

Commit a499555

Browse files
committed
Correctly use the floor instead of rounding to determine gauge cell index.
1 parent 1d7ba17 commit a499555

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/pyclaw/geometry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ def add_gauges(self,gauge_coords):
398398
# Check if gauge belongs to this grid:
399399
if all(self.lower[n]<=gauge[n]<self.upper[n] for n in range(self.num_dim)):
400400
# Set indices relative to this grid
401-
gauge_index = [int(round((gauge[n]-self.lower[n])/self.delta[n]))
401+
gauge_index = [int((gauge[n]-self.lower[n])//self.delta[n]))
402402
for n in range(self.num_dim)]
403403
gauge_file_name = 'gauge'+'_'.join(str(coord) for coord in gauge)+'.txt'
404404
self.gauge_file_names.append(gauge_file_name)

0 commit comments

Comments
 (0)