Skip to content

Commit

Permalink
check that abs(gaugeno) < 2**31 in data.py
Browse files Browse the repository at this point in the history
  • Loading branch information
rjleveque committed May 30, 2024
1 parent 545c052 commit 447f6ad
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/python/amrclaw/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,12 @@ def write(self, num_eqn, num_aux, out_file='gauges.data',
if len(self.gauge_numbers) != len(set(self.gauge_numbers)):
raise Exception("Non unique gauge numbers specified.")

for gaugeno in self.gauge_numbers:
if abs(gaugeno) >= 2**31:
raise Exception("Gauge number %i is too large, must be < 2**31"\
% gaugeno)


# Write out gauge data file
self.open_data_file(out_file,data_source)
self.data_write(name='ngauges',value=len(self.gauges))
Expand Down

0 comments on commit 447f6ad

Please sign in to comment.