Esempio n. 1
0
 def test_normal(self, vec1, vec2, value):
     assert_equal(mdamath.normal(vec1, vec2), value)
Esempio n. 2
0
 def testNormalNullVector(self):
     assert_equal(mdamath.normal(self.e1, self.null), 0.0)
Esempio n. 3
0
 def testNormal(self):
     assert_equal(mdamath.normal(self.e1, self.e2), self.e3)
fout = open(folder + 'cationpi.dat', 'w')
for ts in u.trajectory:
    sys.stdout.write('\rTime = %d' % u.trajectory.time)
    boxvec = mdamath.triclinic_vectors(u.dimensions)
    for ipi in range(npigroup):
        pigroup = pigroups[ipi]
        picenter = pigroup.centroid(pbc=True)
        for icat in range(ncat):
            cation = cations[icat]
            dist = distances.calc_bonds(coords1=cation.position,
                                        coords2=picenter,
                                        box=u.dimensions)
            if dist < 7.0:
                vec = vector(cation.position, picenter, boxvec)
                v1 = vector(pigroup.positions[0], pigroup.positions[5], boxvec)
                v2 = vector(pigroup.positions[1], pigroup.positions[4], boxvec)
                v3 = vector(pigroup.positions[2], pigroup.positions[3], boxvec)
                n1 = mdamath.normal(v1, v2)
                n2 = mdamath.normal(v3, v1)
                n3 = mdamath.normal(v3, v2)
                n = (n1 + n2 + n3)
                angle = np.degrees(mdamath.angle(n, vec))
                if angle > 120 or angle < 60:
                    fout.write(
                        '%.1f %d %s %d %s %.6f %.6f\n' %
                        (u.trajectory.time, catresid[icat], catresname[icat],
                         piresid[ipi], piresname[ipi], angle, dist))

sys.stdout.write('\n')
fout.close()
Esempio n. 5
0
 def testNormalNullVector(self):
     assert_equal(mdamath.normal(self.e1, self.null), 0.0)
Esempio n. 6
0
 def testNormal(self):
     assert_equal(mdamath.normal(self.e1, self.e2), self.e3)