Skip to content

Commit

Permalink
Ensure no Overflow for get_nodes_with_one_face function
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbhr committed Jan 18, 2024
1 parent 8e2b68d commit 2703e03
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions saenopy/multigrid_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def get_nodes_with_one_face(tetrahedra):
faces = np.sort(np.array(tetrahedra[:, [[0, 1, 2], [0, 1, 3], [0, 2, 3], [1, 2, 3]]]).reshape(-1, 3), axis=1)
# encode the faces as integers
maxi = np.max(faces) + 1
assert maxi<=(np.iinfo(faces.dtype).max)**(1/3)
face_index = faces[:, 0] * maxi ** 2 + faces[:, 1] * maxi ** 1 + faces[:, 2]
# count how often each face is present
face_counts = pd.Series(face_index).value_counts()
Expand Down

0 comments on commit 2703e03

Please sign in to comment.