From: <bao...@us...> - 2006-05-17 17:13:53
|
Revision: 123 Author: baoilleach Date: 2006-05-17 09:56:45 -0700 (Wed, 17 May 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=123&view=rev Log Message: ----------- Completed parsing of atomcoords...still passes tests, although I haven't checked the output to see if it makes sense. Modified Paths: -------------- trunk/src/cclib/parser/gamessparser.py trunk/src/cclib/parser/logfileparser.py Modified: trunk/src/cclib/parser/gamessparser.py =================================================================== --- trunk/src/cclib/parser/gamessparser.py 2006-05-17 16:27:40 UTC (rev 122) +++ trunk/src/cclib/parser/gamessparser.py 2006-05-17 16:56:45 UTC (rev 123) @@ -73,7 +73,7 @@ oldstep=0 - endofopt = False + firststdorient = True # Used to decide whether to wipe the atomcoords clean for line in inputfile: @@ -136,7 +136,7 @@ line = inputfile.next() while line.strip(): temp = line.strip().split() - atomcoords.append(map(float,temp[2:4])) + atomcoords.append([convertor(float(x),"au","Ang") for x in temp[2:4]]) atomnos.append(self.pt.number[temp[0]]) # Use the element name line = inputfile.next() self.atomnos = Numeric.array(atomnos,"i") @@ -145,7 +145,22 @@ 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 + # The input orientation will be overwritten if this is a geometry optimisation + # We assume that a previous Input Orientation has been found and + # used to extract the atomnos + if firststdorient: + firststdorient = False + # Wipes out the single input coordinate at the start of the file + self.atomcoords = [] + + line = inputfile.next() + hyphens = inputfile.next() + atomcoords = [] + while line.strip(): + temp = line.strip().split() + atomcoords.append(map(float,temp[2:4])) + line = inputfile.next() + self.atomcoords.append(atomcoords) if line.find("ITER EX DEM")==1: # This is the section with the SCF information Modified: trunk/src/cclib/parser/logfileparser.py =================================================================== --- trunk/src/cclib/parser/logfileparser.py 2006-05-17 16:27:40 UTC (rev 122) +++ trunk/src/cclib/parser/logfileparser.py 2006-05-17 16:56:45 UTC (rev 123) @@ -29,7 +29,8 @@ _convertor = {"eV_to_cm-1": lambda x: x*8065.6, "hartree_to_eV": lambda x: x*27.2114, "nm_to_cm-1": lambda x: 1e7/x, - "cm-1_to_nm": lambda x: 1e7/x} + "cm-1_to_nm": lambda x: 1e7/x, + "au_to_Ang": lambda x: x*0.529177} return _convertor["%s_to_%s" % (fromunits,tounits)] (value) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |