Skip to content

Commit

Permalink
no zero node indices
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhassell committed Feb 29, 2024
1 parent e118912 commit d63b11b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cf/regrid/regrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -1707,6 +1707,12 @@ def create_esmpy_mesh(grid, mask=None):
node_count = node_ids.size
node_owners = np.zeros(node_count)

# Make sure that node IDs are >= 1, as needed by newer versions of
# esmpy
min_id = node_ids.min()
if min_id < 1:
node_ids += min_id + 1

# Add nodes. This must be done before `add_elements`.
esmpy_mesh.add_nodes(
node_count=node_count,
Expand Down

0 comments on commit d63b11b

Please sign in to comment.