Exemplo n.º 1
0
 def test_UtilsInertiaCheckAllRotConstUnits(self):
     from opan.utils.inertia import rot_consts
     from opan.const import EnumUnitsRotConst as EURC
     for (u, a) in [(u, rot_consts(self.xyz.geoms[0],
                 self.hess.atom_masses, units=u)) for u in EURC]:
         for i in range(a.shape[0]):
             self.assertAlmostEqual(self.rc_units[u][i] / a[i], 1.0,
                     delta=1e-3,
                     msg="Rotational constant units '" + str(u) +
                                             ",' index '" + str(i) + "'")
Exemplo n.º 2
0
 def test_rot_consts(self):
     import opan.utils.inertia as oui
     from opan.const import PRM, EnumUnitsRotConst as EURC
     rc = oui.rot_consts(self.xyz.geoms[0], self.hess.atom_masses,
                                                         EURC.INV_INERTIA)
     for i in range(rc.shape[0]):
         if rc[i] >= 1/(2.0*PRM.ZERO_MOMENT_TOL):
             self.assertAlmostEqual(self.rc[i], rc[i],
                     delta=1.0,
                     msg="Rotational constant index '" + str(i) + "'")
         else:
             self.assertAlmostEqual(self.rc[i] / rc[i], 1.0,
                     delta=PRM.EQUAL_MOMENT_TOL,
                     msg="Rotational constant index '" + str(i) + "'")