def test_sub_operator__simple(self): f1, f2 = Fol.rand(), Fol.rand() assert f1 - f2 == f1 - (-f2) # Anyway, axial sub is commutative. assert f1 - f2 == f2 - f1
def test_add_operator__simple(self): f1, f2 = Fol.rand(), Fol.rand() assert f1 + f2 == f1 + (-f2) # Anyway, axial add is commutative. assert f1 + f2 == f2 + f1
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_foliation_product_operator(self): f1, f2 = Fol.rand(), Fol.rand() assert f1.cross(f2) == f1**f2
def test_mutual_rotation(self): f1, f2 = Fol.rand(), Fol.rand() assert f1.transform(f1.H(f2)) == f2
def test_cross_product(self): f1, f2 = Fol.rand(), Fol.rand() p = f1**f2 assert np.allclose([p.angle(f1), p.angle(f2)], [90, 90])
def test_foliation_product(self): f1, f2 = Fol.rand(), Fol.rand() p = f1.cross(f2) assert np.allclose([p.angle(f1), p.angle(f2)], [90, 90])
def test_scalar_product(self): fol = Fol.rand() assert np.allclose(fol * fol, 1)
def test_equality_for_oposite_dir(self): fol = Fol.rand() assert fol == -fol
def test_ortensor_uniform(): f = Fol.rand() assert np.allclose( Ortensor.from_group(Group([f.V, f.rake(-45), f.rake(45)]))._evals, np.ones(3) / 3)
def test_ortensor_uniform(): f = Fol.rand() assert np.allclose(Ortensor.from_group(Group([f.V, f.rake(-45), f.rake(45)]))._evals, np.ones(3) / 3)