From: <bao...@us...> - 2006-05-22 15:10:57
|
Revision: 145 Author: baoilleach Date: 2006-05-22 08:10:43 -0700 (Mon, 22 May 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=145&view=rev Log Message: ----------- Finished looking at atomcoords. It turns out that for some bizarre reason ADF has an extra geometry in it compared to geovalues. I have verified using alignment RMS (Biopython) that each geometry is in fact unique, and not just a rotation/translation. Modified Paths: -------------- trunk/src/cclib/parser/gamessparser.py trunk/test/testGeoOpt.py Modified: trunk/src/cclib/parser/gamessparser.py =================================================================== --- trunk/src/cclib/parser/gamessparser.py 2006-05-22 13:09:51 UTC (rev 144) +++ trunk/src/cclib/parser/gamessparser.py 2006-05-22 15:10:43 UTC (rev 145) @@ -105,6 +105,7 @@ firststdorient = True # Used to decide whether to wipe the atomcoords clean + geooptfinished = False # Used to avoid extracting the final geometry twice for line in inputfile: @@ -173,7 +174,11 @@ self.atomnos = Numeric.array(atomnos,"i") self.atomcoords.append(atomcoords) - if line[1:29]=="COORDINATES OF ALL ATOMS ARE": + if line[12:40]=="EQUILIBRIUM GEOMETRY LOCATED": + # Prevent extraction of the final geometry twice + geooptfinished = True + + if line[1:29]=="COORDINATES OF ALL ATOMS ARE" and not geooptfinished: # This is the standard orientation, which is the only coordinate # information available for all geometry optimisation cycles. # The input orientation will be overwritten if this is a geometry optimisation Modified: trunk/test/testGeoOpt.py =================================================================== --- trunk/test/testGeoOpt.py 2006-05-22 13:09:51 UTC (rev 144) +++ trunk/test/testGeoOpt.py 2006-05-22 15:10:43 UTC (rev 145) @@ -12,10 +12,10 @@ self.assertEquals(self.data.homos,array([34])) def testatomcoords(self): - """Are atomcoords consistent with natom, Angstroms and geovalues?""" + """Are atomcoords consistent with natom and Angstroms?""" coords = self.data.atomcoords self.assertEquals(self.data.natom,len(coords[0]),"len(atomcoords[0]) is %d but natom is %d" % (self.data.natom,len(coords[0]))) - 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))) + # Find the minimum distance between two C atoms mindist = 999 for i in range(self.data.natom-1): @@ -26,6 +26,12 @@ dist = math.sqrt(sum((coords[-1][i]-coords[-1][j])**2)) mindist = min(mindist,dist) self.assert_(abs(mindist-1.34)<0.03,"Mindist is %f (not 1.34)" % mindist) + + def testatomcoords_more(self): + """Are atomcoords consistent with geovalues?""" + coords = self.data.atomcoords + self.assertEquals(len(self.data.geovalues),len(coords),"len(atomcoords) is %d but len(geovalues) is %d" % (len(coords),len(self.data.geovalues))) + def testnatom(self): """Is the number of atoms equal to 20?""" @@ -81,6 +87,11 @@ ADF calculations one more SCF cycle after the geometry is converged""" self.assert_(len(self.data.scfvalues)==len(self.data.geovalues)+1 and len(self.data.scfvalues[0])==len(self.data.scftargets)) + def testatomcoords_more(self): + """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))) + class JaguarGeoOptTest(GenericGeoOptTest): def setUp(self): self.data = getfile(Jaguar,"basicJaguar","eg01","dvb_gopt.out") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |