Ejemplo n.º 1
0
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)])
Ejemplo n.º 2
0
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])
Ejemplo n.º 3
0
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])
Ejemplo n.º 4
0
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])
Ejemplo n.º 5
0
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])
Ejemplo n.º 6
0
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)])