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) R = mechanics.rotation(F).as_matrix() V = mechanics.stretch_left(F) U = mechanics.stretch_right(F) assert np.allclose(np.matmul(R, U), np.matmul(V, R))
def test_add_stretch_left(self, default): default.add_stretch_tensor('F', 'V') in_memory = mechanics.stretch_left(default.place('F')) in_file = default.place('V(F)') assert np.allclose(in_memory, in_file)