From 97ddd56540d82bdad9c12a1ba6c166423928b5fb Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 11 Jan 2020 23:43:31 +0100 Subject: [PATCH] avoid strange deformation gradients otherwise, the test fails in a few cases (determinants were in the range 1e-5 to 1e16) --- python/tests/test_mechanics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/tests/test_mechanics.py b/python/tests/test_mechanics.py index 1ea1f2bba..9e1d9bc0c 100644 --- a/python/tests/test_mechanics.py +++ b/python/tests/test_mechanics.py @@ -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)))