Commit b6278c77 authored by Samuel Tan's avatar Samuel Tan
Browse files

def genFMO

parent 1fd9043a
......@@ -36,8 +36,6 @@ def optGamess(curr_sys, tsk_d):
# doing this last so insert_List() etc don't interfere with it
out_f = [" " + line if str(line).startswith("$") else line for line in out_f]
print(out_f)
return out_f
......@@ -117,7 +115,7 @@ def genGamess(curr_sys, tsk_d):
else:
tmp = read_xyz(scriptPath("templates/efp.template"))
# replace anything mentioned in task file withM`
# replace anything mentioned in task file with
# "variable = value"
for key,val in tsk_d.items():
tmp = mySed(tmp, key, str(key) + "=" + str(val))
......@@ -125,7 +123,7 @@ def genGamess(curr_sys, tsk_d):
#if tsk_d.get("title"):
# tmp = mySed(tmp, "title", tsk_d["titlM`e"])
#else:
# print("no title")M`M`M`M`M`M`M`M`M`M`
# print("no title")
out_f = {}
# create EFP inputs
......@@ -148,3 +146,37 @@ def genGamess(curr_sys, tsk_d):
return out_f
def genFMO(curr_sys, tsk_d):
if not curr_sys:
print("missing system arg in genGamess()")
return 1
if "template" in tsk_d:
tmp = read_xyz(tsk_d["template"])
else:
tmp = read_xyz(scriptPath("templates/fmo.template"))
# replacements
for key,val in tsk_d.items():
tmp = mySed(tmp, key, str(key) + "=" + str(val))
# maybe should have separate dictionaries for cations and anions??
frag_d = {}
for i,mol in enumerate(curr_sys.molDict.values()):
frag_d[i] = tmp #initial
if tsk_d["guess_charges"] == "true":
if mDB.isAnion(mol):
frag_d[i] = mySed(frag_d[i], tag = "ICHARG", repl = "ICHARG=-1")
elif mDB.isCation(mol):
frag_d[i] = mySed(frag_d[i], tag = "ICHARG", repl = "ICHARG=1")
frag_d[i] = insert_List(frag_d[i], tag = "xyz_data", insertThis = mol.printMol("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 frag_d
......@@ -124,9 +124,11 @@ def main():
return 0
a = genGamess(curr_sys = curr_sys, tsk_d = taskDict)
if taskDict.get("out_filename"):
prettyPrint(a[0], "efp_frag_0.inp")
prettyPrint(a[1], "efp_frag_1.inp")
prettyPrint(a[0], taskDict["out_filename"] + "0")
prettyPrint(a[1], taskDict["out_filename"] + "1")
else:
#prettyPrint(a[0], "efp_frag_0.inp")
#prettyPrint(a[1], "efp_frag_1.inp")
prettyPrint(a[0])
prettyPrint(a[1])
......
$SYSTEM MWORDS=200 $END
$CONTRL SCFTYP=RHF RUNTYP=ENERGY MAXIT=200 ISPHER=1
ICHARG=1 $END
$SCF DIRSCF=.TRUE. FDIFF=.FALSE. DIIS=.TRUE. $END
$BASIS GBASIS=CCT $END
$MP2 CODE=IMS SCSPT=SCS SCSOPO=1.05 SCSPAR=0.68 $END
$DATA
cation2-MP2-energy
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