Skip to content

Commit b049ac4

Browse files
authored
Add correct fix for gauge index rounding (#732)
1 parent 4a47d63 commit b049ac4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/pyclaw/geometry.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
r"""
1+
"""
22
Module defining Pyclaw geometry objects.
33
"""
44

@@ -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)