Commit 9278856c authored by Samuel Tan's avatar Samuel Tan
Browse files

changed template arg

parent 68e166a3
......@@ -10,15 +10,44 @@ import re
# must ensure last step is atomPrint()
# otherwise the string mangling messes up the tabling space!!
def optGamess(curr_sys, tsk_d, template = None):
if not curr_sys:
print("missing system arg in optGamess()")
return 1
if "template" in tsk_d:
tmp = read_xyz(scriptPath("templates/optGamess.template"))
else:
tmp = read_xyz(template)
# replace anything mentioned in task file with
# "variable = value"
for key,val in tsk_d.items():
tmp = mySed(tmp, key, str(key) + "=" + str(val))
if tsk_d.get("title"):
tmp = mySed(tmp, "title", tsk_d["title"])
else:
warning("no title")
# create input
out_f = insert_List(out_f, tag = "xyz_data", insertThis = curr_sys.printSys("gamess"))
# add space in front of GROUP keywords, signaled by "$"
# doing this last so insert_List() etc don't interfere with it
out_f[i] = [" " + line if line.startswith("$") else line for line in out_f[i]]
return out_f
def genPsi4(curr_sys, tsk_d, template = None):
if not curr_sys:
print("missing system arg in genPsi4()!!")
return 1
if not template:
out_f = read_xyz(scriptPath("psi4.template"))
elif template:
out_f = read_xyz(template)
if "template" in tsk_d:
tmp = read_xyz(template)
else:
tmp = read_xyz(scriptPath("templates/psi4sapt.template")
# replace anything mentioned in task file with
......@@ -81,10 +110,10 @@ def genGamess(curr_sys, tsk_d, template = None):
print("missing system arg in genGamess()")
return 1
if template:
if "template" in tsk_d:
tmp = read_xyz(template)
elif not template:
tmp = read_xyz(scriptPath("efp.template"))
else:
tmp = read_xyz(scriptPath("templates/efp.template"))
# replace anything mentioned in task file with
# "variable = value"
......
......@@ -94,18 +94,36 @@ def main():
# printing using functions in formats.py
a = 1
# Psi4 SAPT
if taskDict["task"] == "psi4sapt":
a = genPsi4(curr_sys = curr_sys, tsk_d = taskDict, template = taskDict["template"])
a = prettyPrint(a, taskDict.get("out_filename"))
# GAMESS optimisation
elif taskDict["task"] == "optGamess":
key_list = [str(a).lower() for a in taskDict.keys()]
if [b for b in key_list if b in ["basis", "gbasis"]]:
print("No support for Basis group in GAMESS at the moment")
print("Please remove line from task file and use a template file instead")
return 0
a = optGamess(curr_sys = curr_sys, tsk_d = taskDict)
a = prettyPrint(a, taskDict.get("out_filename"))
# GAMESS EFP
elif taskDict["task"] == "genefpinput":
key_list = [str(a).lower() for a in taskDict.keys()]
if [b for b in key_list if b in ["basis", "gbasis"]]:
print("No support for Basis group at the moment")
print("No support for Basis group in GAMESS at the moment")
print("Please remove line from task file and use a template file instead")
return 0
a = genGamess(curr_sys = curr_sys, tsk_d = taskDict)
prettyPrint(a[0], "efp_frag_0.inp")
prettyPrint(a[1], "efp_frag_1.inp")
else:
print("Task not recognized")
......
$SYSTEM MWORDS=200 MEMDDI=50 $END
$CONTRL SCFTYP=RHF RUNTYP=OPTIMIZE MAXIT=200
ICHARG=0 ISPHER=1 MPLEVL=2
$END
$SCF DIRSCF=.TRUE. FDIFF=.FALSE. DIIS=.TRUE. $END
$BASIS GBASIS=ACCD $END
$DATA
title
C1
xyz_data
$END
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment