Skip to content

Commit

Permalink
minor variable update to compute areas.
Browse files Browse the repository at this point in the history
  • Loading branch information
LyceanEM committed Aug 13, 2024
1 parent 093e719 commit 5d21901
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lyceanem/geometry/geometryfunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def compute_areas(field_data):
- field_data.points[cell.data[:, 0], :],
axis=1,
)
s = (edge1 + edge2 + edge3) / 2
s = (edge1 + edge2 + edge3) / 2.0
areas = (s * (s - edge1) * (s - edge2) * (s - edge3)) ** 0.5
cell_areas.append(areas)
if cell.type == "quad":
Expand Down Expand Up @@ -222,9 +222,9 @@ def compute_areas(field_data):
axis=1,
)

s1 = (edge1 + edge2 + edge3) / 2
s2 = (edge3 + edge4 + edge5) / 2
areas = (s1 * (s1 - edge1) * (s1 - edge2) * (s1 - edge3)) ** 0.5 + (
s1 = (edge1 + edge2 + edge3) / 2.0
s2 = (edge3 + edge4 + edge5) / 2.0
areas = (s1 * ((s1 - edge1) * (s1 - edge2) * (s1 - edge3))) ** 0.5 + (
s2 * (s2 - edge3) * (s2 - edge4) * (s2 - edge5)
) ** 0.5
cell_areas.append(areas)
Expand Down

0 comments on commit 5d21901

Please sign in to comment.