Пример #1
0
 def perturb(self, entry, unperturb=False):
     """
     Perturb E0 of `entry` which could be either a :class:TransitionState or a :class:Configuration
     In the latter case, only the first species in the Configuration.species list is perturbed.
     The perturbation is done by addition of the energy amount in self.perturbation.
     If unperturb is `False`, the perturbation is addition of the energy amount in self.perturbation.
     If unperturb is `False`, this is done by subtracting.
     """
     perturbation = self.perturbation.value_si
     if unperturb:
         perturbation *= -1
     if isinstance(entry, TransitionState):
         entry.conformer.E0 = quantity.Energy(entry.conformer.E0.value_si + perturbation, 'J/mol')
     elif isinstance(entry, Configuration):
         entry.species[0].conformer.E0 = quantity.Energy(entry.species[0].conformer.E0.value_si + perturbation,
                                                         'J/mol')
Пример #2
0
 def test_Kelvin(self):
     """
     Test the creation of an energy quantity with units of K (not really an energy!).
     """
     q = quantity.Energy(10.0, "K")
     self.assertAlmostEqual(q.value, 10 * 8.314472, delta=1e-6)
     self.assertEqual(q.units, "J/mol")
Пример #3
0
 def test_kcalpermol(self):
     """
     Test the creation of an energy quantity with units of kcal/mol.
     """
     q = quantity.Energy(1.0, "kcal/mol")
     self.assertAlmostEqual(q.value, 1.0, 6)
     self.assertAlmostEqual(q.value_si, 4184., delta=1e-6)
     self.assertEqual(q.units, "kcal/mol")
Пример #4
0
 def test_joule_per_mol(self):
     """
     Test the creation of an energy quantity with units of J/mol.
     """
     q = quantity.Energy(1.0, "J/mol")
     self.assertAlmostEqual(q.value, 1.0, 6)
     self.assertAlmostEqual(q.value_si, 1.0, delta=1e-6)
     self.assertEqual(q.units, "J/mol")
Пример #5
0
 def test_kcal(self):
     """
     Test the creation of an energy quantity with units of kcal.
     """
     try:
         q = quantity.Energy(1.0, "kcal")
         self.fail('Allowed invalid unit type "kcal".')
     except quantity.QuantityError:
         pass
Пример #6
0
 def test_joule(self):
     """
     Test the creation of an energy quantity with units of J.
     """
     try:
         quantity.Energy(1.0, "J")
         self.fail('Allowed invalid unit type "J".')
     except quantity.QuantityError:
         pass
Пример #7
0
 def maximum_grain_size(self, value):
     self._maximum_grain_size = quantity.Energy(value)
Пример #8
0
 def maximumGrainSize(self, value):
     self._maximumGrainSize = quantity.Energy(value)