Skip to content

Commit fc7ee87

Browse files
committed
Handle edge cases
1 parent 23b9e26 commit fc7ee87

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/physics/stress.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ function von_mises_stress(σ)
44
a = σx * σx + σy * σy + σz * σz
55
b = - σx * σy - σx * σz - σy * σz
66
c = 3 * (τxy * τxy + τxz * τxz + τyz * τyz)
7-
σvm = (a + b + c)
7+
d = a + b + c
8+
d < 0 && return zero(eltype(σ))
9+
σvm = d
810
return σvm
911
end
1012

0 commit comments

Comments
 (0)