예제 #1
0
 def test_add_Mises_strain(self, default):
     t = ['V', 'U'][np.random.randint(0, 2)]
     m = np.random.random() * 2.0 - 1.0
     default.add_strain('F', t, m)
     label = f'epsilon_{t}^{m}(F)'
     default.add_equivalent_Mises(label)
     in_memory = mechanics.equivalent_strain_Mises(default.place(label))
     in_file = default.place(label + '_vM')
     assert np.allclose(in_memory, in_file)
예제 #2
0
 def test_Mises(self):
     """Ensure that equivalent stress is 3/2 of equivalent strain."""
     x = np.random.rand(self.n, 3, 3)
     assert np.allclose(
         mechanics.equivalent_stress_Mises(x) /
         mechanics.equivalent_strain_Mises(x), 1.5)