def test_angle_under_rotation(self): f1, f2 = Fol.rand(), Fol.rand() D = DefGrad.from_axis(Lin(45, 45), 60) assert np.allclose(f1.angle(f2), f1.transform(D).angle(f2.transform(D)))
def test_transform_method(self, x, y, z): F = DefGrad.from_axis(z, 90) current = x.transform(F) expects = y assert current == expects
def test_angle_under_rotation(self): l1, l2 = Lin.rand(), Lin.rand() D = DefGrad.from_axis(Lin(45, 45), 60) assert np.allclose(l1.angle(l2), l1.transform(D).angle(l2.transform(D)))
def test_orthogonality_rotation_matrix(): lin = Lin.rand() a = np.random.randint(180) R = DefGrad.from_axis(lin, a) assert np.allclose(R * R.T, np.eye(3))
def test_mutual_rotation(self, x, y, z): current = x.H(y) expects = DefGrad.from_axis(z, 90) assert current == expects
def test_velgrad_integration(): F = DefGrad.from_comp(xx=2, zz=0.5) L = VelGrad.from_comp(xx=np.log(2), zz=-np.log(2)) L.defgrad() == F
def test_defgrad_derivation(): F = DefGrad.from_comp(xx=2, zz=0.5) L = VelGrad.from_comp(xx=np.log(2), zz=-np.log(2)) F.velgrad() == L