Commit 5d766fbd authored by Samuel Tan's avatar Samuel Tan
Browse files

dealt with halide ghost atoms for generating interactEFP

parent c9468b19
......@@ -238,6 +238,15 @@ def efpIntGamess(tsk_d):
geom2_line = pos_uniq(inList = inpL2, tag = "^C1$")
geom2 = inpL2[geom2_line + 1: geom2_line + 4]
# monoatomic case (halides)
monoatomic_frag2 = False
if len(geom2) == 2:
warning("monoatomic case")
geom2[1] = "X 0.0 5.00000000 0.00000000 0.00000000"
geom2.append("X 0.0 0.00000000 5.00000000 0.00000000")
monoatomic_frag2 = True
# check that geom from inp matches efp
#efpLX in lines 5 to 8 looks like
#A01N a b c
......@@ -253,29 +262,45 @@ def efpIntGamess(tsk_d):
else:
print("frag1 doesn't match!")
sys.exit(3)
geom2 = [i.split() for i in geom2]
x2 = [i[0] for i in geom2]
y2 = [i.split()[0] for i in efpL2[5:8]]
if all(x2[i] == y2[i][3:] for i in range(3)):
if all(x2[i].upper() == y2[i][3:] for i in range(3)):
warning("frag2 matches")
elif monoatomic_frag2:
monoatomic_str2 = ("frag2 is a monoatomic fragment--you need to modify \n \
the .efp file manually and add ghost atoms coordinates \n \
as well as their dipoles...octopoles \n \
if in doubt email me for examples")
warning(monoatomic_str2)
print(monoatomic_str2)
print(x2)
print(y2)
sys.exit(3)
else:
print("frag2 doesn't match!")
print(x2)
print(y2)
sys.exit(3)
# put A01N in front of xyz geom
g1 = [i[2:] for i in geom1] # last 3, i.e. xyz data, discard elem_sym and atomic num
g2 = [i[2:] for i in geom2]
# add strings together
frag1_geom = [ [y1[i]] + g1[i] for i in range(3)]
frag2_geom = [ [y2[i]] + g2[i] for i in range(3)]
# add a space in front and newline at the end
frag1_geom = [" " + " ".join(frag1_geom[i]) for i in range(3)]
frag2_geom = [ [y2[i]] + g2[i] for i in range(3)]
frag2_geom = [" " + " ".join(frag2_geom[i]) for i in range(3)]
out_f = tmp + [" COORD=CART"] + \
[" FRAGNAME=EFP1"] + frag1_geom + \
[" FRAGNAME=EFP2"] + frag2_geom + \
[" $END"] + \
["$EFP1"] + efpL1[3:] + \
[" "] + \
["$EFP2"] + efpL2[3:]
......
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