You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
2.4 KiB
67 lines
2.4 KiB
2 years ago
|
def orca(job,method,nproc,geom,charge,mult,scalfreq,temperature,pressure,nroots,tda,solvent,constraints,qmatoms,totalcharge,totalmult,qm2method,qm2basis,activeatoms,hessfile,disp,aim):
|
||
|
if 'opt' in job or 'Opt' in job or 'OPT' in job:
|
||
|
method += ' opt'
|
||
|
if 'freq' in job and ('XTB2' in method or 'XTB' in method):
|
||
|
method += ' Numfreq'
|
||
|
if 'ts' in job:
|
||
|
method += ' OptTS'
|
||
|
if 'freq' in job and ('XTB2' not in method and 'XTB' not in method and 'XTBFF' not in method):
|
||
|
method += ' freq'
|
||
|
if disp != 'None':
|
||
|
method += ' {}'.format(disp)
|
||
|
if aim == 'true' or aim == 'True' or aim == 'TRUE':
|
||
|
method += ' AIM'
|
||
|
if solvent != 'none' and ('XTB2' in method or 'XTB' in method or 'XTBFF' in method):
|
||
|
method += ' ALPB({})'.format(solvent)
|
||
|
if solvent != 'none' and ('XTB2' not in method and 'XTB' not in method and 'XTBFF' not in method):
|
||
|
method += ' CPCM({})'.format(solvent)
|
||
|
|
||
|
with open('cmmd.in','w') as f:
|
||
|
print("#CMMDE generated Orca input file", file=f)
|
||
|
print("!{}".format(method), file=f)
|
||
|
print("""%pal
|
||
|
nprocs {}
|
||
|
end""".format(nproc),file=f)
|
||
|
if qmatoms != 'None':
|
||
|
print("""%qmmm
|
||
|
QMAtoms {{ {} }} end
|
||
|
Charge_Total {}
|
||
|
Mult_Total {}""".format(qmatoms,totalcharge,totalmult),file=f)
|
||
|
if qm2method != 'None':
|
||
|
print(""" QM2CUSTOMMETHOD "{}"
|
||
|
QM2CUSTOMBASIS "{}" """.format(qm2method,qm2basis),file=f)
|
||
|
if activeatoms != 'None':
|
||
|
print("ActiveAtoms {} end".format(activeatoms))
|
||
|
print("end",file=f)
|
||
|
if constraints != 'None':
|
||
|
print("%geom", file=f)
|
||
|
print("Constraints",file=f)
|
||
|
for i in constraints.split(','):
|
||
|
print("""{{ {} }}""".format(i),file=f)
|
||
|
print("end",file=f)
|
||
|
print("end",file=f)
|
||
|
if hessfile != 'None':
|
||
|
print("""%geom
|
||
|
MaxIter 10000
|
||
|
InHess Read
|
||
|
InHessName "{}"
|
||
|
end""".format(hessfile),file=f)
|
||
|
# Baris koordinat atom
|
||
|
print("""
|
||
|
*xyzfile {} {} {}
|
||
|
""".format(charge,mult,geom)
|
||
|
, file=f)
|
||
|
if 'freq' in job:
|
||
|
print("""%freq
|
||
|
scalfreq {}
|
||
|
Temp {}
|
||
|
Pressure {}
|
||
|
end""".format(scalfreq,temperature,pressure),file=f)
|
||
|
if 'td' in job:
|
||
|
print("""%tddft
|
||
|
nroots {}
|
||
|
tda {}
|
||
|
end""".format(nroots,tda),file=f)
|
||
|
return
|
||
|
|