From: <bao...@us...> - 2006-05-13 21:06:04
|
Revision: 118 Author: baoilleach Date: 2006-05-13 14:05:51 -0700 (Sat, 13 May 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=118&view=rev Log Message: ----------- Based on the new dvb_gopt_b.adfout I've corrected the adfparser, but the results are still strange and I'm planning to post a question to the ADF users' forum. Modified Paths: -------------- trunk/src/cclib/parser/adfparser.py trunk/test/testGeoOpt.py Modified: trunk/src/cclib/parser/adfparser.py =================================================================== --- trunk/src/cclib/parser/adfparser.py 2006-05-13 18:48:19 UTC (rev 117) +++ trunk/src/cclib/parser/adfparser.py 2006-05-13 21:05:51 UTC (rev 118) @@ -25,6 +25,7 @@ class ADF(Logfile): """An ADF log file""" SCFCNV,SCFCNV2 = range(2) #used to index self.scftargets[] + maxelem,norm = range(2) # used to index scf.values def __init__(self,*args): # Call the __init__ method of the superclass @@ -139,9 +140,8 @@ 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]) + self.scftargets[ADF.maxelem] = float(line.split()[2]) + self.scftargets[ADF.norm] = self.scftargets[ADF.maxelem]*10 if line[1:11]=="CYCLE 1": @@ -151,29 +151,24 @@ 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 ] + newlist = [] line=inputfile.next() while line.find("SCF CONVERGED")==-1: + if line[4:12]=="SCF test": + if not hasattr(self,"scfvalues"): + self.logger.info("Creating attribute scfvalues") + self.scfvalues = [] + + info = line.split() + newlist.append([float(info[4]),abs(float(info[6]))]) + try: + line=inputfile.next() + except StopIteration: #EOF reached? + break - 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 hasattr(self,"scfvalues"): + self.scfvalues.append(newlist) # if line[1:10]=='Cycle 1': # # Extract SCF convergence information (QM calcs) Modified: trunk/test/testGeoOpt.py =================================================================== --- trunk/test/testGeoOpt.py 2006-05-13 18:48:19 UTC (rev 117) +++ trunk/test/testGeoOpt.py 2006-05-13 21:05:51 UTC (rev 118) @@ -55,7 +55,7 @@ class ADFGeoOptTest(GenericGeoOptTest): def setUp(self): - self.data = getfile(ADF,"basicADF2004.01","dvb_gopt.adfout") + self.data = getfile(ADF,"basicADF2004.01","dvb_gopt_b.adfout") def testscfvaluedim(self): """Do the scf values have the right dimensions? This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |