Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update(_set_neighbors): check for closed iverts and remove closing ivert #1876

Merged
merged 1 commit into from
Jul 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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