Auxiliary test methods for angles, dihedrals and impropers in python-numpy
This commit is contained in:
committed by
GitHub
parent
f7ee47f47f
commit
047e4eeebc
@ -51,6 +51,33 @@ class PythonNumpy(unittest.TestCase):
|
|||||||
else:
|
else:
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
def checkAngle(self, vals, atype, aatom1, aatom2, aatom3):
|
||||||
|
set1 = {aatom1, aatom2, aatom3}
|
||||||
|
set2 = {vals[1], vals[2], vals[3]}
|
||||||
|
if len(set1.intersection(set2)) == 3:
|
||||||
|
self.assertEqual(vals[0], atype)
|
||||||
|
return 1
|
||||||
|
else:
|
||||||
|
return 0
|
||||||
|
|
||||||
|
def checkDihedral(self, vals, dtype, datom1, datom2, datom3, datom4):
|
||||||
|
set1 = {datom1, datom2, datom3, datom4}
|
||||||
|
set2 = {vals[1], vals[2], vals[3], vals[4]}
|
||||||
|
if len(set1.intersection(set2)) == 4:
|
||||||
|
self.assertEqual(vals[0], dtype)
|
||||||
|
return 1
|
||||||
|
else:
|
||||||
|
return 0
|
||||||
|
|
||||||
|
def checkImproper(self, vals, itype, iatom1, iatom2, iatom3, iatom4):
|
||||||
|
set1 = {iatom1, iatom2, iatom3, iatom4}
|
||||||
|
set2 = {vals[1], vals[2], vals[3], vals[4]}
|
||||||
|
if len(set1.intersection(set2)) == 4:
|
||||||
|
self.assertEqual(vals[0], itype)
|
||||||
|
return 1
|
||||||
|
else:
|
||||||
|
return 0
|
||||||
|
|
||||||
def testLammpsPointer(self):
|
def testLammpsPointer(self):
|
||||||
self.assertEqual(type(self.lmp.lmp), c_void_p)
|
self.assertEqual(type(self.lmp.lmp), c_void_p)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user