avoid strange deformation gradients

otherwise, the test fails in a few cases (determinants were in the range
1e-5 to 1e16)
This commit is contained in:
Martin Diehl 2020-01-11 23:43:31 +01:00
parent d9afdaed16
commit 97ddd56540
1 changed files with 1 additions and 1 deletions

View File

@ -113,7 +113,7 @@ class TestMechanics:
def test_strain_tensor_rotation_equivalence(self):
"""Ensure that left and right strain differ only by a rotation."""
F = np.random.random((self.n,3,3))
F = np.broadcast_to(np.eye(3),[self.n,3,3]) + (np.random.random((self.n,3,3))*0.5 - 0.25)
m = np.random.random()*5.0-2.5
assert np.allclose(np.linalg.det(mechanics.strain_tensor(F,'U',m)),
np.linalg.det(mechanics.strain_tensor(F,'V',m)))