added cmmde_orca feature

Aditya Wibawa Sakti 2 years ago
parent 58a1f9020d
commit c9e7f4877e
  1. 8
      bin/cmmde.py
  2. BIN
      lib/__pycache__/cmmde_orca.cpython-39.pyc
  3. BIN
      lib/__pycache__/cmmde_xtb.cpython-39.pyc
  4. 26
      lib/cmmde_orca.py
  5. 28
      lib/cmmde_xtb.py

@ -29,7 +29,7 @@ parser.add_argument('-sfreq','--scalefreq',type=float,default=1, help='Faktor sk
# Input yang berkaitan dengan perhitungan menggunakan software DCDFTBMD
parser.add_argument('-disp','--dispersion',type=str,default='None', help='Model koreksi dispersi jika menggunakan software DCDFTB. Pilihan: None, D3, D3BJ, D3H5.')
parser.add_argument('-para','--parapath',type=str,default='/home/adit/opt/dftbplus-21.2/external/slakos/origin/3ob-3-1',help='Lokasi folder berisikan himpunan parameter DFTB yang akan digunakan.')
parser.add_argument('-iter','--iter',type=int,default=500, help='Jumlah iterasi dalam optimasi geometri dan jenis perhitungan lainnya')
parser.add_argument('-iter','--iter',type=int,default=9999, help='Jumlah iterasi dalam optimasi geometri dan jenis perhitungan lainnya')
parser.add_argument('-ens','--ensembel',type=str,default='NVE', help='Ensembel yang digunakan dalam simulasi dinamika molekul. Pilihan: NVE, NVT, dan NPT.')
parser.add_argument('-tstat','--thermostat',type=str,default='andersen', help='Termostat yang digunakan dalam simulasi NVT. Pilihan: andersen,berendsen,dan nose')
parser.add_argument('-t','--temp', type=float, default=298.15,help='Suhu yang digunakan dalam perhitungan frekuensi maupun simulasi MD dalam satuan Kelvin.')
@ -130,7 +130,7 @@ parser.add_argument('-scanmode','--scanmode',type=str,default='None',help='Mode
parser.add_argument('-scan','--scan',type=str,default='None',help='Rentang Scanning dalam format: Titik1,Titik2,JumlahTitik. Contoh:2.5,1.0,100.')
# Input untuk perhitungan NEB
parser.add_argument('-produk','--produk',type=str,help='Struktur produk yang digunakan dalam interpolasi NEB dalam format koordinat Cartesian.')
parser.add_argument('-trans','--transitionstate',type=str,help='Struktur perkiraan keadaan transisi yang digunakan dalam format koordinat Cartesian.')
parser.add_argument('-trans','--transitionstate',default='None',type=str,help='Struktur perkiraan keadaan transisi yang digunakan dalam format koordinat Cartesian.')
# Input untuk IRC
parser.add_argument('-irciter','--irciter',type=int,default=20,help='Iterasi maksimum IRC Orca.')
parser.add_argument('-printlevel','--printlevel',type=str,default='1',help='Print level dalam IRC Orca. Default=1')
@ -212,7 +212,7 @@ obabel geom.smi -O geom.xyz --gen3d""".format(opt.nproc),file=fout)
geom = 'geom.xyz'
### ORCA
if opt.software == 'orca':
orca(opt.job,opt.method,opt.nproc,geom,opt.charge,opt.mult,opt.scalefreq,opt.temp,opt.pressure,opt.nroots,opt.tda,opt.solvent,opt.constraints,opt.qmatoms,opt.totalcharge,opt.totalmult,opt.qm2method,opt.qm2basis,opt.activeatoms,opt.hessfile,opt.dispersion,opt.aim,opt.produk,opt.transitionstate,opt.irciter,opt.printlevel, opt.inithess,opt.grid, opt.finalgrid)
orca(opt.job,opt.method,opt.nproc,geom,opt.charge,opt.mult,opt.scalefreq,opt.temp,opt.pressure,opt.nroots,opt.tda,opt.solvent,opt.constraints,opt.qmatoms,opt.totalcharge,opt.totalmult,opt.qm2method,opt.qm2basis,opt.activeatoms,opt.hessfile,opt.dispersion,opt.aim,opt.produk,opt.transitionstate,opt.irciter,opt.printlevel, opt.inithess,opt.grid, opt.finalgrid,opt.iter)
### NWChem
if opt.software == 'nwchem':
@ -400,4 +400,4 @@ if opt.job == 'ligprep' and opt.software == 'gmx':
# Program XTB Standalone
if opt.software == 'xtb':
xtb(opt.job,geom,opt.nproc,opt.produk,opt.temp,opt.nrun,opt.npoint,opt.anopt,opt.kpush,opt.kpull,opt.ppull,opt.alp,opt.distance,opt.angle,opt.dihedral,opt.scanmode,opt.iter,opt.scan)
xtb(opt.job,geom,opt.nproc,opt.produk,opt.temp,opt.nrun,opt.npoint,opt.anopt,opt.kpush,opt.kpull,opt.ppull,opt.alp,opt.distance,opt.angle,opt.dihedral,opt.scanmode,opt.iter,opt.scan,opt.solvent)

@ -1,4 +1,4 @@
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):
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):
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):
@ -8,7 +8,7 @@ def orca(job,method,nproc,geom,charge,mult,scalfreq,temperature,pressure,nroots,
if 'ts' in job and 'neb' not in job:
method += ' OptTS'
if 'neb-ts' in job:
method += ' NEB-TS Freq'
method += ' NEB-TS'
if 'neb' in job and 'ts' not in job:
method += ' NEB'
if 'neb-ci' in job:
@ -30,6 +30,10 @@ def orca(job,method,nproc,geom,charge,mult,scalfreq,temperature,pressure,nroots,
print("""%pal
nprocs {}
end""".format(nproc),file=f)
if 'opt' in job:
print("""%geom
maxiter {}
end""".format(maxiter))
if qmatoms != 'None':
print("""%qmmm
QMAtoms {{ {} }} end
@ -50,10 +54,10 @@ end""".format(nproc),file=f)
print("end",file=f)
if hessfile != 'None':
print("""%geom
MaxIter 10000
MaxIter {}
InHess Read
InHessName "{}"
end""".format(hessfile),file=f)
end""".format(maxiter,hessfile),file=f)
# Baris koordinat atom
print("""
*xyzfile {} {} {}
@ -71,10 +75,16 @@ end""".format(scalfreq,temperature,pressure),file=f)
tda {}
end""".format(nroots,tda),file=f)
if 'neb' in job:
print("""%NEB
NEB_END_XYZFILE "{}"
NEB_TS_XYZFILE "{}"
END""".format(product,ts),file=f)
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 {}

@ -1,6 +1,6 @@
# CMMDE function for xTB standalone program
import os
def xtb(job,geom,nproc,product,temperature,nrun,npoint,anopt,kpush,kpull,ppull,alp,distance,angle,dihedral,scanmode,maxiter,scan):
def xtb(job,geom,nproc,product,temperature,nrun,npoint,anopt,kpush,kpull,ppull,alp,distance,angle,dihedral,scanmode,maxiter,scan,solvent):
with open('run.sh','w') as fout:
print("""#!/bin/bash
#SBATCH --nodes=1
@ -10,15 +10,30 @@ def xtb(job,geom,nproc,product,temperature,nrun,npoint,anopt,kpush,kpull,ppull,a
export OMP_NUM_THREADS={}
cd $PWD""".format(nproc),file=fout)
if 'opt' in job:
print("$XTB_COMMAND {} --opt -P {} > xtb.out".format(geom,nproc),file=fout)
if solvent != 'none':
print("$XTB_COMMAND {} --opt -P {} --alpb {} > xtb.out".format(geom,nproc,solvent),file=fout)
else:
print("$XTB_COMMAND {} --opt -P {} > xtb.out".format(geom,nproc),file=fout)
if 'freq' in job:
print("$XTB_COMMAND {} --hess -P {} --input cmmd.in > xtb.out".format(geom,nproc), file=fout)
if solvent != 'none':
print("$XTB_COMMAND {} --hess -P {} --input cmmd.in --alpb {} > xtb.out".format(geom,nproc,solvent), file=fout)
else:
print("$XTB_COMMAND {} --hess -P {} --input cmmd.in > xtb.out".format(geom,nproc), file=fout)
if 'opt' in job and 'freq' in job:
print("$XTB_COMMAND {} --ohess -P {} --input cmmd.in > xtb.out".format(geom,nproc),file=fout)
if solvent != 'none':
print("$XTB_COMMAND {} --ohess -P {} --input cmmd.in --alpb {} > xtb.out".format(geom,nproc,solvent),file=fout)
else:
print("$XTB_COMMAND {} --ohess -P {} --input cmmd.in > xtb.out".format(geom,nproc),file=fout)
if 'path' in job:
print("$XTB_COMMAND {} --path {} --input cmmd.in -P {} > xtb.out".format(geom,product,nproc),file=fout)
if solvent != 'none':
print("$XTB_COMMAND {} --path {} --input cmmd.in -P {} --alpb {} > xtb.out".format(geom,product,nproc,solvent),file=fout)
else:
print("$XTB_COMMAND {} --path {} --input cmmd.in -P {} > xtb.out".format(geom,product,nproc),file=fout)
if 'scan' in job:
print("$XTB_COMMAND {} --opt -P {} --input cmmd.in > xtb.out".format(geom,nproc), file=fout)
if solvent != 'none':
print("$XTB_COMMAND {} --opt -P {} --input cmmd.in --alpb {} > xtb.out".format(geom,nproc,solvent), file=fout)
else:
print("$XTB_COMMAND {} --opt -P {} --input cmmd.in > xtb.out".format(geom,nproc), file=fout)
if 'freq' in job:
with open('cmmd.in', 'w') as f:
print("""$thermo
@ -57,3 +72,4 @@ $end""".format(nrun,npoint,anopt,kpush,kpull,ppull,alp),file=f)
os.system('sbatch run.sh')

Loading…
Cancel
Save