@@ -17,7 +17,7 @@ class GaussianTest(unittest.TestCase):
1717 and writing Gaussian files.
1818 """
1919
20- def testLoadEthyleneFromGaussianLog (self ):
20+ def testLoadEthyleneFromGaussianLog_CBSQB3 (self ):
2121 """
2222 Uses a Gaussian03 log file for ethylene (C2H4) to test that its
2323 molecular degrees of freedom can be properly read.
@@ -71,5 +71,33 @@ def testLoadOxygenFromGaussianLog(self):
7171 self .assertEqual (conformer .spinMultiplicity , 3 )
7272 self .assertEqual (conformer .opticalIsomers , 1 )
7373
74+ def testLoadEthyleneFromGaussianLog_G3 (self ):
75+ """
76+ Uses a Gaussian03 log file for ethylene (C2H4) to test that its
77+ molecular degrees of freedom can be properly read.
78+ """
79+
80+ log = GaussianLog (os .path .join (os .path .dirname (__file__ ),'test' ,'ethylene_G3.log' ))
81+ conformer = log .loadConformer ()
82+ E0 = log .loadEnergy ()
83+
84+ self .assertTrue (len ([mode for mode in conformer .modes if isinstance (mode ,IdealGasTranslation )]) == 1 )
85+ self .assertTrue (len ([mode for mode in conformer .modes if isinstance (mode ,NonlinearRotor )]) == 1 )
86+ self .assertTrue (len ([mode for mode in conformer .modes if isinstance (mode ,HarmonicOscillator )]) == 1 )
87+ self .assertTrue (len ([mode for mode in conformer .modes if isinstance (mode ,HinderedRotor )]) == 0 )
88+
89+ trans = [mode for mode in conformer .modes if isinstance (mode ,IdealGasTranslation )][0 ]
90+ rot = [mode for mode in conformer .modes if isinstance (mode ,NonlinearRotor )][0 ]
91+ vib = [mode for mode in conformer .modes if isinstance (mode ,HarmonicOscillator )][0 ]
92+ Tlist = numpy .array ([298.15 ], numpy .float64 )
93+
94+ self .assertAlmostEqual (trans .getPartitionFunction (Tlist ), 5.83338e6 , delta = 1e1 )
95+ self .assertAlmostEqual (rot .getPartitionFunction (Tlist ), 2.53410e3 , delta = 1e-2 )
96+ self .assertAlmostEqual (vib .getPartitionFunction (Tlist ), 1.0304e0 , delta = 1e-4 )
97+
98+ self .assertAlmostEqual (E0 / constants .Na / constants .E_h , - 78.562189 , 4 )
99+ self .assertEqual (conformer .spinMultiplicity , 1 )
100+ self .assertEqual (conformer .opticalIsomers , 1 )
101+
74102if __name__ == '__main__' :
75103 unittest .main ( testRunner = unittest .TextTestRunner (verbosity = 2 ) )
0 commit comments