Commit 4d6f1a65 authored by Samuel Tan's avatar Samuel Tan
Browse files

psi4mp2 now writes to .inp

parent 24a29b16
......@@ -90,6 +90,7 @@ def mp2Psi4(curr_sys, tsk_d):
else:
out_f = read_file(scriptPath("templates/psi4mp2.template"))
# optionals from taskDict
if "memory" in tsk_d:
out_f = [re.sub("memory.+", "memory " + tsk_d["memory"], x) for x in out_f]
if "basis" in tsk_d:
......@@ -97,6 +98,15 @@ def mp2Psi4(curr_sys, tsk_d):
if "title" in tsk_d:
out_f[0] = tsk_d["title"]
# better looking indentation
pos1 = pos_uniq(out_f, "set globals {")
# fancy stuff to look for next closing brace (assuming only one)
# and then get correct position by adding pos1 back in
pos2 = pos_uniq(out_f[pos1:], "^}$") + pos1
# start at pos1 +1 because not indenting set globals
for i in range(pos1 + 1, pos2):
out_f[i] = " " + out_f[i]
out_f_d = {}
for i,mol in enumerate(curr_sys.molDict.values()):
......
......@@ -120,7 +120,7 @@ def main():
# collect atoms into molecules
if "nfrag" in taskDict:
print("nfrag detected: ", taskDict["nfrag"])
warning("nfrag detected: ", taskDict["nfrag"])
curr_sys.aggregateMol(nfrag = taskDict["nfrag"])
for mol in curr_sys.molDict.values():
if not mDB.isAnion(mol, q = True) and not mDB.isCation(mol, q = True):
......@@ -147,7 +147,7 @@ def main():
a = mp2Psi4(curr_sys = curr_sys, tsk_d = taskDict)
if "out_filename" in taskDict:
for i, mol in a.items():
prettyPrint(mol, out_filename = taskDict["out_filename"] + "_" + str(i))
prettyPrint(mol, out_filename = taskDict["out_filename"] + "_" + str(i) + ".inp")
#prettyPrint(a["complex"], out_filename = taskDict["out_filename"] + "_complex")
else:
for i, mol in a.items():
......
# this is a comment
task=psi4mp2
title=c1mim-bf4-p1-opt_IL_aTZ_mp2_blah
using=/Users/tans/GoogleDrive/QuantumChem/ppqc/xyz_files/c1mim-bf4-p1.xyz
#using=/short/k96/apps/src/ppqc/xyz_files/c1mim-bf4-p1.xyz
#using=/Users/tans/GoogleDrive/QuantumChem/ppqc/xyz_files/c1mim-bf4-p1.xyz
using=/short/k96/apps/src/ppqc/xyz_files/c1mim-bf4-p1.xyz
nfrag=2
basis=aug-cc-pVTZ
memory=32 Gb
......@@ -2,7 +2,7 @@
memory 32 Gb
molecule dimer {
molecule complex {
0 1
xyz_data
units angstrom
......@@ -16,6 +16,7 @@ set globals {
freeze_core True
guess sad
basis_guess 3-21G
S_ORTHOGONALIZATION canonical
}
energy('df-mp2')
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