test deviatoric part for known analytic solution

This commit is contained in:
Martin Diehl 2020-04-22 09:16:53 +02:00
parent 53b8c1c893
commit 3621dddd66
1 changed files with 5 additions and 0 deletions

View File

@ -49,6 +49,11 @@ class TestMechanics:
assert np.allclose(mechanics.Cauchy(P,np.broadcast_to(np.eye(3),(self.n,3,3))),
mechanics.symmetric(P))
def test_deviatoric_part(self):
I_n = np.broadcast_to(np.eye(3),(self.n,3,3))
r = np.logical_not(I_n)*np.random.rand(self.n,3,3)
assert np.allclose(mechanics.deviatoric_part(I_n+r),r)
def test_polar_decomposition(self):
"""F = RU = VR."""
F = np.broadcast_to(np.eye(3),[self.n,3,3])*np.random.rand(self.n,3,3)