コード例 #1
0
 def test_symmetry1(self):
     for i in range(self.nrep):
         n = random.randint(0, 1000)
         v = Velocity(dim=3, num=n)
         vs = v.get_symmetric().get_symmetric()
         assert (vs.vx == v.vx and vs.vy == v.vy and vs.vz == v.vz
                 and vs.num == v.num)
コード例 #2
0
 def test_symmetry3(self):
     for i in range(self.nrep):
         n = random.randint(0, 1000)
         v = Velocity(dim=2, num=n)
         vs = v.get_symmetric(axis=0).get_symmetric(axis=1)
         vs = vs.get_symmetric(axis=0).get_symmetric(axis=1)
         assert (vs.vx == v.vx and vs.vy == v.vy and vs.num == v.num)
コード例 #3
0
 def test_symmetry5(self):
     v = Velocity(dim=2, num=0)
     vs = v.get_symmetric(axis=2).get_symmetric(axis=2)
コード例 #4
0
 def test_symmetry4(self):
     for n, sn in zip(self.num, self.snum):
         v = Velocity(dim=2, num=n)
         vs = v.get_symmetric()
         assert (vs.num == sn)
コード例 #5
0
def test_velocity_argument():
    Velocity()
コード例 #6
0
 def test_with_v(self):
     for n, vx, vy in zip(self.num, self.vx, self.vy):
         v = Velocity(vx=vx, vy=vy)
         assert (v.num == n and v.dim == 2)
コード例 #7
0
 def test_with_num(self):
     for n, vx, vy in zip(self.num, self.vx, self.vy):
         v = Velocity(dim=2, num=n)
         assert (v.vx == vx and v.vy == vy)
コード例 #8
0
 def test_symmetry3(self):
     v = Velocity(dim=1, num=random.randint(0, 1000))
     vs = v.get_symmetric(axis=1).get_symmetric(axis=1)
コード例 #9
0
 def test_symmetry2(self):
     v = Velocity(dim=1, num=random.randint(0, 1000))
     vs = v.get_symmetric(axis=0).get_symmetric(axis=0)
     assert (vs.vx == v.vx and vs.num == v.num)
コード例 #10
0
 def test_with_vx(self):
     for n, vx in zip(self.num, self.vx):
         v = Velocity(vx=vx)
         assert (v.num == n and v.dim == 1)
コード例 #11
0
 def test_with_num(self):
     for n, vx in zip(self.num, self.vx):
         v = Velocity(dim=1, num=n)
         assert (v.vx == vx)
コード例 #12
0
 def test_with_v(self):
     for n, vx, vy, vz in zip(self.num, self.vx, self.vy, self.vz):
         v = Velocity(vx=vx, vy=vy, vz=vz)
         assert (v.num == n and v.dim == 3)
コード例 #13
0
 def test_with_num(self):
     for n, vx, vy, vz in zip(self.num, self.vx, self.vy, self.vz):
         v = Velocity(dim=3, num=n)
         assert (v.vx == vx and v.vy == vy and v.vz == vz)