Exemple #1
0
def prepareFirstInput(coordinate, stepSize):
  
  #read the first file 
  gmsFile = GMSFile(sys.argv[1])
  
  # increase MAXIT
  gmsFile["CONTRL"]["MAXIT"]=200
  if "MCSCF" in gmsFile:
    gmsFile["MCSCF"]["MAXIT"]=200
  
  # add the freeze point
  gmsFile["STATPT"]["IFREEZ(1)"] = coordinate
  
  #increment the coordinate
  gmsFile["DATA"][coordinate-1] = float(gmsFile["DATA"][coordinate-1]) +stepSize

  # read the vec
  VEC=GAMESS.readVECGroupsFromFile(re.sub("\.inp",".dat",sys.argv[1]))[-1]
  
  # prepare GUESS group
  if "GUESS" not in gmsFile:
    gmsFile["GUESS"] = GMSFile.parse_group("$GUESS GUESS=MOREAD $END")
  else:
    gmsFile["GUESS"]["GUESS"]="MOREAD"
  gmsFile["GUESS"]["NORB"]= GAMESS.numberOfOrbitalsinVEC(VEC)
  
  # add VEC group
  try:
    del gmsFile["VEC"]
  except:
    pass
  gmsFile["VEC"]=VEC.strip()
  
  if gmsFile["CONTRL"]["SCFTYP"] == "UHF":
    del gmsFile["GUESS"]
  
  
  #add the 1 postfix before file type e.g. test.inp > test1.inp
  nextInFileName = re.sub("\.inp","1.inp",sys.argv[1])
  #write the file
  nextInFile = open(nextInFileName, 'w')
  nextInFile.write(str(gmsFile))
  nextInFile.close()
  
  return nextInFileName
Exemple #2
0
def prepareNextFile(LastInputFileName, coordinate, stepSize):
  
  #read the first file 
  gmsFile = GMSFile(LastInputFileName)
  
  # increase MAXIT
  gmsFile["CONTRL"]["MAXIT"]=200
  if "MCSCF" in gmsFile:
    gmsFile["MCSCF"]["MAXIT"]=200
  
  # add the freeze point
  gmsFile["STATPT"]["IFREEZ(1)"] = coordinate
  
  #read the optimized geometry
  gmsFile["DATA"] = GMSFile.parse_group(GMSFileReader.read_data_group(re.sub("\.inp",".log",LastInputFileName)))
  
  #increment the coordinate
  gmsFile["DATA"][coordinate-1] = float(gmsFile["DATA"][coordinate-1]) +stepSize

  # read the vec
  VEC=GAMESS.readVECGroupsFromFile(re.sub("\.inp",".dat",sys.argv[1]))[-1]
  
  # add VEC group
  try:
    del gmsFile["VEC"]
  except:
    pass
  gmsFile["VEC"]=VEC.strip()
  
  #add the 1 postfix before file type e.g. test.inp > test1.inp
  nextInFileName = nextInputFleNameFromLastInputFileName(LastInputFileName)
  #write the file
  nextInFile = open(nextInFileName, 'w')
  nextInFile.write(str(gmsFile))
  nextInFile.close()
  
  return nextInFileName