Skip to content

Commit

Permalink
Merge pull request #730 from ketch/fix_gauge_index
Browse files Browse the repository at this point in the history
Correctly use the floor instead of rounding to determine gauge cell index
  • Loading branch information
mandli authored Oct 4, 2024
2 parents 22403c8 + a499555 commit 1df8ef6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pyclaw/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ def add_gauges(self,gauge_coords):
# Check if gauge belongs to this grid:
if all(self.lower[n]<=gauge[n]<self.upper[n] for n in range(self.num_dim)):
# Set indices relative to this grid
gauge_index = [int(round((gauge[n]-self.lower[n])/self.delta[n]))
gauge_index = [int((gauge[n]-self.lower[n])//self.delta[n]))
for n in range(self.num_dim)]
gauge_file_name = 'gauge'+'_'.join(str(coord) for coord in gauge)+'.txt'
self.gauge_file_names.append(gauge_file_name)
Expand Down

0 comments on commit 1df8ef6

Please sign in to comment.