Skip to content

Commit

Permalink
update(_set_neighbors): check for closed iverts and remove closing iv…
Browse files Browse the repository at this point in the history
…ert (#1876)
  • Loading branch information
jlarsen-usgs committed Jul 14, 2023
1 parent e2efcfc commit 9168b3a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions flopy/discretization/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,13 +560,17 @@ def _set_neighbors(self, reset=False, method="rook"):
node_nums = []
if method == "rook":
for poly in self.iverts:
if poly[0] == poly[-1]:
poly = poly[:-1]
for v in range(len(poly)):
geoms.append(tuple(sorted([poly[v - 1], poly[v]])))
node_nums += [node_num] * len(poly)
node_num += 1
else:
# queen neighbors
for poly in self.iverts:
if poly[0] == poly[-1]:
poly = poly[:-1]
for vert in poly:
geoms.append(vert)
node_nums += [node_num] * len(poly)
Expand Down

0 comments on commit 9168b3a

Please sign in to comment.