From: <bao...@us...> - 2006-03-19 19:53:06
|
Revision: 29 Author: baoilleach Date: 2006-03-19 11:52:56 -0800 (Sun, 19 Mar 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=29&view=rev Log Message: ----------- Now the gamessparser can parse (correctly or not) all of the dvb test files. Modified Paths: -------------- trunk/src/cclib/parser/gamessparser.py Modified: trunk/src/cclib/parser/gamessparser.py =================================================================== --- trunk/src/cclib/parser/gamessparser.py 2006-03-19 19:51:04 UTC (rev 28) +++ trunk/src/cclib/parser/gamessparser.py 2006-03-19 19:52:56 UTC (rev 29) @@ -77,32 +77,28 @@ opttol = float(x.split('=')[1]) self.geotargets = Numeric.array([opttol,3./opttol]) - if line.find("EQUILIBRIUM GEOMETRY LOCATED")>=0: -# This is necessary if a frequency calculation follows a geometry optimisation - endofopt = True - - if not endofopt and line.find("FINAL")==1: + if line.find("FINAL")==1: if not hasattr(self,"scfenergies"): self.logger.info("Creating attribute scfenergies[]") self.scfenergies = [] -# Here is an example from Neil Berry: +# Has to deal with such lines as: # FINAL R-B3LYP ENERGY IS -382.0507446475 AFTER 10 ITERATIONS -# but in some cases the energy can be in position [3] not [4] so let's -# take the number after the "IS" +# FINAL ENERGY IS -379.7594673378 AFTER 9 ITERATIONS +# ...so take the number after the "IS" temp = line.split() self.scfenergies.append(temp[temp.index("IS")+1]) - if not endofopt and line.find("MAXIMUM GRADIENT")>0: + if line.find("MAXIMUM GRADIENT")>0: if not hasattr(self,"geovalues"): self.logger.info("Creating attribute geovalues[]") self.geovalues = [] temp = line.strip().split() self.geovalues.append([float(temp[3]),float(temp[7])]) - - if line.find("DENSITY CONV=")==5: - self.scftargets[0] = float(line.strip().split()[-1]) + if not hasattr(self,"scftargets"): + self.logger.info("Creating attribute scftargets") + self.scftargets = Numeric.array([float(line.strip().split()[-1])]) if line.find("ITER EX DEM")==1: # This is the section with the SCF information @@ -127,7 +123,38 @@ self.scfvalues.append(den) if line.find("NORMAL COORDINATE ANALYSIS IN THE HARMONIC APPROXIMATION")>=0: - # Start of the frequency section +# GAMESS has... +# MODES 1 TO 6 ARE TAKEN AS ROTATIONS AND TRANSLATIONS. +# +# FREQUENCIES IN CM**-1, IR INTENSITIES IN DEBYE**2/AMU-ANGSTROM**2, +# REDUCED MASSES IN AMU. +# +# 1 2 3 4 5 +# FREQUENCY: 52.49 41.45 17.61 9.23 10.61 +# REDUCED MASS: 3.92418 3.77048 5.43419 6.44636 5.50693 +# IR INTENSITY: 0.00013 0.00001 0.00004 0.00000 0.00003 + +# whereas PC-GAMESS has... +# MODES 1 TO 6 ARE TAKEN AS ROTATIONS AND TRANSLATIONS. +# +# FREQUENCIES IN CM**-1, IR INTENSITIES IN DEBYE**2/AMU-ANGSTROM**2 +# +# 1 2 3 4 5 +# FREQUENCY: 5.89 1.46 0.01 0.01 0.01 +# IR INTENSITY: 0.00000 0.00000 0.00000 0.00000 0.00000 + +# If Raman is present we have (for PC-GAMESS)... +# MODES 1 TO 6 ARE TAKEN AS ROTATIONS AND TRANSLATIONS. +# +# FREQUENCIES IN CM**-1, IR INTENSITIES IN DEBYE**2/AMU-ANGSTROM**2 +# RAMAN INTENSITIES IN ANGSTROM**4/AMU, DEPOLARIZATIONS ARE DIMENSIONLESS +# +# 1 2 3 4 5 +# FREQUENCY: 5.89 1.46 0.04 0.03 0.01 +# IR INTENSITY: 0.00000 0.00000 0.00000 0.00000 0.00000 +# RAMAN INTENSITY: 12.675 1.828 0.000 0.000 0.000 +# DEPOLARIZATION: 0.750 0.750 0.124 0.009 0.750 + self.logger.info("Creating attributes vibfreqs, vibirs") self.vibfreqs = [] self.vibirs = [] @@ -143,22 +170,32 @@ numAtom += 1 line = inputfile.next() - # Print out the following lines which may contain some useful info: - # e.g. WARNING, MODE 7 HAS BEEN CHOSEN AS A VIBRATION line = inputfile.next() while line.find("FREQUENCIES IN CM**-1")==-1: line = inputfile.next() - line = inputfile.next() - - blank = inputfile.next() + while line!=blank: + line = inputfile.next() + freqNo = inputfile.next() while freqNo.find("SAYVETZ")==-1: freq = inputfile.next().strip().split() self.vibfreqs.extend(map(float,freq[1:])) - reducedMass = inputfile.next() - irIntensity = inputfile.next().strip().split() + line = inputfile.next() + if line.find("REDUCED")>=0: # skip the reduced mass (not always present) + line = inputfile.next() + irIntensity = line.strip().split() self.vibirs.extend(map(float,irIntensity[2:])) - blank = inputfile.next() + line = inputfile.next() + if line.find("RAMAN")>=0: + if not hasattr(self,"vibramans"): + self.logger.info("Creating attribute vibramans") + self.vibramans = [] + ramanIntensity = line.strip().split() + self.vibramans.extend(map(float,ramanIntensity[2:])) + depolar = inputfile.next() + line = inputfile.next() + assert line==blank + # Skip XYZ data for each atom plus # the Sayvetz stuff at the end for j in range(numAtom*3+10): @@ -177,24 +214,22 @@ # Take the last one of either in the file if not hasattr(self,"moenergies"): self.logger.info("Creating attributes moenergies, mosyms") - self.moenergies = [] + self.moenergies = [[]] self.mosyms = [] if not hasattr(self,"nindep"): self.logger.info("Creating attribute nindep with default value") self.nindep = self.nbasis self.mocoeffs = Numeric.zeros((1,self.nindep,self.nbasis),"f") line = inputfile.next() - blank = inputfile.next() # blank line - base = 0 - while line.find("END OF RHF")==-1: + for base in range(0,self.nindep,5): + blank = inputfile.next() line = inputfile.next() # Eigenvector no line = inputfile.next() - self.moenergies.extend(map(float,line.split())) + self.moenergies[0].extend([convertor(float(x),"hartree","eV") for x in line.split()]) line = inputfile.next() self.mosyms.extend(line.split()) - line = inputfile.next() - i=0 - while line!=blank and line.find("END OF RHF")==-1: + for i in range(self.nbasis): + line = inputfile.next() if base==0: # Just do this the first time 'round atomno=int(line.split()[2])-1 # atomorb[atomno].append(int(line.split()[0])-1) @@ -204,16 +239,46 @@ while j*11+4<len(temp): self.mocoeffs[0,base+j,i] = float(temp[j*11:(j+1)*11]) j+=1 + line = inputfile.next() + if line.find("END OF RHF")==-1: # implies unrestricted +# If it's restricted we have +# ...... END OF RHF CALCULATION ...... +# If it's unrestricted we have... +# +# ----- BETA SET ----- +# +# ------------ +# EIGENVECTORS +# ------------ +# +# 1 2 3 4 5 + + self.mocoeffs.resize((2,self.nindep,self.nbasis)) + for i in range(5): line = inputfile.next() - i+=1 - base+=5 + for base in range(0,self.nindep,5): + blank = inputfile.next() + line = inputfile.next() # Eigenvector no + line = inputfile.next() + self.moenergies.extend(map(float,line.split())) + line = inputfile.next() + self.mosyms.extend(line.split()) + for i in range(self.nbasis): + line = inputfile.next() + temp = line[15:] # Strip off the crud at the start + j = 0 + while j*11+4<len(temp): + self.mocoeffs[1,base+j,i] = float(temp[j*11:(j+1)*11]) + j+=1 + line = inputfile.next() + assert line.find("END OF")>=0 self.moenergies = Numeric.array(self.moenergies,"f") if line.find("NUMBER OF OCCUPIED ORBITALS")>=0: if not hasattr(self,"homos"): self.logger.info("Creating attribute homos") temp = line.strip().split('=') - self.homos = Numeric.array(int(temp[-1])-1,"d") + self.homos = Numeric.array([int(temp[-1])-1],"i") if line.find("TOTAL NUMBER OF ATOMS")==1: self.logger.info("Creating attribute natom") @@ -234,8 +299,11 @@ elif line.find("OVERLAP MATRIX")==0 or line.find("OVERLAP MATRIX")==1: # The first is for PC-GAMESS, the second for GAMESS # Read 1-electron overlap matrix - self.logger.info("Creating attribute aooverlaps") - self.aooverlaps = Numeric.zeros((self.nbasis,self.nbasis), "f") + if not hasattr(self,"aooverlaps"): + self.logger.info("Creating attribute aooverlaps") + self.aooverlaps = Numeric.zeros((self.nbasis,self.nbasis), "f") + else: + self.logger.info("Reading additional aooverlaps...") base = 0 while base<self.nbasis: blank = 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-03 15:44:52
|
Revision: 48 Author: baoilleach Date: 2006-04-03 08:44:45 -0700 (Mon, 03 Apr 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=48&view=rev Log Message: ----------- When terminating loops by searching for blank lines, it is better to use: while line.strip(): line = inputfile.next() rather than: while line!="\n": line = inputfile.next() as the latter is not cross-platform (i.e. it failed on Linux when dealing with GAMESS files created on Windows). Two changes were made to the gamessparser in this respect. Modified Paths: -------------- trunk/src/cclib/parser/gamessparser.py Modified: trunk/src/cclib/parser/gamessparser.py =================================================================== --- trunk/src/cclib/parser/gamessparser.py 2006-04-03 15:01:48 UTC (rev 47) +++ trunk/src/cclib/parser/gamessparser.py 2006-04-03 15:44:45 UTC (rev 48) @@ -107,7 +107,7 @@ self.scfvalues = [] line = inputfile.next() den = [] - while line!='\n': + while line.strip(): # The SCF information is terminated by a blank line try: temp = int(line[0:4]) @@ -166,7 +166,7 @@ blank = inputfile.next() line = inputfile.next() numAtom = 0 - while line!="\n": + while line.strip(): numAtom += 1 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-03 15:52:36
|
Revision: 50 Author: baoilleach Date: 2006-04-03 08:52:28 -0700 (Mon, 03 Apr 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=50&view=rev Log Message: ----------- Fixed bug: Forgot to convert scfenergies to floats Modified Paths: -------------- trunk/src/cclib/parser/gamessparser.py Modified: trunk/src/cclib/parser/gamessparser.py =================================================================== --- trunk/src/cclib/parser/gamessparser.py 2006-04-03 15:48:50 UTC (rev 49) +++ trunk/src/cclib/parser/gamessparser.py 2006-04-03 15:52:28 UTC (rev 50) @@ -86,7 +86,7 @@ # FINAL ENERGY IS -379.7594673378 AFTER 9 ITERATIONS # ...so take the number after the "IS" temp = line.split() - self.scfenergies.append(temp[temp.index("IS")+1]) + self.scfenergies.append(float(temp[temp.index("IS")+1])) if line.find("MAXIMUM GRADIENT")>0: if not hasattr(self,"geovalues"): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bao...@us...> - 2006-04-04 08:33:29
|
Revision: 53 Author: baoilleach Date: 2006-04-04 01:33:23 -0700 (Tue, 04 Apr 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=53&view=rev Log Message: ----------- Fixed handling of MO symmetries and evalues for unrestricted calculations Modified Paths: -------------- trunk/src/cclib/parser/gamessparser.py Modified: trunk/src/cclib/parser/gamessparser.py =================================================================== --- trunk/src/cclib/parser/gamessparser.py 2006-04-03 20:09:44 UTC (rev 52) +++ trunk/src/cclib/parser/gamessparser.py 2006-04-04 08:33:23 UTC (rev 53) @@ -215,7 +215,7 @@ if not hasattr(self,"moenergies"): self.logger.info("Creating attributes moenergies, mosyms") self.moenergies = [[]] - self.mosyms = [] + self.mosyms = [[]] if not hasattr(self,"nindep"): self.logger.info("Creating attribute nindep with default value") self.nindep = self.nbasis @@ -227,7 +227,7 @@ line = inputfile.next() self.moenergies[0].extend([convertor(float(x),"hartree","eV") for x in line.split()]) line = inputfile.next() - self.mosyms.extend(line.split()) + self.mosyms[0].extend(line.split()) for i in range(self.nbasis): line = inputfile.next() if base==0: # Just do this the first time 'round @@ -254,15 +254,17 @@ # 1 2 3 4 5 self.mocoeffs.resize((2,self.nindep,self.nbasis)) + self.moenergies.append([]) + self.mosyms.append([]) for i in range(5): line = inputfile.next() for base in range(0,self.nindep,5): blank = inputfile.next() line = inputfile.next() # Eigenvector no line = inputfile.next() - self.moenergies.extend(map(float,line.split())) + self.moenergies[1].extend([convertor(float(x),"hartree","eV") for x in line.split()]) line = inputfile.next() - self.mosyms.extend(line.split()) + self.mosyms[1].extend(line.split()) for i in range(self.nbasis): line = inputfile.next() temp = line[15:] # Strip off the crud at the start This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bao...@us...> - 2006-04-14 14:23:31
|
Revision: 66 Author: baoilleach Date: 2006-04-14 07:23:25 -0700 (Fri, 14 Apr 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=66&view=rev Log Message: ----------- Added function and doctests for normalising symmetry...but I forgot to call it...oh well, next time. Modified Paths: -------------- trunk/src/cclib/parser/gamessparser.py Modified: trunk/src/cclib/parser/gamessparser.py =================================================================== --- trunk/src/cclib/parser/gamessparser.py 2006-04-14 01:07:57 UTC (rev 65) +++ trunk/src/cclib/parser/gamessparser.py 2006-04-14 14:23:25 UTC (rev 66) @@ -38,6 +38,26 @@ """Return a representation of the object.""" return 'GAMESS("%s")' % (self.filename) + def normalisesym(self,label): + """Normalise the symmetries used by GAMESS. + + To normalise, two rules need to be applied: + (1) Occurences of U/G in the 2/3 position of the label + must be lower-cased + (2) Two single quotation marks must be replaced by a double + + >>> t = GAMESS("dummyfile").normalisesym + >>> labels = ['A','A1','A1G',"A'","A''","AG"] + >>> answers = map(t,labels) + >>> print answers + ['A', 'A1', 'A1g', "A'", 'A"', 'Ag'] + """ + if label[1:] == "''": + end = '"' + else: + end = label[1:].replace("U","u").replace("G","g") + return label[0] + end + def parse(self): """Extract information from the logfile.""" inputfile = open(self.filename,"r") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bao...@us...> - 2006-05-19 20:50:25
|
Revision: 131 Author: baoilleach Date: 2006-05-19 13:50:15 -0700 (Fri, 19 May 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=131&view=rev Log Message: ----------- Normalised the numbering system for GAMESS so that it agrees with Gaussian. The specific orbital names are different but this is just a question of finding the correct mapping. Orbital names are now unique. See the wiki for more details on the specifics. Modified Paths: -------------- trunk/src/cclib/parser/gamessparser.py Modified: trunk/src/cclib/parser/gamessparser.py =================================================================== --- trunk/src/cclib/parser/gamessparser.py 2006-05-19 17:29:54 UTC (rev 130) +++ trunk/src/cclib/parser/gamessparser.py 2006-05-19 20:50:15 UTC (rev 131) @@ -70,21 +70,21 @@ >>> data = [' 5 C 1 S ', ' 6 C 1 S ',\ ' 7 C 1 S ', ' 56 C 1XXXX '] >>> print t.normalise_aonames(data) - ['C1_1S', 'C1_2S', 'C1_3S', 'C1_1XXXX'] + ['C1_1S', 'C1_2S', 'C1_3S', 'C1_4XXXX'] """ p = re.compile("(\d+)\s*([A-Z][a-z]?)\s*(\d+)\s*([A-Z]+)") ans = [] + i = 0 for line in listoflines: m = p.search(line.strip()) assert m, "Cannot pick out the aoname from this information: %s" % line - g = m.groups() - i = 1 + if g[3] in ['S','X','XX','XXX','XXXX']: + i += 1 aoname = "%s%s_%d%s" % (g[1],g[2],i,g[3]) - while aoname in ans: # Ensures unique aoname - i += 1 - aoname = "%s%s_%d%s" % (g[1],g[2],i,g[3]) ans.append(aoname) + + return ans def parse(self): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bao...@us...> - 2006-07-31 07:20:03
|
Revision: 273 Author: baoilleach Date: 2006-07-31 00:19:48 -0700 (Mon, 31 Jul 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=273&view=rev Log Message: ----------- GAMESS US: added ability to extract gbasis...but only extracts the basis set for the symmetry inequivalent atoms. Need to find some way around this. Modified Paths: -------------- trunk/src/cclib/parser/gamessparser.py This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bao...@us...> - 2006-08-10 20:38:38
|
Revision: 298 Author: baoilleach Date: 2006-08-10 13:38:31 -0700 (Thu, 10 Aug 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=298&view=rev Log Message: ----------- GAMESS parser: assert statement caught a 'new' orbital type in C_bigbasis.out Modified Paths: -------------- trunk/src/cclib/parser/gamessparser.py This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ate...@us...> - 2007-01-22 21:55:02
|
Revision: 459 http://svn.sourceforge.net/cclib/?rev=459&view=rev Author: atenderholt Date: 2007-01-22 13:54:58 -0800 (Mon, 22 Jan 2007) Log Message: ----------- Update the GAMESS parser to include support for parsing MP2 energies (from Karol Langner) Modified Paths: -------------- trunk/src/cclib/parser/gamessparser.py This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <la...@us...> - 2007-03-01 12:08:54
|
Revision: 560 http://svn.sourceforge.net/cclib/?rev=560&view=rev Author: langner Date: 2007-03-01 04:08:49 -0800 (Thu, 01 Mar 2007) Log Message: ----------- Fixed mpenergies parsing in GAMESS (I don't know how this got broken?). Modified Paths: -------------- trunk/src/cclib/parser/gamessparser.py This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bao...@us...> - 2006-04-15 09:29:06
|
Revision: 73 Author: baoilleach Date: 2006-04-15 02:28:56 -0700 (Sat, 15 Apr 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=73&view=rev Log Message: ----------- Added call to normalisesym so that mosyms should now contain the correct symmetries. Modified Paths: -------------- trunk/src/cclib/parser/gamessparser.py Modified: trunk/src/cclib/parser/gamessparser.py =================================================================== --- trunk/src/cclib/parser/gamessparser.py 2006-04-15 09:25:14 UTC (rev 72) +++ trunk/src/cclib/parser/gamessparser.py 2006-04-15 09:28:56 UTC (rev 73) @@ -247,7 +247,7 @@ line = inputfile.next() self.moenergies[0].extend([convertor(float(x),"hartree","eV") for x in line.split()]) line = inputfile.next() - self.mosyms[0].extend(line.split()) + self.mosyms[0].extend(map(self.normalisesym,line.split())) for i in range(self.nbasis): line = inputfile.next() if base==0: # Just do this the first time 'round @@ -284,7 +284,7 @@ line = inputfile.next() self.moenergies[1].extend([convertor(float(x),"hartree","eV") for x in line.split()]) line = inputfile.next() - self.mosyms[1].extend(line.split()) + self.mosyms[1].extend(map(self.normalisesym,line.split())) for i in range(self.nbasis): line = inputfile.next() temp = line[15:] # Strip off the crud at the start This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bao...@us...> - 2006-04-22 10:00:26
|
Revision: 81 Author: baoilleach Date: 2006-04-22 03:00:16 -0700 (Sat, 22 Apr 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=81&view=rev Log Message: ----------- Updated types of scfvalues to be a list of Numeric arrays Modified Paths: -------------- trunk/src/cclib/parser/gamessparser.py Modified: trunk/src/cclib/parser/gamessparser.py =================================================================== --- trunk/src/cclib/parser/gamessparser.py 2006-04-22 09:27:04 UTC (rev 80) +++ trunk/src/cclib/parser/gamessparser.py 2006-04-22 10:00:16 UTC (rev 81) @@ -126,7 +126,7 @@ self.logger.info("Creating attribute scfvalues") self.scfvalues = [] line = inputfile.next() - den = [] + values = [] while line.strip(): # The SCF information is terminated by a blank line try: @@ -138,9 +138,9 @@ # DFT CODE IS SWITCHING BACK TO THE FINER GRID pass else: - den.append(float(line.split()[5])) + values.append(float(line.split()[5])) line = inputfile.next() - self.scfvalues.append(den) + self.scfvalues.append([values]) if line.find("NORMAL COORDINATE ANALYSIS IN THE HARMONIC APPROXIMATION")>=0: # GAMESS has... @@ -348,6 +348,8 @@ if not hasattr(self,"scftargets"): self.logger.info("Creating attribute scftargets[] with default values") self.scftargets = Numeric.array([1e-5]) + if hasattr(self,"scfvalues"): + self.scfvalues = [Numeric.array(x,"f") for x in self.scfvalues] if hasattr(self,"geovalues"): self.geovalues = Numeric.array(self.geovalues,"f") if not hasattr(self,"nindep"): self.logger.info("Creating attribute nindep with default value") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bao...@us...> - 2006-05-17 16:27:44
|
Revision: 122 Author: baoilleach Date: 2006-05-17 09:27:40 -0700 (Wed, 17 May 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=122&view=rev Log Message: ----------- Now parses aonames (not normalised to Gaussian though), and started work on parsing atomnos and atomcoords Modified Paths: -------------- trunk/src/cclib/parser/gamessparser.py Modified: trunk/src/cclib/parser/gamessparser.py =================================================================== --- trunk/src/cclib/parser/gamessparser.py 2006-05-17 16:22:09 UTC (rev 121) +++ trunk/src/cclib/parser/gamessparser.py 2006-05-17 16:27:40 UTC (rev 122) @@ -20,7 +20,7 @@ import re,time import Numeric import random # For sometimes running the progress updater -from logfileparser import Logfile,convertor +from logfileparser import Logfile,convertor,PeriodicTable class GAMESS(Logfile): """A GAMESS log file.""" @@ -29,6 +29,8 @@ # Call the __init__ method of the superclass super(GAMESS, self).__init__(logname="GAMESS",*args) + + self.pt = PeriodicTable() def __str__(self): """Return a string representation of the object.""" @@ -120,6 +122,31 @@ self.logger.info("Creating attribute scftargets") self.scftargets = Numeric.array([float(line.strip().split()[-1])]) + if line[11:50]=="ATOMIC COORDINATES": + # This is the input orientation, which is the only data available for + # SP calcs, but which should be overwritten by the standard orientation + # values, which is the only information available for all geoopt cycles. + if not hasattr(self,"atomcoords"): + self.logger.info("Creating attribute atomcoords, atomnos") + self.atomcoords = [] + self.atomnos = [] + line = inputfile.next() + atomcoords = [] + atomnos = [] + line = inputfile.next() + while line.strip(): + temp = line.strip().split() + atomcoords.append(map(float,temp[2:4])) + atomnos.append(self.pt.number[temp[0]]) # Use the element name + line = inputfile.next() + self.atomnos = Numeric.array(atomnos,"i") + self.atomcoords.append(atomcoords) + + if line[1:37]=="COORDINATES OF ALL ATOMS ARE": + # This is the standard orientation, which is the only coordinate + # information available for all geometry optimisation cycles. + pass + if line.find("ITER EX DEM")==1: # This is the section with the SCF information if not hasattr(self,"scfvalues"): @@ -322,8 +349,9 @@ # The first is for PC-GAMESS, the second for GAMESS # Read 1-electron overlap matrix if not hasattr(self,"aooverlaps"): - self.logger.info("Creating attribute aooverlaps") + self.logger.info("Creating attribute aooverlaps, aonames") self.aooverlaps = Numeric.zeros((self.nbasis,self.nbasis), "f") + self.aonames = [] else: self.logger.info("Reading additional aooverlaps...") base = 0 @@ -334,10 +362,12 @@ for i in range(self.nbasis-base): # Fewer lines each time line = inputfile.next() temp = line.split() + if base==0: # Only do this for the first block + self.aonames.append("%s%s_%s" % (temp[1],temp[2],temp[3])) for j in range(4,len(temp)): self.aooverlaps[base+j-4,i+base] = float(temp[j]) self.aooverlaps[i+base,base+j-4] = float(temp[j]) - base+=5 + base += 5 inputfile.close() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bao...@us...> - 2006-05-19 16:37:46
|
Revision: 129 Author: baoilleach Date: 2006-05-19 09:37:32 -0700 (Fri, 19 May 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=129&view=rev Log Message: ----------- Added ability to handle ISPHER, and also normalised the aonames somewhat...some more work needs to be done here. Modified Paths: -------------- trunk/src/cclib/parser/gamessparser.py Modified: trunk/src/cclib/parser/gamessparser.py =================================================================== --- trunk/src/cclib/parser/gamessparser.py 2006-05-19 09:03:53 UTC (rev 128) +++ trunk/src/cclib/parser/gamessparser.py 2006-05-19 16:37:32 UTC (rev 129) @@ -59,6 +59,34 @@ end = label[1:].replace("U","u").replace("G","g") return label[0] + end + def normalise_aonames(self,listoflines): + """Normalise the aonames attribute to agree with the other parsers. + + We want this to work even if there are 1000+ atoms. Our only assumption + is that all of the relevant information is in the first 17 characters + of the line. + + >>> t = GAMESS("dummyfile") + >>> data = [' 5 C 1 S ', ' 6 C 1 S ',\ + ' 7 C 1 S ', ' 56 C 1XXXX '] + >>> print t.normalise_aonames(data) + ['C1_1S', 'C1_2S', 'C1_3S', 'C1_1XXXX'] + """ + p = re.compile("(\d+)\s*([A-Z][a-z]?)\s*(\d+)\s*([A-Z]+)") + ans = [] + for line in listoflines: + m = p.search(line.strip()) + assert m, "Cannot pick out the aoname from this information: %s" % line + + g = m.groups() + i = 1 + aoname = "%s%s_%d%s" % (g[1],g[2],i,g[3]) + while aoname in ans: # Ensures unique aoname + i += 1 + aoname = "%s%s_%d%s" % (g[1],g[2],i,g[3]) + ans.append(aoname) + return ans + def parse(self): """Extract information from the logfile.""" inputfile = open(self.filename,"r") @@ -291,8 +319,8 @@ self.mosyms[0].extend(map(self.normalisesym,line.split())) for i in range(self.nbasis): line = inputfile.next() - if base==0: # Just do this the first time 'round - atomno=int(line.split()[2])-1 + # if base==0: # Just do this the first time 'round + # atomno=int(line.split()[2])-1 # atomorb[atomno].append(int(line.split()[0])-1) # What's the story with the previous line? temp = line[15:] # Strip off the crud at the start @@ -351,14 +379,21 @@ # The first is from Julien's Example and the second is from Alexander's # I think it happens if you use a polar basis function instead of a cartesian one self.logger.info("Creating attribute nbasis") - self.nbasis = int(line.split()[-1]) + self.nbasis = int(line.strip().split()[-1]) + elif line.find("SPHERICAL HARMONICS KEPT IN THE VARIATION SPACE")>=0: + # Note that this line is present if ISPHER=1, e.g. for C_bigbasis + if not hasattr(self,"nmo"): + self.logger.info("Creating attribute nmo") + self.nmo = int(line.strip().split()[-1]) + elif line.find("TOTAL NUMBER OF MOS IN VARIATION SPACE")==1: # Note that this line is not always present, so by default # NBsUse is set equal to NBasis (see below). - self.logger.info("Creating attribute nmo") - self.indep = int(line.split()[-1]) - + if not hasattr(self,"nmo"): + self.logger.info("Creating attribute nmo") + self.nmo = int(line.split()[-1]) + elif line.find("OVERLAP MATRIX")==0 or line.find("OVERLAP MATRIX")==1: # The first is for PC-GAMESS, the second for GAMESS # Read 1-electron overlap matrix @@ -369,6 +404,7 @@ else: self.logger.info("Reading additional aooverlaps...") base = 0 + aonames = [] while base<self.nbasis: blank = inputfile.next() line = inputfile.next() # Basis fn number @@ -377,11 +413,12 @@ line = inputfile.next() temp = line.split() if base==0: # Only do this for the first block - self.aonames.append("%s%s_%s" % (temp[1],temp[2],temp[3])) + aonames.append(line[:17]) for j in range(4,len(temp)): self.aooverlaps[base+j-4,i+base] = float(temp[j]) self.aooverlaps[i+base,base+j-4] = float(temp[j]) base += 5 + self.aonames = self.normalise_aonames(aonames) inputfile.close() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bao...@us...> - 2006-05-19 21:13:34
|
Revision: 132 Author: baoilleach Date: 2006-05-19 14:13:29 -0700 (Fri, 19 May 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=132&view=rev Log Message: ----------- Normalised the aonames a little bit more. Have realised that it is not possible to normalise completely...oh well. Modified Paths: -------------- trunk/src/cclib/parser/gamessparser.py Modified: trunk/src/cclib/parser/gamessparser.py =================================================================== --- trunk/src/cclib/parser/gamessparser.py 2006-05-19 20:50:15 UTC (rev 131) +++ trunk/src/cclib/parser/gamessparser.py 2006-05-19 21:13:29 UTC (rev 132) @@ -68,23 +68,27 @@ >>> t = GAMESS("dummyfile") >>> data = [' 5 C 1 S ', ' 6 C 1 S ',\ - ' 7 C 1 S ', ' 56 C 1XXXX '] + ' 7 C 1 S ', ' 56 C 1XXXX ',\ + ' 100 C 2 S ' ] >>> print t.normalise_aonames(data) - ['C1_1S', 'C1_2S', 'C1_3S', 'C1_4XXXX'] + ['C1_1S', 'C1_2S', 'C1_3S', 'C1_4XXXX', 'C2_1S'] """ p = re.compile("(\d+)\s*([A-Z][a-z]?)\s*(\d+)\s*([A-Z]+)") ans = [] i = 0 + oldatom = "0" for line in listoflines: m = p.search(line.strip()) assert m, "Cannot pick out the aoname from this information: %s" % line g = m.groups() if g[3] in ['S','X','XX','XXX','XXXX']: i += 1 + if g[2]!=oldatom: # Reset for a new atom + i = 1 aoname = "%s%s_%d%s" % (g[1],g[2],i,g[3]) + oldatom = g[2] ans.append(aoname) - return ans def parse(self): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bao...@us...> - 2006-05-21 21:32:29
|
Revision: 138 Author: baoilleach Date: 2006-05-21 14:32:24 -0700 (Sun, 21 May 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=138&view=rev Log Message: ----------- Improved parsing of atomcoords for GAMESS, although still off by one compared to geovalues. Modified Paths: -------------- trunk/src/cclib/parser/gamessparser.py Modified: trunk/src/cclib/parser/gamessparser.py =================================================================== --- trunk/src/cclib/parser/gamessparser.py 2006-05-21 17:43:52 UTC (rev 137) +++ trunk/src/cclib/parser/gamessparser.py 2006-05-21 21:32:24 UTC (rev 138) @@ -173,7 +173,7 @@ self.atomnos = Numeric.array(atomnos,"i") self.atomcoords.append(atomcoords) - if line[1:37]=="COORDINATES OF ALL ATOMS ARE": + if line[1:29]=="COORDINATES OF ALL ATOMS ARE": # 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 @@ -186,7 +186,9 @@ line = inputfile.next() hyphens = inputfile.next() + atomcoords = [] + line = inputfile.next() while line.strip(): temp = line.strip().split() atomcoords.append(map(float,temp[2:4])) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bao...@us...> - 2006-05-24 19:43:47
|
Revision: 157 Author: baoilleach Date: 2006-05-24 12:43:41 -0700 (Wed, 24 May 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=157&view=rev Log Message: ----------- homos parsed correctly for both restricted and unrestricted calculations. Modified Paths: -------------- trunk/src/cclib/parser/gamessparser.py Modified: trunk/src/cclib/parser/gamessparser.py =================================================================== --- trunk/src/cclib/parser/gamessparser.py 2006-05-24 19:16:00 UTC (rev 156) +++ trunk/src/cclib/parser/gamessparser.py 2006-05-24 19:43:41 UTC (rev 157) @@ -379,9 +379,22 @@ if line.find("NUMBER OF OCCUPIED ORBITALS")>=0: if not hasattr(self,"homos"): self.logger.info("Creating attribute homos") - temp = line.strip().split('=') - self.homos = Numeric.array([int(temp[-1])-1],"i") + homos = [int(line.split()[-1])-1] + line = inputfile.next() + homos.append(int(line.split()[-1])-1) + # Note that we cannot trust this self.homos until we come to + # a line that contains the phrase: + # "SYMMETRIES FOR INITAL GUESS ORBITALS FOLLOW" + # which either is followed by "ALPHA" or "BOTH" + # at which point we can say for certain that it is an + # un/restricted calculations + self.homos = Numeric.array(homos,"i") + if line.find("SYMMETRIES FOR INITIAL GUESS ORBITALS FOLLOW")>=0: + # Not unrestricted, so lop off the second index + if line.find("BOTH SET(S)")>=0: + self.homos = Numeric.resize(self.homos,[1]) + if line.find("TOTAL NUMBER OF ATOMS")==1: self.logger.info("Creating attribute natom") self.natom = int(line.split()[-1]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bao...@us...> - 2006-06-18 14:53:55
|
Revision: 217 Author: baoilleach Date: 2006-06-18 07:53:43 -0700 (Sun, 18 Jun 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=217&view=rev Log Message: ----------- Implemented all pylint recommmendations on spacing Modified Paths: -------------- trunk/src/cclib/parser/gamessparser.py This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bao...@us...> - 2006-07-21 08:48:21
|
Revision: 253 Author: baoilleach Date: 2006-07-21 01:47:59 -0700 (Fri, 21 Jul 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=253&view=rev Log Message: ----------- Changed reference to removed conversion Modified Paths: -------------- trunk/src/cclib/parser/gamessparser.py This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bao...@us...> - 2006-08-01 08:23:20
|
Revision: 274 Author: baoilleach Date: 2006-08-01 01:23:08 -0700 (Tue, 01 Aug 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=274&view=rev Log Message: ----------- GAMESS parser: fixed a bug that bug that I should have caught when by running the tests. Turns out that PC GAMESS and GAMESS UK have slightly different printouts of the Gaussian basis. Modified Paths: -------------- trunk/src/cclib/parser/gamessparser.py This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ate...@us...> - 2006-10-31 02:04:45
|
Revision: 398 http://svn.sourceforge.net/cclib/?rev=398&view=rev Author: atenderholt Date: 2006-10-30 18:04:35 -0800 (Mon, 30 Oct 2006) Log Message: ----------- GAMESS parser: Added a coreelectrons attribute, although should only have zeros because there isn't an example file with a frozen core Modified Paths: -------------- trunk/src/cclib/parser/gamessparser.py This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bao...@us...> - 2007-02-24 13:44:05
|
Revision: 545 http://svn.sourceforge.net/cclib/?rev=545&view=rev Author: baoilleach Date: 2007-02-24 05:44:03 -0800 (Sat, 24 Feb 2007) Log Message: ----------- A few fixes for GAMESS: (1) Was failing to parse a DFT calculation (2) frequencies: When leaving out the 5/6 rotations and translations, I found that they aren't always the first 5/6 (3) frequencies: Can now handle imaginary frequencies (returned as a negative value) Modified Paths: -------------- trunk/src/cclib/parser/gamessparser.py This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <la...@us...> - 2007-03-29 19:19:53
|
Revision: 606 http://svn.sourceforge.net/cclib/?rev=606&view=rev Author: langner Date: 2007-03-29 12:19:29 -0700 (Thu, 29 Mar 2007) Log Message: ----------- Unnormalized etsecs in GAMESS for hamtyp-dets in CIS calcualtions. Modified Paths: -------------- trunk/src/cclib/parser/gamessparser.py This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bao...@us...> - 2007-06-23 19:21:11
|
Revision: 656 http://svn.sourceforge.net/cclib/?rev=656&view=rev Author: baoilleach Date: 2007-06-23 12:20:44 -0700 (Sat, 23 Jun 2007) Log Message: ----------- Revert of r635 (only the gamessparser.py part though) as C_bigbasis.out was failing in regression.py. Modified Paths: -------------- trunk/src/cclib/parser/gamessparser.py This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bao...@us...> - 2007-06-25 18:56:08
|
Revision: 664 http://svn.sourceforge.net/cclib/?rev=664&view=rev Author: baoilleach Date: 2007-06-25 11:56:06 -0700 (Mon, 25 Jun 2007) Log Message: ----------- PCGAMESS: Fixed problems with aonames. Problems remain with atomno at line 599. Modified Paths: -------------- trunk/src/cclib/parser/gamessparser.py This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |