From: <ate...@us...> - 2006-03-26 20:14:36
|
Revision: 41 Author: atenderholt Date: 2006-03-26 12:14:33 -0800 (Sun, 26 Mar 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=41&view=rev Log Message: ----------- parse moenergies,mosyms (only restricted calcs) Modified Paths: -------------- trunk/src/cclib/parser/adfparser.py Modified: trunk/src/cclib/parser/adfparser.py =================================================================== --- trunk/src/cclib/parser/adfparser.py 2006-03-22 22:57:48 UTC (rev 40) +++ trunk/src/cclib/parser/adfparser.py 2006-03-26 20:14:33 UTC (rev 41) @@ -61,17 +61,19 @@ if line.find("INPUT FILE")>=0: #check to make sure we aren't parsing Create jobs - line2=inputfile.next() while line: - if line.find("Create")<0: - break + if line.find("INPUT FILE")>=0: + line2=inputfile.next() + if line2.find("Create")<0: + break if self.progress and random.random()<cupdate: - step=inputfile.tell() - if step!=oldstep: - self.progress.update(step,"Unsupported Information") - oldstep=step + step=inputfile.tell() + if step!=oldstep: + self.progress.update(step,"Unsupported Information") + oldstep=step + line=inputfile.next() if line[1:6]=="ATOMS": # Find the number of atoms and their atomic numbers @@ -188,6 +190,28 @@ # self.geotargets[i] = self.float(parts[3]) # self.geovalues.append(newlist) # + if line[1:29]=='Orbital Energies, all Irreps' and not hasattr(self,"mosyms"): +#Extracting orbital symmetries and energies + self.logger.info("Creating attribute mosyms[[]]") + self.mosyms=[[]] + + self.logger.info("Creating attribute moenergies[[]]") + self.moenergies=[[]] + + underline=inputfile.next() + blank=inputfile.next() + header=inputfile.next() + underline2=inputfile.next() + line=inputfile.next() + + while len(line)>1: + info=line.split() + if len(info)==5: #this is restricted + self.mosyms[0].append(info[0]) + self.moenergies[0].append(convertor(float(info[3]),'hartree','eV')) + line=inputfile.next() + self.moenergies=Numeric.array(self.moenergies,"f") + # if line[1:19]=='Orbital symmetries' and not hasattr(self,"mosyms"): # # Extracting orbital symmetries # if self.progress and random.random()<fupdate: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ate...@us...> - 2006-03-27 20:27:40
|
Revision: 42 Author: atenderholt Date: 2006-03-27 12:27:30 -0800 (Mon, 27 Mar 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=42&view=rev Log Message: ----------- Work on aonames for adfparser there's a complication due to the aonames (SFOs) actually being linear combinations of aonames Modified Paths: -------------- trunk/src/cclib/parser/adfparser.py Modified: trunk/src/cclib/parser/adfparser.py =================================================================== --- trunk/src/cclib/parser/adfparser.py 2006-03-26 20:14:33 UTC (rev 41) +++ trunk/src/cclib/parser/adfparser.py 2006-03-27 20:27:30 UTC (rev 42) @@ -419,6 +419,45 @@ # parts = line.strip().split() # self.etrotats = Numeric.array(self.etrotats,"f") # + if line[1:21] == "Total nr. of (C)SFOs": +# Extract the number of basis sets + + self.nbasis=int(line.split(":")[1].split()[0]) + # e.g. Total nr. of (C)SFOs (summation over all irreps) : 60 + self.logger.info("Creating attribute nbasis: %i" % self.nbasis) + +# now that we're here, let's extract aonames + + self.logger.info("Creating attribute aonames[]") + self.aonames=[] + + blank=inputfile.next() + note=inputfile.next() + + while len(self.aonames)<self.nbasis: + blank=inputfile.next(); blank=inputfile.next(); blank=inputfile.next() + sym=inputfile.next() + line=inputfile.next() + num=int(line.split(':')[1].split()[0]) + + #read until line "--------..." is found + while line.find('--')<0: + line=inputfile.next() + + for i in range(num): + line=inputfile.next() + info=line.split() + temporb=info[8] + pos=temporb.find(':') + if pos>0: + orbital=temporb[:pos]+temporb[pos+1:] + else: + orbital=temporb + + self.aonames.append("%s%i_%i%s"%(info[5],int(info[9]),int(info[7]),orbital)) + line=inputfile.next() #get rid of line with energy in eV + + # if line[1:7]=="NBasis" or line[4:10]=="NBasis": # # Extract the number of basis sets # nbasis = int(line.split('=')[1].split()[0]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ate...@us...> - 2006-03-27 21:40:27
|
Revision: 43 Author: atenderholt Date: 2006-03-27 13:40:25 -0800 (Mon, 27 Mar 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=43&view=rev Log Message: ----------- homo in adfparser Modified Paths: -------------- trunk/src/cclib/parser/adfparser.py Modified: trunk/src/cclib/parser/adfparser.py =================================================================== --- trunk/src/cclib/parser/adfparser.py 2006-03-27 20:27:30 UTC (rev 42) +++ trunk/src/cclib/parser/adfparser.py 2006-03-27 21:40:25 UTC (rev 43) @@ -191,7 +191,7 @@ # self.geovalues.append(newlist) # if line[1:29]=='Orbital Energies, all Irreps' and not hasattr(self,"mosyms"): -#Extracting orbital symmetries and energies +#Extracting orbital symmetries and energies, homos self.logger.info("Creating attribute mosyms[[]]") self.mosyms=[[]] @@ -209,6 +209,9 @@ if len(info)==5: #this is restricted self.mosyms[0].append(info[0]) self.moenergies[0].append(convertor(float(info[3]),'hartree','eV')) + if info[2]=='0.00' and not hasattr(self,'homos'): + self.logger.info("Creating attribute homos[]") + self.homos=[len(self.moenergies[0])-2] line=inputfile.next() self.moenergies=Numeric.array(self.moenergies,"f") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bao...@us...> - 2006-08-23 13:57:33
|
Revision: 322 Author: baoilleach Date: 2006-08-23 06:57:28 -0700 (Wed, 23 Aug 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=322&view=rev Log Message: ----------- ADF parser: Fixed final problem with Os3CO12-D3h.out. Now, orbitals of E and T symmetries are added twice and three times, respectively. Modified Paths: -------------- trunk/src/cclib/parser/adfparser.py This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ate...@us...> - 2006-10-23 21:52:26
|
Revision: 379 http://svn.sourceforge.net/cclib/?rev=379&view=rev Author: atenderholt Date: 2006-10-23 14:52:21 -0700 (Mon, 23 Oct 2006) Log Message: ----------- ADF Parser: (Bug fix) Fixed the parser to handle the Os3 test file; switched from searching for text at specfic line positions to just finding the text in the line. Also altered a bit of the code that skip the create parts of a calculation. Modified Paths: -------------- trunk/src/cclib/parser/adfparser.py This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <la...@us...> - 2007-03-23 12:41:51
|
Revision: 589 http://svn.sourceforge.net/cclib/?rev=589&view=rev Author: langner Date: 2007-03-23 05:41:47 -0700 (Fri, 23 Mar 2007) Log Message: ----------- Parse irrep subspecies data from output. Modified normalisedegenerates() and fragment for parsing mocoeff/mosyms to correctly repeat degenerate irreps. Modified Paths: -------------- trunk/src/cclib/parser/adfparser.py This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ate...@us...> - 2006-04-13 01:32:22
|
Revision: 63 Author: atenderholt Date: 2006-04-12 18:32:20 -0700 (Wed, 12 Apr 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=63&view=rev Log Message: ----------- Changed ADF parser to use right naming scheme for mosyms Modified Paths: -------------- trunk/src/cclib/parser/adfparser.py Modified: trunk/src/cclib/parser/adfparser.py =================================================================== --- trunk/src/cclib/parser/adfparser.py 2006-04-13 00:34:42 UTC (rev 62) +++ trunk/src/cclib/parser/adfparser.py 2006-04-13 01:32:20 UTC (rev 63) @@ -207,7 +207,7 @@ while len(line)>1: info=line.split() if len(info)==5: #this is restricted - self.mosyms[0].append(info[0]) + self.mosyms[0].append(info[0].replace('.','')) self.moenergies[0].append(convertor(float(info[3]),'hartree','eV')) if info[2]=='0.00' and not hasattr(self,'homos'): self.logger.info("Creating attribute homos[]") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ate...@us...> - 2006-04-13 22:43:17
|
Revision: 64 Author: atenderholt Date: 2006-04-13 15:43:15 -0700 (Thu, 13 Apr 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=64&view=rev Log Message: ----------- Parse aonames if BAS is printed. Still need to add support for n>2 and d/f orbitals Modified Paths: -------------- trunk/src/cclib/parser/adfparser.py Modified: trunk/src/cclib/parser/adfparser.py =================================================================== --- trunk/src/cclib/parser/adfparser.py 2006-04-13 01:32:20 UTC (rev 63) +++ trunk/src/cclib/parser/adfparser.py 2006-04-13 22:43:15 UTC (rev 64) @@ -422,45 +422,95 @@ # parts = line.strip().split() # self.etrotats = Numeric.array(self.etrotats,"f") # - if line[1:21] == "Total nr. of (C)SFOs": -# Extract the number of basis sets - self.nbasis=int(line.split(":")[1].split()[0]) - # e.g. Total nr. of (C)SFOs (summation over all irreps) : 60 - self.logger.info("Creating attribute nbasis: %i" % self.nbasis) - -# now that we're here, let's extract aonames +#******************************************************************************************************************8 +#delete this after new implementation using smat, eigvec print,eprint? +# if line[1:21] == "Total nr. of (C)SFOs": +# # Extract the number of basis sets +# +# self.nbasis=int(line.split(":")[1].split()[0]) +# # e.g. Total nr. of (C)SFOs (summation over all irreps) : 60 +# self.logger.info("Creating attribute nbasis: %i" % self.nbasis) +# +# # now that we're here, let's extract aonames +# +# self.logger.info("Creating attribute aonames[]") +# self.aonames=[] +# +# blank=inputfile.next() +# note=inputfile.next() +# +# while len(self.aonames)<self.nbasis: +# blank=inputfile.next(); blank=inputfile.next(); blank=inputfile.next() +# sym=inputfile.next() +# line=inputfile.next() +# num=int(line.split(':')[1].split()[0]) +# +# #read until line "--------..." is found +# while line.find('--')<0: +# line=inputfile.next() +# +# for i in range(num): +# line=inputfile.next() +# info=line.split() +# temporb=info[8] +# pos=temporb.find(':') +# if pos>0: +# orbital=temporb[:pos]+temporb[pos+1:] +# else: +# orbital=temporb +# +# self.aonames.append("%s%i_%i%s"%(info[5],int(info[9]),int(info[7]),orbital)) +# line=inputfile.next() #get rid of line with energy in eV +#**************************************************************************************************************************** + if line[1:10]=="BAS: List": + self.logger.info("Creating attribute aonames[]") self.aonames=[] - blank=inputfile.next() - note=inputfile.next() + #get rid of descriptive text + for i in range(18): + inputfile.next() - while len(self.aonames)<self.nbasis: - blank=inputfile.next(); blank=inputfile.next(); blank=inputfile.next() - sym=inputfile.next() + line=inputfile.next() + while line[1:5]!="****": + + atomheader=inputfile.next() + underline=inputfile.next() + + funcs=[] line=inputfile.next() - num=int(line.split(':')[1].split()[0]) - #read until line "--------..." is found - while line.find('--')<0: + #read functions up to blank line + while len(line)>1: + + if line[1:5]=="****": + break + + if line[12:22]=="0 0 0 0": + funcs.append("1S") + if line[12:22]=="0 0 0 1": + funcs.append("2S") + if line[12:22]=="1 0 0 0": + funcs.append("2PX") + if line[12:22]=="0 1 0 0": + funcs.append("2PY") + if line[12:22]=="0 0 1 0": + funcs.append("2PZ") + line=inputfile.next() - - for i in range(num): - line=inputfile.next() - info=line.split() - temporb=info[8] - pos=temporb.find(':') - if pos>0: - orbital=temporb[:pos]+temporb[pos+1:] - else: - orbital=temporb - - self.aonames.append("%s%i_%i%s"%(info[5],int(info[9]),int(info[7]),orbital)) - line=inputfile.next() #get rid of line with energy in eV - - + + element=atomheader[:38].split()[0] + numbers=atomheader[38:].split() + for num in numbers: + for j in range(len(funcs)): + self.aonames.append(element+num+"_"+funcs[j]) + + + self.nbasis=len(self.aonames) + self.logger.info("Creating attribute nbasis: %d" % self.nbasis) + # if line[1:7]=="NBasis" or line[4:10]=="NBasis": # # Extract the number of basis sets # nbasis = int(line.split('=')[1].split()[0]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ate...@us...> - 2006-04-14 01:08:06
|
Revision: 65 Author: atenderholt Date: 2006-04-13 18:07:57 -0700 (Thu, 13 Apr 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=65&view=rev Log Message: ----------- Read smat (aooverlaps) Modified Paths: -------------- trunk/src/cclib/parser/adfparser.py Modified: trunk/src/cclib/parser/adfparser.py =================================================================== --- trunk/src/cclib/parser/adfparser.py 2006-04-13 22:43:15 UTC (rev 64) +++ trunk/src/cclib/parser/adfparser.py 2006-04-14 01:07:57 UTC (rev 65) @@ -544,37 +544,36 @@ # self.nbasis = nbasis # self.logger.info("Creating attribute nbasis: %d" % self.nbasis) # -# if line[1:4]=="***" and (line[5:12]=="Overlap" -# or line[8:15]=="Overlap"): -# # Extract the molecular orbital overlap matrix -# # Has to deal with lines such as: -# # *** Overlap *** -# # ****** Overlap ****** -# self.logger.info("Creating attribute aooverlaps[x,y]") -# self.aooverlaps = Numeric.zeros( (self.nbasis,self.nbasis), "float") -# # Overlap integrals for basis fn#1 are in aooverlaps[0] -# base = 0 -# colmNames = inputfile.next() -# while base<self.nbasis: -# -# if self.progress and random.random()<fupdate: -# step=inputfile.tell() -# if step!=oldstep: -# self.progress.update(step,"Overlap") -# oldstep=step -# -# for i in range(self.nbasis-base): # Fewer lines this time -# line = inputfile.next() -# parts = line.split() -# for j in range(len(parts)-1): # Some lines are longer than others -# k = float(parts[j].replace("D","E")) -# self.aooverlaps[base+j,i+base] = k -# self.aooverlaps[i+base,base+j] = k -# base += 5 -# colmNames = inputfile.next() -# self.aooverlaps = Numeric.array(self.aooverlaps,"f") -# -# + if line[1:13]=="====== smat": +# Extract the overlap matrix + + self.logger.info("Creating attribute aooverlaps[x,y]") + self.aooverlaps = Numeric.zeros( (self.nbasis,self.nbasis), "float") + # Overlap integrals for basis fn#1 are in aooverlaps[0] + base = 0 + + while base<self.nbasis: + + if self.progress and random.random()<fupdate: + step=inputfile.tell() + if step!=oldstep: + self.progress.update(step,"Overlap") + oldstep=step + + blankline=inputfile.next() + colName=inputfile.next() + rowName=inputfile.next() + + for i in range(self.nbasis-base): # Fewer lines this time + line = inputfile.next() + parts = line.split()[1:] + for j in range(len(parts)): # Some lines are longer than others + k = float(parts[j]) + self.aooverlaps[base+j,i+base] = k + self.aooverlaps[i+base,base+j] = k + base += 4 + + # if line[5:35]=="Molecular Orbital Coefficients" or line[5:41]=="Alpha Molecular Orbital Coefficients" or line[5:40]=="Beta Molecular Orbital Coefficients": # if line[5:40]=="Beta Molecular Orbital Coefficients": # beta = True This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ate...@us...> - 2006-04-14 15:00:47
|
Revision: 67 Author: atenderholt Date: 2006-04-14 08:00:42 -0700 (Fri, 14 Apr 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=67&view=rev Log Message: ----------- Fixed the problem with adfparser completely dieing on aonames, however it still needs work on other unittests Modified Paths: -------------- trunk/src/cclib/parser/adfparser.py Modified: trunk/src/cclib/parser/adfparser.py =================================================================== --- trunk/src/cclib/parser/adfparser.py 2006-04-14 14:23:25 UTC (rev 66) +++ trunk/src/cclib/parser/adfparser.py 2006-04-14 15:00:42 UTC (rev 67) @@ -478,6 +478,8 @@ atomheader=inputfile.next() underline=inputfile.next() + if len(atomheader)==1: #in the case of gopt, there is no * line after we finish, just two blank lines + break funcs=[] line=inputfile.next() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bao...@us...> - 2006-04-17 15:28:28
|
Revision: 74 Author: baoilleach Date: 2006-04-17 08:28:13 -0700 (Mon, 17 Apr 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=74&view=rev Log Message: ----------- Added code to normalise the symmetry for every possible case. Wasn't sure what to do with the symmetries labelled using greek letters, e.g. delta. Considered using unicode characters, but in the end just used the word delta. Modified Paths: -------------- trunk/src/cclib/parser/adfparser.py Modified: trunk/src/cclib/parser/adfparser.py =================================================================== --- trunk/src/cclib/parser/adfparser.py 2006-04-15 09:28:56 UTC (rev 73) +++ trunk/src/cclib/parser/adfparser.py 2006-04-17 15:28:13 UTC (rev 74) @@ -38,6 +38,36 @@ """Return a representation of the object.""" return 'ADF("%s")' % (self.filename) + def normalisesym(self,label): + """Use standard symmetry labels instead of ADF labels. + + To normalise: + (1) any periods are removed (except in the case of greek letters) + (2) XXX is replaced by X, and a " added. + (3) XX is replaced by X, and a ' added. + (4) The greek letters Sigma, Pi, Delta and Phi are replaced by + their lowercase equivalent. + + >>> sym = ADF("dummyfile").normalisesym + >>> labels = ['A','s','A1','A1.g','Sigma','Pi','Delta','Phi','Sigma.g','A.g','AA','AAA','EE1','EEE1'] + >>> map(sym,labels) + ['A', 's', 'A1', 'A1g', 'sigma', 'pi', 'delta', 'phi', 'sigma.g', 'Ag', "A'", 'A"', "E1'", 'E1"'] + """ + greeks = ['Sigma','Pi','Delta','Phi'] + for greek in greeks: + if label.startswith(greek): + return label.lower() + + ans = label.replace(".","") + l = len(ans) + if l>1 and ans[0]==ans[1]: # Python only tests the second condition if the first is true + if l>2 and ans[1]==ans[2]: + ans = ans.replace(ans[0]*3,ans[0]) + '"' + else: + ans = ans.replace(ans[0]*2,ans[0]) + "'" + return ans + + def parse(self,fupdate=0.05,cupdate=0.002): """Extract information from the logfile.""" inputfile = open(self.filename,"r") @@ -207,7 +237,7 @@ while len(line)>1: info=line.split() if len(info)==5: #this is restricted - self.mosyms[0].append(info[0].replace('.','')) + self.mosyms[0].append(self.normalisesym(info[0])) self.moenergies[0].append(convertor(float(info[3]),'hartree','eV')) if info[2]=='0.00' and not hasattr(self,'homos'): self.logger.info("Creating attribute homos[]") @@ -656,5 +686,5 @@ assert len(self.traj)==len(self.trajSummary) if __name__=="__main__": - import doctest,parser - doctest.testmod(parser,verbose=False) + import doctest,adfparser + doctest.testmod(adfparser,verbose=False) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ate...@us...> - 2006-04-21 01:03:21
|
Revision: 77 Author: atenderholt Date: 2006-04-20 18:02:57 -0700 (Thu, 20 Apr 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=77&view=rev Log Message: ----------- Some work on the ADF parser. Still passes the dvb_gopt test, parses dvb_sp and dvb_sp_b, but work on dvb_un_sp is incomplete (ie it fails). Since that is what is being worked on and it has no tests yet, I figure it can be safely committed. Modified Paths: -------------- trunk/src/cclib/parser/adfparser.py Modified: trunk/src/cclib/parser/adfparser.py =================================================================== --- trunk/src/cclib/parser/adfparser.py 2006-04-17 20:44:09 UTC (rev 76) +++ trunk/src/cclib/parser/adfparser.py 2006-04-21 01:02:57 UTC (rev 77) @@ -234,6 +234,9 @@ underline2=inputfile.next() line=inputfile.next() + homoa=None + homob=None + while len(line)>1: info=line.split() if len(info)==5: #this is restricted @@ -243,6 +246,29 @@ self.logger.info("Creating attribute homos[]") self.homos=[len(self.moenergies[0])-2] line=inputfile.next() + elif len(info)==6: #this is unrestricted + self.moenergies.append([]) + self.mosyms.append([]) + if info[2]=='A': + self.mosyms[0].append(self.normalisesym(info[0])) + self.moenergies[0].append(convertor(float(info[4]),'hartree','eV')) + if info[3]=='0.00' and homoa==None: + homoa=len(self.moenergies[0])-2 + + if info[2]=='B': + self.mosyms[1].append(self.normalisesym(info[0])) + self.moenergies[1].append(convertor(float(info[4]),'hartree','eV')) + if info[3]=='0.00' and homob==None: + homob=len(self.moenergies[1])-2 + + line=inputfile.next() + + else: #different number of lines + print "Error",info + if len(info)==6: #still unrestricted, despite being out of loop + self.logger.info("Creating attribute homos[]") + self.homos=[homoa,homob] + self.moenergies=Numeric.array(self.moenergies,"f") # if line[1:19]=='Orbital symmetries' and not hasattr(self,"mosyms"): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ate...@us...> - 2006-04-21 07:10:28
|
Revision: 78 Author: atenderholt Date: 2006-04-21 00:10:27 -0700 (Fri, 21 Apr 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=78&view=rev Log Message: ----------- Made moenergies and mosyms parsing of dvb_un_sp.adfout work. Modified Paths: -------------- trunk/src/cclib/parser/adfparser.py Modified: trunk/src/cclib/parser/adfparser.py =================================================================== --- trunk/src/cclib/parser/adfparser.py 2006-04-21 01:02:57 UTC (rev 77) +++ trunk/src/cclib/parser/adfparser.py 2006-04-21 07:10:27 UTC (rev 78) @@ -236,8 +236,8 @@ homoa=None homob=None - - while len(line)>1: + + while len(line)==77: info=line.split() if len(info)==5: #this is restricted self.mosyms[0].append(self.normalisesym(info[0])) @@ -247,8 +247,9 @@ self.homos=[len(self.moenergies[0])-2] line=inputfile.next() elif len(info)==6: #this is unrestricted - self.moenergies.append([]) - self.mosyms.append([]) + if len(self.moenergies)<2: #if we don't have space, create it + self.moenergies.append([]) + self.mosyms.append([]) if info[2]=='A': self.mosyms[0].append(self.normalisesym(info[0])) self.moenergies[0].append(convertor(float(info[4]),'hartree','eV')) @@ -265,12 +266,19 @@ else: #different number of lines print "Error",info + if len(info)==6: #still unrestricted, despite being out of loop self.logger.info("Creating attribute homos[]") self.homos=[homoa,homob] - - self.moenergies=Numeric.array(self.moenergies,"f") - + +# tempa=Numeric.array(self.moenergies[0],"f") +# tempb=Numeric.array(self.moenergies[1],"f") +# self.moenergies=[tempa,tempb] +# elif len(info)==5: +# self.moenergies=[ + + temp=Numeric.array(self.moenergies,"f") + self.moenergies=temp # if line[1:19]=='Orbital symmetries' and not hasattr(self,"mosyms"): # # Extracting orbital symmetries # if self.progress and random.random()<fupdate: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bao...@us...> - 2006-04-22 17:34:55
|
Revision: 82 Author: baoilleach Date: 2006-04-22 10:34:47 -0700 (Sat, 22 Apr 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=82&view=rev Log Message: ----------- Extracts geovalues, geotargets and scfenergies...although the scf energy is quite different from those of the other parsers. Maybe this is a question of units? Modified Paths: -------------- trunk/src/cclib/parser/adfparser.py Modified: trunk/src/cclib/parser/adfparser.py =================================================================== --- trunk/src/cclib/parser/adfparser.py 2006-04-22 10:00:16 UTC (rev 81) +++ trunk/src/cclib/parser/adfparser.py 2006-04-22 17:34:47 UTC (rev 82) @@ -175,51 +175,30 @@ # break # self.scfvalues.append(newlist) # -# if line[1:4]=='It=': -# # Extract SCF convergence information (AM1 calcs) -# if self.progress: -# step=inputfile.tell() -# if step!=oldstep: -# self.progress.update(step,"AM1 Convergence") -# oldstep=step -# -# self.logger.info("Creating attributes scftargets, scfvalues") -# self.scftargets = Numeric.array([1E-7],"f") # This is the target value for the rms -# self.scfvalues = [[]] -# line = inputfile.next() -# while line.find(" Energy")==-1: -# parts = line.strip().split() -# self.scfvalues[0].append(self.float(parts[-1][:-1])) -# line = inputfile.next() -# -# if line[1:9]=='SCF Done': -# # Note: this needs to follow the section where 'SCF Done' is used to terminate -# # a loop when extracting SCF convergence information -# if not hasattr(self,"scfenergies"): -# self.logger.info("Creating attribute scfenergies[]") -# self.scfenergies = [] -# self.scfenergies.append(self.float(line.split()[4])) -# -# if line[49:59]=='Converged?': -# # Extract Geometry convergence information -# if not hasattr(self,"geotargets"): -# self.logger.info("Creating attributes geotargets[],geovalues[[]]") -# self.geovalues = [] -# self.geotargets = Numeric.array( [0.0,0.0,0.0,0.0],"f") -# newlist = [0]*4 -# for i in range(4): -# line = inputfile.next() -# self.logger.debug(line) -# parts = line.split() -# try: -# value = self.float(parts[2]) -# except ValueError: -# self.logger.error("Problem parsing the value for geometry optimisation: %s is not a number." % parts[2]) -# else: -# newlist[i] = value -# self.geotargets[i] = self.float(parts[3]) -# self.geovalues.append(newlist) -# + + if line[1:27]=='Geometry Convergence Tests': +# Extract Geometry convergence information + if not hasattr(self,"geotargets"): + self.logger.info("Creating attributes geotargets[],geovalues[[]]") + self.geovalues = [] + self.geotargets = Numeric.array( [0.0,0.0,0.0,0.0,0.0],"f") + if not hasattr(self,"scfenergies"): + self.logger.info("Creating attribute scfenergies[]") + self.scfenergies = [] + equals = inputfile.next() + blank = inputfile.next() + line = inputfile.next() + temp = inputfile.next().strip().split() + self.scfenergies.append(convertor(float(temp[-1]),"hartree","eV")) + for i in range(6): + line = inputfile.next() + values = [] + for i in range(5): + temp = inputfile.next().split() + self.geotargets[i] = float(temp[-3]) + values.append(float(temp[-4])) + self.geovalues.append(values) + if line[1:29]=='Orbital Energies, all Irreps' and not hasattr(self,"mosyms"): #Extracting orbital symmetries and energies, homos self.logger.info("Creating attribute mosyms[[]]") @@ -689,7 +668,7 @@ if hasattr(self,"geovalues"): self.geovalues = Numeric.array(self.geovalues,"f") if hasattr(self,"scfenergies"): self.scfenergies = Numeric.array(self.scfenergies,"f") - if hasattr(self,"scfvalues"): self.scfvalues = Numeric.array(self.scftargets,"f") + if hasattr(self,"scfvalues"): self.scfvalues = [Numeric.array(x,"f") for x in self.scfvalues] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bao...@us...> - 2006-04-22 18:17:37
|
Revision: 84 Author: baoilleach Date: 2006-04-22 11:17:31 -0700 (Sat, 22 Apr 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=84&view=rev Log Message: ----------- Extracted ir and freq info. Not sure how to handle to symmetry yet. It seems to be split into different sections based on symmetry. Modified Paths: -------------- trunk/src/cclib/parser/adfparser.py Modified: trunk/src/cclib/parser/adfparser.py =================================================================== --- trunk/src/cclib/parser/adfparser.py 2006-04-22 17:39:59 UTC (rev 83) +++ trunk/src/cclib/parser/adfparser.py 2006-04-22 18:17:31 UTC (rev 84) @@ -350,48 +350,31 @@ # line = inputfile.next() # self.moenergies = Numeric.array(self.moenergies,"f") # -# if line[1:14]=="Harmonic freq": -# # Start of the IR/Raman frequency section -# if self.progress and random.random()<fupdate: -# step=inputfile.tell() -# if step!=oldstep: -# self.progress.update(step,"Frequency Information") -# oldstep=step -# -# self.vibsyms = [] -# self.vibirs = [] -# self.vibfreqs = [] + if line[1:24]=="List of All Frequencies": +# Start of the IR/Raman frequency section + if self.progress and random.random()<fupdate: + step=inputfile.tell() + if step!=oldstep: + self.progress.update(step,"Frequency Information") + oldstep=step + +# self.vibsyms = [] # Need to look into this a bit more + self.vibirs = [] + self.vibfreqs = [] # self.logger.info("Creating attribute vibsyms[]") -# self.logger.info("Creating attribute vibfreqs[]") -# self.logger.info("Creating attribute vibirs[]") -# line = inputfile.next() -# while len(line[:15].split())>0: -# # Get past the three/four line title of the columns -# line = inputfile.next() -# line = inputfile.next() # The line with symmetries -# while len(line[:15].split())==0: -# self.logger.debug(line) -# self.vibsyms.extend(line.split()) # Adding new symmetry -# line = inputfile.next() -# self.vibfreqs.extend(map(self.float,line[15:].split())) # Adding new frequencies -# [inputfile.next() for i in [0,1]] # Skip two lines -# line = inputfile.next() -# self.vibirs.extend(map(self.float,line[15:].split())) # Adding IR intensities -# line = inputfile.next() -# if line.find("Raman")>=0: -# if not hasattr(self,"vibramans"): -# self.vibramans = [] -# self.logger.info("Creating attribute vibramans[]") -# line = inputfile.next() -# self.vibramans.extend(map(self.float,line[15:].split())) # Adding Raman intensities -# line = inputfile.next() -# while len(line[:15].split())>0: -# line = inputfile.next() -# line = inputfile.next() # Should be the line with symmetries -# self.vibfreqs = Numeric.array(self.vibfreqs,"f") -# self.vibirs = Numeric.array(self.vibirs,"f") -# if hasattr(self,"vibramans"): self.vibramans = Numeric.array(self.vibramans,"f") -# + self.logger.info("Creating attribute vibfreqs[],vibirs[]") + for i in range(8): + line = inputfile.next() + line = inputfile.next().strip() + while line: + temp = line.split() + self.vibfreqs.append(float(temp[0])) + self.vibirs.append(float(temp[2])) # or is it temp[1]? + line = inputfile.next().strip() + self.vibfreqs = Numeric.array(self.vibfreqs,"f") + self.vibirs = Numeric.array(self.vibirs,"f") + if hasattr(self,"vibramans"): self.vibramans = Numeric.array(self.vibramans,"f") + # if line[1:14]=="Excited State": # # Extract the electronic transitions # if not hasattr(self,"etenergy"): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ate...@us...> - 2006-04-23 22:39:22
|
Revision: 85 Author: atenderholt Date: 2006-04-23 15:39:20 -0700 (Sun, 23 Apr 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=85&view=rev Log Message: ----------- Parse number of basis functions (i.e. SFOs) Modified Paths: -------------- trunk/src/cclib/parser/adfparser.py Modified: trunk/src/cclib/parser/adfparser.py =================================================================== --- trunk/src/cclib/parser/adfparser.py 2006-04-22 18:17:31 UTC (rev 84) +++ trunk/src/cclib/parser/adfparser.py 2006-04-23 22:39:20 UTC (rev 85) @@ -539,6 +539,12 @@ self.nbasis=len(self.aonames) self.logger.info("Creating attribute nbasis: %d" % self.nbasis) + if line[1:49]=="Total nr. of (C)SFOs (summation over all irreps)": +#Extract the number of basis sets + self.nbasis=int(line.split()[-1]) + self.logger.info("Creating attribute nbasis: %d" % self.nbasis) + + # if line[1:7]=="NBasis" or line[4:10]=="NBasis": # # Extract the number of basis sets # nbasis = int(line.split('=')[1].split()[0]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ate...@us...> - 2006-04-24 00:03:24
|
Revision: 86 Author: atenderholt Date: 2006-04-23 17:03:18 -0700 (Sun, 23 Apr 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=86&view=rev Log Message: ----------- Parse mocoeffs in terms of SFOs Modified Paths: -------------- trunk/src/cclib/parser/adfparser.py Modified: trunk/src/cclib/parser/adfparser.py =================================================================== --- trunk/src/cclib/parser/adfparser.py 2006-04-23 22:39:20 UTC (rev 85) +++ trunk/src/cclib/parser/adfparser.py 2006-04-24 00:03:18 UTC (rev 86) @@ -607,7 +607,70 @@ self.aooverlaps[i+base,base+j] = k base += 4 - + if line[48:67]=="SFO MO coefficients": + + #read stars and three blank lines + inputfile.next() + inputfile.next() + inputfile.next() + inputfile.next() + + line=inputfile.next() + + if line.find("***** SPIN 1 *****")>0: + beta = 1 + self.mocoeffs = Numeric.zeros((2,self.nbasis,self.nbasis),"float") + + #get rid of two blank lines and symmetry label + inputfile.next() + inputfile.next() + sym=inputfile.next() + #print sym + + else: + beta = 0 + self.mocoeffs = Numeric.zeros((1,self.nbasis,self.nbasis),"float") + + #get rid of 12 lines of text + for i in range(10): + inputfile.next() + + for spin in range(beta+1): + symoffset=0 + base=0 + + if spin==1: + #read spin, blank, blank, symlabel, blank, text, underline, blank + for i in range(8): + line=inputfile.next() + + while symoffset+base<self.nbasis: + + line=inputfile.next() + if len(line)<3: + symoffset+=base + base=0 + #print symoffset + + monumbers=line.split() + #print monumbers + #get rid of next two lines + inputfile.next() + inputfile.next() + + row=0 + line=inputfile.next() + while len(line)>2: + cols=line.split() + for i in range(len(cols[1:])): + self.mocoeffs[spin,row+symoffset,i+symoffset+base]=float(cols[i+1]) + + line=inputfile.next() + row+=1 + + base+=len(cols[1:]) + + # if line[5:35]=="Molecular Orbital Coefficients" or line[5:41]=="Alpha Molecular Orbital Coefficients" or line[5:40]=="Beta Molecular Orbital Coefficients": # if line[5:40]=="Beta Molecular Orbital Coefficients": # beta = True This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ate...@us...> - 2006-04-25 02:23:24
|
Revision: 87 Author: atenderholt Date: 2006-04-24 19:23:20 -0700 (Mon, 24 Apr 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=87&view=rev Log Message: ----------- Parse SFOs according to specification on wiki. Haven't checked nosym file. Modified Paths: -------------- trunk/src/cclib/parser/adfparser.py Modified: trunk/src/cclib/parser/adfparser.py =================================================================== --- trunk/src/cclib/parser/adfparser.py 2006-04-24 00:03:18 UTC (rev 86) +++ trunk/src/cclib/parser/adfparser.py 2006-04-25 02:23:20 UTC (rev 87) @@ -451,100 +451,65 @@ #******************************************************************************************************************8 #delete this after new implementation using smat, eigvec print,eprint? -# if line[1:21] == "Total nr. of (C)SFOs": -# # Extract the number of basis sets -# -# self.nbasis=int(line.split(":")[1].split()[0]) -# # e.g. Total nr. of (C)SFOs (summation over all irreps) : 60 -# self.logger.info("Creating attribute nbasis: %i" % self.nbasis) -# -# # now that we're here, let's extract aonames -# -# self.logger.info("Creating attribute aonames[]") -# self.aonames=[] -# -# blank=inputfile.next() -# note=inputfile.next() -# -# while len(self.aonames)<self.nbasis: -# blank=inputfile.next(); blank=inputfile.next(); blank=inputfile.next() -# sym=inputfile.next() -# line=inputfile.next() -# num=int(line.split(':')[1].split()[0]) -# -# #read until line "--------..." is found -# while line.find('--')<0: -# line=inputfile.next() -# -# for i in range(num): -# line=inputfile.next() -# info=line.split() -# temporb=info[8] -# pos=temporb.find(':') -# if pos>0: -# orbital=temporb[:pos]+temporb[pos+1:] -# else: -# orbital=temporb -# -# self.aonames.append("%s%i_%i%s"%(info[5],int(info[9]),int(info[7]),orbital)) -# line=inputfile.next() #get rid of line with energy in eV -#**************************************************************************************************************************** - - if line[1:10]=="BAS: List": - - self.logger.info("Creating attribute aonames[]") - self.aonames=[] - - #get rid of descriptive text - for i in range(18): - inputfile.next() - - line=inputfile.next() - while line[1:5]!="****": - - atomheader=inputfile.next() - underline=inputfile.next() - if len(atomheader)==1: #in the case of gopt, there is no * line after we finish, just two blank lines - break - - funcs=[] + if line[1:49] == "Total nr. of (C)SFOs (summation over all irreps)": +# Extract the number of basis sets + self.nbasis=int(line.split(":")[1].split()[0]) + self.logger.info("Creating attribute nbasis: %i" % self.nbasis) + + # now that we're here, let's extract aonames + + self.logger.info("Creating attribute fonames[]") + self.fonames=[] + + blank=inputfile.next() + note=inputfile.next() + symoffset=0 + blank=inputfile.next(); blank=inputfile.next(); blank=inputfile.next() + + while len(self.fonames)<self.nbasis: + sym=inputfile.next() + line=inputfile.next() + num=int(line.split(':')[1].split()[0]) + + #read until line "--------..." is found + while line.find('-----')<0: + line=inputfile.next() + + #for i in range(num): + while len(self.fonames)<symoffset+num: line=inputfile.next() - - #read functions up to blank line - while len(line)>1: + info=line.split() + + #index0 index1 occ2 energy3/4 fragname5 coeff6 orbnum7 orbname8 fragname9 + orbname=info[8] + orbital=info[7]+orbname.replace(":","") + + fragname=info[5] + frag=fragname+info[9] + + coeff=float(info[6]) + if coeff**2<1.0: #is this a linear combination? + line=inputfile.next() + info=line.split() - if line[1:5]=="****": - break - - if line[12:22]=="0 0 0 0": - funcs.append("1S") - if line[12:22]=="0 0 0 1": - funcs.append("2S") - if line[12:22]=="1 0 0 0": - funcs.append("2PX") - if line[12:22]=="0 1 0 0": - funcs.append("2PY") - if line[12:22]=="0 0 1 0": - funcs.append("2PZ") - - line=inputfile.next() - - element=atomheader[:38].split()[0] - numbers=atomheader[38:].split() - for num in numbers: - for j in range(len(funcs)): - self.aonames.append(element+num+"_"+funcs[j]) - - - self.nbasis=len(self.aonames) - self.logger.info("Creating attribute nbasis: %d" % self.nbasis) + if line[42]==' ': #no new fragment type + frag+="+"+fragname+info[6] + coeff=float(info[3]) + if coeff<0: orbital+='-'+info[4]+info[5].replace(":","") + else: orbital+='+'+info[4]+info[5].replace(":","") + else: + frag+="+"+info[3]+info[7] + coeff=float(info[4]) + if coeff<0: orbital+='-'+info[5]+info[6].replace(":","") + else: orbital+="+"+info[5]+info[6].replace(":","") + + self.fonames.append("%s_%s"%(frag,orbital)) + symoffset+=num - if line[1:49]=="Total nr. of (C)SFOs (summation over all irreps)": -#Extract the number of basis sets - self.nbasis=int(line.split()[-1]) - self.logger.info("Creating attribute nbasis: %d" % self.nbasis) - + #nextline blankline blankline + inputfile.next(); inputfile.next(); inputfile.next() + # if line[1:7]=="NBasis" or line[4:10]=="NBasis": # # Extract the number of basis sets # nbasis = int(line.split('=')[1].split()[0]) @@ -608,7 +573,7 @@ base += 4 if line[48:67]=="SFO MO coefficients": - +#extract MO coefficients #read stars and three blank lines inputfile.next() inputfile.next() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ate...@us...> - 2006-04-25 05:31:10
|
Revision: 89 Author: atenderholt Date: 2006-04-24 22:31:06 -0700 (Mon, 24 Apr 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=89&view=rev Log Message: ----------- Minor fix to make it work with molecules lacking symmetry Modified Paths: -------------- trunk/src/cclib/parser/adfparser.py Modified: trunk/src/cclib/parser/adfparser.py =================================================================== --- trunk/src/cclib/parser/adfparser.py 2006-04-25 05:27:57 UTC (rev 88) +++ trunk/src/cclib/parser/adfparser.py 2006-04-25 05:31:06 UTC (rev 89) @@ -502,7 +502,9 @@ coeff=float(info[4]) if coeff<0: orbital+='-'+info[5]+info[6].replace(":","") else: orbital+="+"+info[5]+info[6].replace(":","") - + + else: + inputfile.next() self.fonames.append("%s_%s"%(frag,orbital)) symoffset+=num This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ate...@us...> - 2006-04-25 18:09:31
|
Revision: 90 Author: atenderholt Date: 2006-04-25 11:09:30 -0700 (Tue, 25 Apr 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=90&view=rev Log Message: ----------- Removed some commented out gaussian parts from the adfparser Modified Paths: -------------- trunk/src/cclib/parser/adfparser.py Modified: trunk/src/cclib/parser/adfparser.py =================================================================== --- trunk/src/cclib/parser/adfparser.py 2006-04-25 05:31:06 UTC (rev 89) +++ trunk/src/cclib/parser/adfparser.py 2006-04-25 18:09:30 UTC (rev 90) @@ -258,98 +258,7 @@ temp=Numeric.array(self.moenergies,"f") self.moenergies=temp -# if line[1:19]=='Orbital symmetries' and not hasattr(self,"mosyms"): -# # Extracting orbital symmetries -# if self.progress and random.random()<fupdate: -# step=inputfile.tell() -# if step!=oldstep: -# self.progress.update(step,"MO Symmetries") -# oldstep=step -# -# self.logger.info("Creating attribute mosyms[[]]") -# self.mosyms = [[]] -# line = inputfile.next() -# unres = False -# if line.find("Alpha Orbitals")==1: -# unres = True -# line = inputfile.next() -# i = 0 -# while len(line)>18 and line[17]=='(': -# if line.find('Virtual')>=0: -# self.homos = Numeric.array([i-1],"i") # 'HOMO' indexes the HOMO in the arrays -# self.logger.info("Creating attribute homos[]") -# parts = line[17:].split() -# for x in parts: -# self.mosyms[0].append(x.strip('()')) -# i+= 1 -# line = inputfile.next() -# if unres: -# line = inputfile.next() -# # Repeat with beta orbital information -# i = 0 -# self.mosyms.append([]) -# while len(line)>18 and line[17]=='(': -# if line.find('Virtual')>=0: -# self.homos.resize([2]) # Extend the array to two elements -# self.homos[1] = i-1 # 'HOMO' indexes the HOMO in the arrays -# parts = line[17:].split() -# for x in parts: -# self.mosyms[1].append(x.strip('()')) -# i+= 1 -# line = inputfile.next() -# -# if line[1:6]=="Alpha" and line.find("eigenvalues")>=0: -# # Extract the alpha electron eigenvalues -# if self.progress and random.random()<fupdate: -# step=inputfile.tell() -# if step!=oldstep: -# self.progress.update(step,"Eigenvalues") -# oldstep=step -# -# self.logger.info("Creating attribute moenergies[[]]") -# self.moenergies = [[]] -# HOMO = -2 -# while line.find('Alpha')==1: -# if line.split()[1]=="virt." and HOMO==-2: -# # If there aren't any symmetries, -# # this is a good way to find the HOMO -# HOMO = len(self.moenergies[0])-1 -# if hasattr(self,"homos"): -# assert HOMO==self.homos[0] -# else: -# self.logger.info("Creating attribute homos[]") -# self.homos = Numeric.array([HOMO],"i") -# part = line[28:] -# i = 0 -# while i*10+4<len(part): -# x = part[i*10:(i+1)*10] -# self.moenergies[0].append(convertor(self.float(x),"hartree","eV")) -# i += 1 -# line = inputfile.next() -# if line.find('Beta')==2: -# self.moenergies.append([]) -# HOMO = -2 -# while line.find('Beta')==2: -# if line.split()[1]=="virt." and HOMO==-2: -# # If there aren't any symmetries, -# # this is a good way to find the HOMO -# HOMO = len(self.moenergies[1])-1 -# if len(self.homos)==2: -# # It already has a self.homos (with the Alpha value) -# # but does it already have a Beta value? -# assert HOMO==self.homos[1] -# else: -# self.homos.resize([2]) -# self.homos[1] = HOMO -# part = line[28:] -# i = 0 -# while i*10+4<len(part): -# x = part[i*10:(i+1)*10] -# self.moenergies[1].append(convertor(self.float(x),"hartree","eV")) -# i += 1 -# line = inputfile.next() -# self.moenergies = Numeric.array(self.moenergies,"f") -# + if line[1:24]=="List of All Frequencies": # Start of the IR/Raman frequency section if self.progress and random.random()<fupdate: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ate...@us...> - 2006-04-25 22:37:18
|
Revision: 91 Author: atenderholt Date: 2006-04-25 15:37:15 -0700 (Tue, 25 Apr 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=91&view=rev Log Message: ----------- Parse fooverlaps in ADF file. Modified Paths: -------------- trunk/src/cclib/parser/adfparser.py Modified: trunk/src/cclib/parser/adfparser.py =================================================================== --- trunk/src/cclib/parser/adfparser.py 2006-04-25 18:09:30 UTC (rev 90) +++ trunk/src/cclib/parser/adfparser.py 2006-04-25 22:37:15 UTC (rev 91) @@ -375,10 +375,12 @@ symoffset=0 blank=inputfile.next(); blank=inputfile.next(); blank=inputfile.next() + nosymreps=[] while len(self.fonames)<self.nbasis: sym=inputfile.next() line=inputfile.next() num=int(line.split(':')[1].split()[0]) + nosymreps.append(num) #read until line "--------..." is found while line.find('-----')<0: @@ -453,35 +455,45 @@ # else: # self.nbasis = nbasis # self.logger.info("Creating attribute nbasis: %d" % self.nbasis) -# - if line[1:13]=="====== smat": -# Extract the overlap matrix - self.logger.info("Creating attribute aooverlaps[x,y]") - self.aooverlaps = Numeric.zeros( (self.nbasis,self.nbasis), "float") - # Overlap integrals for basis fn#1 are in aooverlaps[0] - base = 0 +# + if line[1:32]=="S F O P O P U L A T I O N S ,": + + self.logger.info("Creating attribute fooverlaps[x,y]") + self.fooverlaps = Numeric.zeros((self.nbasis,self.nbasis),"float") + + symoffset=0 + + for nosymrep in nosymreps: - while base<self.nbasis: + line=inputfile.next() + while line.find('===')<10: #look for the symmetry labels + line=inputfile.next() + #blank blank text blank col row + for i in range(6): inputfile.next() + + base=0 + + while base<nosymrep: #have we read all the columns? + + for i in range(nosymrep-base): + #while symoffset+base+i<self.nbasis: #have we read all the rows? + #while True: + line=inputfile.next() + parts=line.split()[1:] - if self.progress and random.random()<fupdate: - step=inputfile.tell() - if step!=oldstep: - self.progress.update(step,"Overlap") - oldstep=step - - blankline=inputfile.next() - colName=inputfile.next() - rowName=inputfile.next() + for j in range(len(parts)): + k=float(parts[j]) + self.fooverlaps[base+symoffset+j, base+symoffset+i] = k + self.fooverlaps[base+symoffset+i, base+symoffset+j] = k - for i in range(self.nbasis-base): # Fewer lines this time - line = inputfile.next() - parts = line.split()[1:] - for j in range(len(parts)): # Some lines are longer than others - k = float(parts[j]) - self.aooverlaps[base+j,i+base] = k - self.aooverlaps[i+base,base+j] = k - base += 4 + #blank, blank, column + for i in range(3): inputfile.next() + + base+=4 + + symoffset+=nosymrep + base=0 if line[48:67]=="SFO MO coefficients": #extract MO coefficients This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ate...@us...> - 2006-05-12 23:50:24
|
Revision: 115 Author: atenderholt Date: 2006-05-12 16:50:23 -0700 (Fri, 12 May 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=115&view=rev Log Message: ----------- Made nindep in the ADF parser equal to the length of moenergies[0] Modified Paths: -------------- trunk/src/cclib/parser/adfparser.py Modified: trunk/src/cclib/parser/adfparser.py =================================================================== --- trunk/src/cclib/parser/adfparser.py 2006-05-12 09:12:05 UTC (rev 114) +++ trunk/src/cclib/parser/adfparser.py 2006-05-12 23:50:23 UTC (rev 115) @@ -662,6 +662,7 @@ if hasattr(self,"scfenergies"): self.scfenergies = Numeric.array(self.scfenergies,"f") if hasattr(self,"scfvalues"): self.scfvalues = [Numeric.array(x,"f") for x in self.scfvalues] self.parsed = True + if hasattr(self,"moenergies"): self.nindep = len(self.moenergies[0]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bao...@us...> - 2006-05-13 18:48:24
|
Revision: 117 Author: baoilleach Date: 2006-05-13 11:48:19 -0700 (Sat, 13 May 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=117&view=rev Log Message: ----------- Changed indentation of 2-spaces to 4-spaces. I think we should standardise on 4. Modified Paths: -------------- trunk/src/cclib/parser/adfparser.py Modified: trunk/src/cclib/parser/adfparser.py =================================================================== --- trunk/src/cclib/parser/adfparser.py 2006-05-13 18:45:57 UTC (rev 116) +++ trunk/src/cclib/parser/adfparser.py 2006-05-13 18:48:19 UTC (rev 117) @@ -23,8 +23,7 @@ from logfileparser import Logfile,convertor class ADF(Logfile): - """A Gaussian 98/03 log file""" - #SCFRMS,SCFMAX,SCFENERGY = range(3) # Used to index self.scftargets[] + """An ADF log file""" SCFCNV,SCFCNV2 = range(2) #used to index self.scftargets[] def __init__(self,*args): @@ -132,50 +131,50 @@ 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') + 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]) - #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 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 = [] + 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])) + 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])) + 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) - 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: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bao...@us...> - 2006-05-22 10:44:26
|
Revision: 142 Author: baoilleach Date: 2006-05-22 03:43:56 -0700 (Mon, 22 May 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=142&view=rev Log Message: ----------- Atomcoords is correctly parsed, at least from geoopt files. Modified Paths: -------------- trunk/src/cclib/parser/adfparser.py Modified: trunk/src/cclib/parser/adfparser.py =================================================================== --- trunk/src/cclib/parser/adfparser.py 2006-05-22 10:43:22 UTC (rev 141) +++ trunk/src/cclib/parser/adfparser.py 2006-05-22 10:43:56 UTC (rev 142) @@ -82,6 +82,10 @@ self.progress.initialize(nstep) oldstep=0 + # Used to avoid extracting the final geometry twice in a GeoOpt + NOTFOUND, GETLAST, NOMORE = range(3) + finalgeometry= NOTFOUND + for line in inputfile: if self.progress and random.random()<cupdate: @@ -109,23 +113,28 @@ if line[1:6]=="ATOMS": # Find the number of atoms and their atomic numbers +# Also extract the starting coordinates (for a GeoOpt anyway) if self.progress and random.random()<cupdate: step=inputfile.tell() if step!=oldstep: self.progress.update(step,"Attributes") oldstep=step - self.logger.info("Creating attribute atomnos[]") + self.logger.info("Creating attribute atomnos[], atomcoords[]") self.atomnos=[] + self.atomcoords = [] underline=inputfile.next() #clear pointless lines label1=inputfile.next() # label2=inputfile.next() # line=inputfile.next() + atomcoords = [] while len(line)>1: #ensure that we are reading no blank lines info=line.split() self.atomnos.append(self.table.number[info[1]]) + atomcoords.append(map(float,info[2:5])) line=inputfile.next() + self.atomcoords.append(atomcoords) self.natom=len(self.atomnos) self.logger.info("Creating attribute natom: %d" % self.natom) @@ -171,43 +180,29 @@ if hasattr(self,"scfvalues"): self.scfvalues.append(newlist) -# if line[1:10]=='Cycle 1': -# # Extract SCF convergence information (QM calcs) -# 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 Done")==-1: -# if line.find(' E=')==0: -# self.logger.debug(line) -# if line.find(" RMSDP")==0: -# parts = line.split() -# newlist[G03.SCFRMS].append(self.float(parts[0].split('=')[1])) -# newlist[G03.SCFMAX].append(self.float(parts[1].split('=')[1])) -# energy = 1.0 -# if len(parts)>4: -# energy = parts[2].split('=')[1] -# if energy=="": -# energy = self.float(parts[3]) -# else: -# energy = self.float(energy) -# # I moved the following line back a TAB to see the effect -# # (it was originally part of the above "if len(parts)") -# newlist[G03.SCFENERGY].append(energy) -# try: -# line = inputfile.next() -# except StopIteration: # May be interupted by EOF -# break -# self.scfvalues.append(newlist) -# + if line[51:65]=="Final Geometry": + finalgeometry = GETLAST + + if line[1:24]=="Coordinates (Cartesian)" and finalgeometry in [NOTFOUND, GETLAST]: + # Get the coordinates from each step of the GeoOpt + if not hasattr(self,"atomcoords"): + self.logger.info("Creating attribute atomcoords") + self.atomcoords = [] + equals = inputfile.next() + blank = inputfile.next() + title = inputfile.next() + title = inputfile.next() + hyphens = inputfile.next() + atomcoords = [] + line = inputfile.next() + while line!=hyphens: + atomcoords.append(map(float,line.split()[5:])) + line = inputfile.next() + self.atomcoords.append(atomcoords) + if finalgeometry==GETLAST: # Don't get any more coordinates + finalgeometry = NOMORE + if line[1:27]=='Geometry Convergence Tests': # Extract Geometry convergence information if not hasattr(self,"geotargets"): @@ -652,13 +647,16 @@ if self.progress: self.progress.update(nstep,"Done") - + if hasattr(self,"geovalues"): self.geovalues = Numeric.array(self.geovalues,"f") if hasattr(self,"scfenergies"): self.scfenergies = Numeric.array(self.scfenergies,"f") if hasattr(self,"scfvalues"): self.scfvalues = [Numeric.array(x,"f") for x in self.scfvalues] - self.parsed = True if hasattr(self,"moenergies"): self.nmo = len(self.moenergies[0]) + if hasattr(self,"atomcoords"): self.atomcoords = Numeric.array(self.atomcoords,"f") + self.parsed = True + + # Note to self: Needs to be added to the main parser This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bao...@us...> - 2006-06-16 15:39:18
|
Revision: 212 Author: baoilleach Date: 2006-06-16 08:39:09 -0700 (Fri, 16 Jun 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=212&view=rev Log Message: ----------- Pylint recommended changes. Modified Paths: -------------- trunk/src/cclib/parser/adfparser.py This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |