From be5cb3dce0fd1792c51014de2b0d9d29b1e6441d Mon Sep 17 00:00:00 2001 From: Aditya Wibawa Sakti Date: Wed, 2 Nov 2022 12:53:24 +0900 Subject: [PATCH] add XTB1 to the DFTB+ module --- bin/cmmde.py | 2 +- lib/__pycache__/cmmde_dftb.cpython-39.pyc | Bin 7157 -> 7172 bytes lib/cmmde_dftb.py | 89 +++++++++++----------- 3 files changed, 46 insertions(+), 45 deletions(-) diff --git a/bin/cmmde.py b/bin/cmmde.py index 2f34515..d1c8823 100755 --- a/bin/cmmde.py +++ b/bin/cmmde.py @@ -357,7 +357,7 @@ if opt.job == 'checkopt' and opt.software == 'dock': checkopt(opt.nligands) if opt.software == 'dftb': - if '.xyz' in opt.input: + if '.xyz' in opt.input or '.gen' in opt.input: geom = opt.input elif 'POSCAR' in opt.input or '.poscar' in opt.input: poscar2gen(opt.input) diff --git a/lib/__pycache__/cmmde_dftb.cpython-39.pyc b/lib/__pycache__/cmmde_dftb.cpython-39.pyc index 972b52af890fbe8a079cc9695017a6c8916b74b3..02245149e8d85648abf544ae9fe8549d8131f388 100644 GIT binary patch delta 344 zcmexr-eSR<$ji&c00jI`5|fKI^6ubeESr3c_Zwr*DHEP7yavp^;@Q{kVNC1cHWk#DT~NcHB4W-^ z%b&*qWU+x*DNHpCWegLTi*8MB6trb@n7m)moRtS?uJz=Ff+Caoh2$BNHtP#nvN2AX zoGD=uRb8uKpkTnIfCdZ{KoVGlK@u3kK(%0mBC$!bkCBmUa=%m|6C3AbHtBx=z=Tzz diff --git a/lib/cmmde_dftb.py b/lib/cmmde_dftb.py index 4d8f438..e5b3a69 100755 --- a/lib/cmmde_dftb.py +++ b/lib/cmmde_dftb.py @@ -225,18 +225,19 @@ def dftb(geom,job,activeatoms,method,parapath,dispersion,kpts,hcorr): 0 0 {} {} {} {} }} - }}""".format(kpts[0],kpts[1],kpts[2],shift,shift,shift)) - print("Hamiltonian = DFTB {",file=f) - if method == 'DFTB2': - print("scc = Yes",file=f) - print("MaxSCCIterations = 1000",file=f) - if method == 'DFTB3diag': - print("""scc = Yes + }}""".format(kpts[0],kpts[1],kpts[2],shift,shift,shift),file=f) + else: + print("Hamiltonian = DFTB {",file=f) + if method == 'DFTB2': + print("scc = Yes",file=f) + print("MaxSCCIterations = 1000",file=f) + if method == 'DFTB3diag': + print("""scc = Yes ThirdOrder = Yes MaxSCCIterations = 1000 """,file=f) - if method == 'DFTB3': - print("""scc = Yes + if method == 'DFTB3': + print("""scc = Yes ThirdOrderFull = Yes """,file=f) ## Koreksi ikatan hidrogen @@ -246,13 +247,13 @@ def dftb(geom,job,activeatoms,method,parapath,dispersion,kpts,hcorr): 'DFTB2': '4.5' } if hcorr == 'hdamp': - print("""HCorrection = Damping {{ + print("""HCorrection = Damping {{ Exponent = {} }}""".format(hdamp[method]),file=f) - if hcorr == 'H5': - print("""HCorrection = H5{ }""",file=f) - if dispersion == 'D3': - print("""Dispersion = DftD3 { + if hcorr == 'H5': + print("""HCorrection = H5{ }""",file=f) + if dispersion == 'D3': + print("""Dispersion = DftD3 { Damping = ZeroDamping { sr6 = 0.7461 alpha6 = 14.0 @@ -260,8 +261,8 @@ def dftb(geom,job,activeatoms,method,parapath,dispersion,kpts,hcorr): s6 = 1.0 s8 = 3.209 }""",file=f) - if dispersion == 'D3BJ': - print("""Dispersion = DftD3 { + if dispersion == 'D3BJ': + print("""Dispersion = DftD3 { Damping = BeckeJohnson { a1 = 0.5719 a2 = 3.6017 @@ -269,8 +270,8 @@ def dftb(geom,job,activeatoms,method,parapath,dispersion,kpts,hcorr): s6 = 1.0 s8 = 0.5883 }""",file=f) - if dispersion == 'D3H5': - print("""Dispersion = DftD3{ + if dispersion == 'D3H5': + print("""Dispersion = DftD3{ Damping = ZeroDamping{ sr6 = 1.25 alpha6 = 29.61 @@ -279,41 +280,41 @@ def dftb(geom,job,activeatoms,method,parapath,dispersion,kpts,hcorr): s8 = 0.49 HHRepulsion = Yes }""",file=f) - print("""SlaterKosterFiles = Type2FileNames {{ + print("""SlaterKosterFiles = Type2FileNames {{ Prefix = {}/ Separator = "-" Suffix = ".skf" """.format(parapath),file=f) - print('}',file=f) + print('}',file=f) # Mapping bilangan kuantum azimuth ke penamaan orbital - azi2orb = {'1':'s','2':'p','3':'d','4':'f'} + azi2orb = {'1':'s','2':'p','3':'d','4':'f'} - print("MaxAngularMomentum {",file=f) - for element in elements: - print("""{} = "{}" """.format(element,azi2orb[azimuth(element)]),file=f) - print("}",file=f) + print("MaxAngularMomentum {",file=f) + for element in elements: + print("""{} = "{}" """.format(element,azi2orb[azimuth(element)]),file=f) + print("}",file=f) - if method == 'DFTB3': - print("HubbardDerivs {",file=f) - for element in elements: - print("""{} = {}""".format(element,hubbard(element)),file=f) - print("}",file=f) + if method == 'DFTB3': + print("HubbardDerivs {",file=f) + for element in elements: + print("""{} = {}""".format(element,hubbard(element)),file=f) + print("}",file=f) # Informasi K-points - kpts = kpts.split('x') - shift = 0 - if int(kpts[0])%2 == 0: - shift+=0.5 - else: - shift +=0 + kpts = kpts.split('x') + shift = 0 + if int(kpts[0])%2 == 0: + shift+=0.5 + else: + shift +=0 # if 'F' or 'S' in coord_type: - if '.gen' in geom: - print("""KPointsAndWeights = SuperCellFolding {{ - {} 0 0 - 0 {} 0 - 0 0 {} - {} {} {} - }}""".format(kpts[0],kpts[1],kpts[2],shift,shift,shift),file=f) + if '.gen' in geom: + print("""KPointsAndWeights = SuperCellFolding {{ + {} 0 0 + 0 {} 0 + 0 0 {} + {} {} {} + }}""".format(kpts[0],kpts[1],kpts[2],shift,shift,shift),file=f) - print("}", file=f) + print("}", file=f) if job == 'dos': print("Analysis {",file=f) print(" ProjectStates {",file=f)