From: <bao...@us...> - 2006-05-23 08:46:52
|
Revision: 152 Author: baoilleach Date: 2006-05-23 01:46:44 -0700 (Tue, 23 May 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=152&view=rev Log Message: ----------- Converted scfenergies from a.u. to eV for GAMESS and Gaussian, and updated tests. Modified Paths: -------------- trunk/src/cclib/parser/gamessparser.py trunk/src/cclib/parser/gaussianparser.py trunk/test/testGeoOpt.py Modified: trunk/src/cclib/parser/gamessparser.py =================================================================== --- trunk/src/cclib/parser/gamessparser.py 2006-05-23 01:28:46 UTC (rev 151) +++ trunk/src/cclib/parser/gamessparser.py 2006-05-23 08:46:44 UTC (rev 152) @@ -140,7 +140,7 @@ # FINAL ENERGY IS -379.7594673378 AFTER 9 ITERATIONS # ...so take the number after the "IS" temp = line.split() - self.scfenergies.append(float(temp[temp.index("IS")+1])) + self.scfenergies.append(utils.convertor(float(temp[temp.index("IS")+1]),"hartree","eV")) if line.find("MAXIMUM GRADIENT")>0: if not hasattr(self,"geovalues"): Modified: trunk/src/cclib/parser/gaussianparser.py =================================================================== --- trunk/src/cclib/parser/gaussianparser.py 2006-05-23 01:28:46 UTC (rev 151) +++ trunk/src/cclib/parser/gaussianparser.py 2006-05-23 08:46:44 UTC (rev 152) @@ -201,7 +201,7 @@ if not hasattr(self,"scfenergies"): self.logger.info("Creating attribute scfenergies[]") self.scfenergies = [] - self.scfenergies.append(self.float(line.split()[4])) + self.scfenergies.append(utils.convertor(self.float(line.split()[4]),"hartree","eV")) if line[49:59]=='Converged?': # Extract Geometry convergence information Modified: trunk/test/testGeoOpt.py =================================================================== --- trunk/test/testGeoOpt.py 2006-05-23 01:28:46 UTC (rev 151) +++ trunk/test/testGeoOpt.py 2006-05-23 08:46:44 UTC (rev 152) @@ -42,8 +42,8 @@ self.assertEquals(self.data.nbasis,60) def testscfenergy(self): - """Is the SCF energy within 3eV(?) of -382.3?""" - self.assert_(self.data.scfenergies[-1]+382.3<3) + """Is the SCF energy within 40eV of -10365""" + self.assert_(abs(self.data.scfenergies[-1]-(-10365))<40,"Final scf energy: %f not -10365+-40eV" % self.data.scfenergies[-1]) def testnormalisesym(self): """Did this subclasses overwrite normalisesym?""" @@ -91,6 +91,10 @@ """Are atomcoords consistent with geovalues?""" coords = self.data.atomcoords self.assertEquals(len(self.data.geovalues),len(coords)-1,"len(atomcoords)-1 is %d but len(geovalues) is %d" % (len(coords)-1,len(self.data.geovalues))) + + def testscfenergy(self): + """Is the SCF energy within 1eV of -140eV""" + self.assert_(abs(self.data.scfenergies[-1]-(-140))<1,"Final scf energy: %f not -140+-1eV" % self.data.scfenergies[-1]) class JaguarGeoOptTest(GenericGeoOptTest): def setUp(self): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |