Exemple #1
0
    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
Exemple #2
0
    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
Exemple #3
0
    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)))
Exemple #4
0
    def test_foliation_product_operator(self):
        f1, f2 = Fol.rand(), Fol.rand()

        assert f1.cross(f2) == f1**f2
Exemple #5
0
    def test_mutual_rotation(self):
        f1, f2 = Fol.rand(), Fol.rand()

        assert f1.transform(f1.H(f2)) == f2
Exemple #6
0
    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])
Exemple #7
0
    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])
Exemple #8
0
 def test_scalar_product(self):
     fol = Fol.rand()
     assert np.allclose(fol * fol, 1)
Exemple #9
0
 def test_equality_for_oposite_dir(self):
     fol = Fol.rand()
     assert fol == -fol
Exemple #10
0
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)
Exemple #11
0
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)
Exemple #12
0
    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)))