From c9e7f4877e3269be98ce3709ed6bbc9ba364add7 Mon Sep 17 00:00:00 2001 From: Aditya Wibawa Sakti Date: Sun, 17 Jul 2022 23:50:17 +0700 Subject: [PATCH] added cmmde_orca feature --- bin/cmmde.py | 8 +++---- lib/__pycache__/cmmde_orca.cpython-39.pyc | Bin 2331 -> 2508 bytes lib/__pycache__/cmmde_xtb.cpython-39.pyc | Bin 1874 -> 2399 bytes lib/cmmde_orca.py | 26 +++++++++++++------- lib/cmmde_xtb.py | 28 +++++++++++++++++----- 5 files changed, 44 insertions(+), 18 deletions(-) diff --git a/bin/cmmde.py b/bin/cmmde.py index 70a60cb..ffca855 100755 --- a/bin/cmmde.py +++ b/bin/cmmde.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) \ No newline at end of file + 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) \ No newline at end of file diff --git a/lib/__pycache__/cmmde_orca.cpython-39.pyc b/lib/__pycache__/cmmde_orca.cpython-39.pyc index 7d0bde6368891e3d0fdc0167d570968656781bbc..a73078ee83d8d71174408d04abef143fec7ba69b 100644 GIT binary patch delta 874 zcmY+DOK;Oa5XX0RQ^&YYC^2o?(6mcv3W2l@k8&y;ct{{YC4>+UfvQyNqKGC1H=vMi z$f2B&fFN^0Txt$TATB5$fG>c!z$r%#d;n0dz}T_l)Yk0I{C~6K*^&G<@zsbIV=;~3 zlfLzRITw2spG!@+q5p8)U3?a8{oUv5PoYU)s*Q;%6n2pdFg7PW{RkSx5FP`qhS>nHL#Ou%ft3!FJ`gK!|Bjx5A9g{#VBc5gA!5H*^F>PkQZ$7rK>txRg=!G^D$@a@L4BJJ l((P&8n#F%%F$dmm-zIT)@lEW_+SkQ5)S`F0%~V6`G^h00w~_?>scpgJ(vWfviX12$(Z`>w zjCT?yV1y^C*lD3ZWFB1USfQFq1Y| zYzfT#1N;)W!6O_R;pf=_noy?-BFn?9Zao&!$sDNb^n zPxBeq=uNyRvCA`oRTVgrN*);jlZ;X8P>#yOY0EC)ud8LryX_o; Wp(BrQKXhenL%&?DUn4{Z*y1l%mapId diff --git a/lib/__pycache__/cmmde_xtb.cpython-39.pyc b/lib/__pycache__/cmmde_xtb.cpython-39.pyc index 43e96ad21edc37a5b045f5903a7e520878c9e3b2..dc3bac776e730126cacddc68271bd0e50df3f7d5 100644 GIT binary patch delta 1145 zcmZ`&O-vI(6rMM;-7X7V+HQXUD^}E)s+5`#6N2Io#u(zwgVA6j&6I?ITiGrRsnhg; z@n)#b#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B~Gia`wGUVlLPnqS`C3U5&7t%bQ~?uHYYJ1x)&Zd<@VObB|Lj-rH#vf0D#}PO#lD@ diff --git a/lib/cmmde_orca.py b/lib/cmmde_orca.py index c261592..cff78af 100644 --- a/lib/cmmde_orca.py +++ b/lib/cmmde_orca.py @@ -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 {} diff --git a/lib/cmmde_xtb.py b/lib/cmmde_xtb.py index 10faf3d..899b98f 100644 --- a/lib/cmmde_xtb.py +++ b/lib/cmmde_xtb.py @@ -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 @@ -56,4 +71,5 @@ $end""".format(nrun,npoint,anopt,kpush,kpull,ppull,alp),file=f) os.system('sbatch run.sh') +