Esempio n. 1
0
    def testBadInput(self):
        """Asserts raise of ValueError for missing string input."""
        with self.assertRaises(ValueError) as e:
            param.GetMass('AA')

        self.assertEqual(str(e.exception),
                         'No atomic mass found for element: AA')
Esempio n. 2
0
    def __init__(self, type_, coords, charge, ro=None, eps=None):
        self.SetType(type_)
        self.SetCoords(coords)
        self.SetCharge(charge)

        if ro == None or eps == None:
            ro, eps = param.GetVdwParam(self.type_)
        self.SetRo(ro)
        self.SetEps(eps)

        self.SetElement(param.GetElement(type_))
        self.SetMass(param.GetMass(self.element))
        self.SetCovRad(param.GetCovRad(self.element))

        self.SetVels(numpy.zeros(const.NUMDIM))
        self.SetAccs(numpy.zeros(const.NUMDIM))
        self.SetPVels(numpy.zeros(const.NUMDIM))
        self.SetPAccs(numpy.zeros(const.NUMDIM))
Esempio n. 3
0
 def testHeaviestAtom(self):
     """Asserts correct mass for heaviest present atom."""
     self.assertEqual(param.GetMass('Kr'), 83.7980)
Esempio n. 4
0
 def testHydrogen(self):
     """Asserts correct mass for hydrogen atom."""
     self.assertEqual(param.GetMass('H'), 1.00794)
Esempio n. 5
0
 def testDummyInput(self):
     """Asserts zero mass for dummy atom input."""
     self.assertEqual(param.GetMass('X'), 0.0)