From: <ate...@us...> - 2006-05-01 21:04:00
|
Revision: 96 Author: atenderholt Date: 2006-05-01 14:03:55 -0700 (Mon, 01 May 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=96&view=rev Log Message: ----------- SVN targets in the ADF parser Fixed the ADF unittest because ADF does one more scf cycle after the geometry is converged Modified Paths: -------------- trunk/src/cclib/parser/adfparser.py trunk/test/testall.py Modified: trunk/src/cclib/parser/adfparser.py =================================================================== --- trunk/src/cclib/parser/adfparser.py 2006-04-26 01:43:39 UTC (rev 95) +++ trunk/src/cclib/parser/adfparser.py 2006-05-01 21:03:55 UTC (rev 96) @@ -24,7 +24,8 @@ class ADF(Logfile): """A Gaussian 98/03 log file""" - SCFRMS,SCFMAX,SCFENERGY = range(3) # Used to index self.scftargets[] + #SCFRMS,SCFMAX,SCFENERGY = range(3) # Used to index self.scftargets[] + SCFCNV,SCFCNV2 = range(2) #used to index self.scftargets[] def __init__(self,*args): # Call the __init__ method of the superclass @@ -128,17 +129,53 @@ self.natom=len(self.atomnos) self.logger.info("Creating attribute natom: %d" % self.natom) -# if line[1:44]=='Requested convergence on RMS density matrix': -# # Find the targets for SCF convergence (QM calcs) -# if not hasattr(self,"scftargets"): -# self.logger.info("Creating attribute scftargets[]") -# self.scftargets = Numeric.array([0.0,0.0,0.0],'f') -# self.scftargets[G03.SCFRMS] = self.float(line.split('=')[1].split()[0]) -# if line[1:44]=='Requested convergence on MAX density matrix': -# self.scftargets[G03.SCFMAX] = self.float(line.strip().split('=')[1][:-1]) -# if line[1:44]=='Requested convergence on energy': -# self.scftargets[G03.SCFENERGY] = self.float(line.strip().split('=')[1][:-1]) -# + if line[1:22]=="S C F U P D A T E S": +# find targets for SCF convergence (QM calcs) + + if not hasattr(self,"scftargets"): + self.logger.info("Creating attribute scftargets[]") + self.scftargets = Numeric.array([0.0, 0.0],'f') + + #underline, blank, nr + for i in range(3): inputfile.next() + + line=inputfile.next() + self.scftargets[ADF.SCFCNV]=float(line.split()[2]) + line=inputfile.next() + self.scftargets[ADF.SCFCNV2]=float(line.split()[2]) + + if line[1:11]=="CYCLE 1": + + if self.progress and random.random() < fupdate: + step=inputfile.tell() + if step!=oldstep: + self.progress.update(step, "QM Convergence") + oldstep=step + + if not hasattr(self,"scfvalues"): + self.logger.info("Creating attribute scfvalues") + self.scfvalues = [] + + newlist = [ [] for x in self.scftargets ] + line=inputfile.next() + + while line.find("SCF CONVERGED")==-1: + + if line[1:7]=="d-Pmat": + info=line.split() + newlist[ADF.SCFCNV].append(float(info[2])) + + line=inputfile.next() + info=line.split() + newlist[ADF.SCFCNV2].append(float(info[2])) + + try: + line=inputfile.next() + except StopIteration: #EOF reached? + break + + self.scfvalues.append(newlist) + # if line[1:10]=='Cycle 1': # # Extract SCF convergence information (QM calcs) # if self.progress and random.random()<fupdate: Modified: trunk/test/testall.py =================================================================== --- trunk/test/testall.py 2006-04-26 01:43:39 UTC (rev 95) +++ trunk/test/testall.py 2006-05-01 21:03:55 UTC (rev 96) @@ -56,6 +56,11 @@ def setUp(self): self.data = getfile(ADF,"basicADF2004.01","dvb_gopt.adfout") + def testscfvaluedim(self): + """Do the scf values have the right dimensions? + 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)) + 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. |