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. |