A series of Python3 script to lower the barrier of computing and simulating molecular and material systems.
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.
 
 
 

198 lines
8.8 KiB

def orca(job,method,nproc,geom,charge,mult,scalfreq,temperature,pressure,nroots,tda,solvent,constraints,qmatoms,totalcharge,totalmult,qm2method,qm2basis,activeatoms,hessfile,disp,aim,product,ts,irciter, printlevel, inithess,grid, finalgrid,maxiter,solvtype,cpcmsurface,draco,draco_charges,solvator,nsolv,solventfile,solvprint,randomsolv,fixsolute,use_eeq,droplet,droplet_radius,guest,docklevel,nrepeatguest,cumulativeguest,fixhost,evpes,nopt,no_opt,goat_iter,goat_opt_iter,skip_initopt,randomseed,readensemble,autowall,mintemplist,nworkers,maxitermult,keepworker,worker_randstart,uphill_atoms,gfn_uphill,align,en_diff,max_en,max_entropy,conf_temp,min_delta_S,conf_degen,free_heteroatoms,free_nonh_atoms,free_fragments,freeze_bonds,freeze_angles,freeze_cistrans,freeze_amides,maxcoordnum,max_topo_diff):
if 'opt' in job or 'Opt' in job or 'OPT' in job and not 'ts' in job:
method += ' opt'
if 'freq' in job and ('XTB2' in method or 'XTB' in method):
method += ' Numfreq'
if 'irc' in job:
method += ' IRC'
if 'ts' in job and 'neb' not in job:
method += ' OptTS'
if 'neb-ts' in job:
method += ' NEB-TS'
if 'neb' in job and 'ts' not in job:
method += ' NEB'
if 'neb-ci' in job:
method += ' NEB-CI'
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 solvtype == 'GBSA':
method += ' GBSA({})'.format(solvent)
if solvent != 'none' and ('XTB2' not in method and 'XTB' not in method and 'XTBFF' not in method):
if draco == True:
method += ' DRACO'
if solvtype == 'CPCM' or solvtype == 'cpcm':
method += ' CPCM({})'.format(solvent)
elif solvtype == 'CPCMC' or solvtype == 'COSMO' or solvtype == 'cosmo':
method += ' CPCMC({})'.format(solvent)
elif solvtype == 'SMD' or solvtype == 'smd':
method += ' SMD({})'.format(solvent)
if job == 'goat' or job == 'GOAT':
method += ' GOAT'
if job == 'goat-react' or job == 'GOAT-REACT':
method += ' GOAT-REACT'
if job == 'goat-explore' or job == 'GOAT-EXPLORE':
method += ' GOAT-EXPLORE'
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 'opt' in job:
print("""%geom
maxiter {}
end""".format(maxiter),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 {}
InHess Read
InHessName "{}"
end""".format(maxiter,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)
if 'neb' in job:
print("""%geom
maxiter {}
end""".format(maxiter),file=f)
print("""%NEB
neb_end_xyzfile "{}" """.format(product),file=f)
if ts != 'None':
print(""" neb_ts_xyzfile "{}"
end""".format(ts),file=f)
else:
print("end",file=f)
if 'irc' in job:
print("""%irc
MaxIter {}
PrintLevel {}
InitHess {}
Hess_filename "{}"
end
%method
Grid {}
FinalGrid {}
end
""".format(irciter, printlevel, inithess, hessfile, grid, finalgrid),file=f)
if solvent != 'none' and 'XTB' not in method:
print('%CPCM',file=f)
if cpcmsurface == 'SES' or cpcmsurface == 'ses':
print('SURFACETYPE GEPOL_SES_GAUSSIAN',file=f)
else:
print('SURFACETYPE VDW_GAUSSIAN',file=f)
if draco == True:
if draco_charges == 'ceh' or draco_charges == 'CEH':
print('draco_charges ceh',file=f)
else:
print('draco_charges eeq',file=f)
print('END',file=f)
if solvator == True:
print('%SOLVATOR',file=f)
print(' NSOLV {}'.format(nsolv),file=f)
print(' CLUSTERMODE STOCHASTIC',file=f)
if solventfile != 'none':
print(""" SOLVENTFILE "{}" """.format(solventfile),file=f)
print(' PRINTLEVEL {}'.format(solvprint),file=f)
print(' RANDOMSOLV {}'.format(randomsolv),file=f)
print(' FIXSOLUTE {}'.format(fixsolute),file=f)
print(' USEEEQCHARGES {}'.format(use_eeq),file=f)
print(' DROPLET {}'.format(droplet),file=f)
if droplet == 'True' or droplet == 'true' or droplet == 'TRUE':
print(' RADIUS {}'.format(droplet_radius),file=f)
print('END',file=f)
if 'docker' in job:
print('%DOCKER',file=f)
print(""" GUEST "{}" """.format(guest),file=f)
print(' DOCKLEVEL {}'.format(docklevel),file=f)
print(' NREPEATGUEST {}'.format(nrepeatguest),file=f)
print(' CUMULATIVE {}'.format(cumulativeguest),file=f)
print(' FIXHOST {}'.format(fixhost),file=f)
print(' EVPES {}'.format(evpes),file=f)
print(' NOPT {}'.format(nopt),file=f)
print(' NOOPT {}'.format(no_opt),file=f)
print('END',file=f)
if 'GOAT' in job or 'goat' in job:
print('%GOAT',file=f)
print(' MAXITER {}'.format(goat_iter),file=f)
print(' MAXOPTITER {}'.format(goat_opt_iter),file=f)
print(' SKIPINITIALOPT {}'.format(skip_initopt),file=f)
print(' RANDOMSEED {}'.format(randomseed),file=f)
if readensemble != 'none':
print(' READENSEMBLE {}'.format(readensemble),file=f)
print(' AUTOWALL {}'.format(autowall),file=f)
if mintemplist != 'none':
print(' MINTEMPLIST {}'.format(mintemplist),file=f)
print(' NWORKERS {}'.format(nworkers),file=f)
if maxitermult != 'none':
print(' MAXITERMULT {}'.format(maxitermult),file=f)
print(' KEEPWORKERDATA {}'.format(keepworker),file=f)
print(' WORKERRANDOMSTART {}'.format(worker_randstart),file=f)
if uphill_atoms != 'none':
print(' UPHILLATOMS {} END'.format(uphill_atoms),file=f)
print(' GFNUPHILL {}'.format(gfn_uphill),file=f)
print(' ALIGN {}'.format(align),file=f)
print(' ENDIFF {}'.format(en_diff),file=f)
print(' MAXEN {}'.format(max_en),file=f)
# if 'EXPLORE' in job or 'Explore' in job or 'explore' in job:
# print(' RMSDMETRIC EIGENVALUE',file=f)
#else:
# print(' RMSDMETRIC RMSD',file=f)
if max_entropy == 'True':
print(' MAXENTROPY {}'.format(max_entropy),file=f)
print(' CONFTEMP {}'.format(conf_temp),file=f)
print(' MINDELS {}'.format(min_delta_S),file=f)
print(' CONFDEGEN {}'.format(conf_degen),file=f)
print(' FREEHETEROATOMS {}'.format(free_heteroatoms),file=f)
print(' FREENONHATOMS {}'.format(free_nonh_atoms),file=f)
print(' FREEFRAGMENTS {}'.format(free_fragments),file=f)
print(' FREEZEBONDS {}'.format(freeze_bonds),file=f)
print(' FREEZEANGLES {}'.format(freeze_angles),file=f)
print(' FREEZECISTRANS {}'.format(freeze_cistrans),file=f)
print(' FREEZEAMIDES {}'.format(freeze_amides),file=f)
if maxcoordnum != 'none':
print(' MAXCOORDNUMBER {}'.format(maxcoordnum),file=f)
if max_topo_diff != 'none':
print(' MAXTOPODIFF {}'.format(max_topo_diff),file=f)
print('END',file=f)
return