def test_stress_component(): S = Stress.from_comp(xx=2, yy=2, zz=1, xy=1, xz=3, yz=-2) n = Vec3([1, 2, -2]).uv sn, tau = S.stress_comp(n) assert np.allclose( [abs(sn), abs(tau)], [abs(S.normal_stress(n)), S.shear_stress(n)])
def test_stress_invariants_under_rotation(): S = Stress.from_comp(xx=4, yy=6, zz=8, xy=1, xz=2) lin = Lin.rand() a = np.random.randint(180) Sr = S.rotate(lin, a) assert np.allclose([S.I1, S.I2, S.I3], [Sr.I1, Sr.I2, Sr.I3])
def test_stress_invariants_calculation(): S = Stress.from_comp(xx=4, yy=6, zz=8, xy=1, xz=2) assert np.allclose([S.I1, S.I2, S.I3], [18, 99, 160])
def test_stress_component(): S = Stress.from_comp(xx=2, yy=2, zz=1, xy=1, xz=3, yz=-2) n = Vec3([1, 2, -2]).uv sn, tau = S.stress_comp(n) assert np.allclose([abs(sn), abs(tau)], [abs(S.normal_stress(n)), S.shear_stress(n)])