Пример #1
0
 def prepareBand(self):
     tl.mkcd('band')
     # run vasp
     tl.cp('../minimize/POSCAR', '.')
     self.m.ismear = -1
     self.getVaspRun_vasp()
     tl.cd('..')
Пример #2
0
 def getPhonons(self):
     maindir = tl.pwd()
     tl.mkcd('phonons')
     self.runscf()
     self.runph()
     self.collect()
     tl.cd(maindir)
Пример #3
0
 def getbol(self):
     maindir = tl.pwd()
     tl.mkcd('bol')
     self.runscf()
     self.runnscf()
     self.runw()
     tl.cd(maindir)
Пример #4
0
 def prepareet(self):
     atoms = io.read('POSCAR')
     from pyspglib import spglib
     s = spglib.get_spacegroup(atoms)
     from aces.scanf import sscanf
     sgN = sscanf(s, '%s (%d)')[1]
     sg = Spacegroup(sgN)
     atoms.info = {'spacegroup': sg}
     nelect = self.getNelect(outcar='band/OUTCAR')
     # The remaining part takes care of writing the files required by
     # BoltzTraP.
     bandstructure = vasp2boltz.get_vasp_bandstructure(pathname='band/')
     tl.mkcd('et')
     vasp2boltz.write_bandstructure_boltztrap(
         bandstructure, filename='et.energy')
     vasp2boltz.write_structure_boltztrap(atoms, filename='et.struct')
     vasp2boltz.write_intrans_boltztrap(
         n_electrons=nelect, filename='et.intrans')
     s = tl.read('et.energy')
     s = s.replace('HTE', 'et')
     tl.write(s, 'et.energy')
     s = tl.read('et.struct')
     s = s.replace('HTE', 'et')
     tl.write(s, 'et.struct')
     tl.cd('..')
Пример #5
0
 def phonopy(self, dir, mm):
     # if exists(dir+'/FORCE_CONSTANTS'):
     #	return
     mkcd(dir)
     self.creatmini(mm)
     PRunner(mm).generate()
     cd('..')
Пример #6
0
 def getbol(self):
     maindir = tl.pwd()
     tl.mkcd('bol')
     self.runscf()
     self.runnscf()
     self.runw()
     tl.cd(maindir)
Пример #7
0
    def prepareet(self):
        fermi = self.get_fermi()
        nelect = self.get_nelect()
        tl.mkcd('et')
        tl.cp('../band/SYMMETRY', '.')
        tl.cp('../band/EIGENVAL', '.')
        tl.cp('../band/POSCAR', '.')
        lpfac = 5
        if(self.m.soc):
            lpfac = 20
        s = """VASP
0 1 0 0.0
%f 0.0005 0.40  %f
CALC
%d
BOLTZ
.15
800. 50.
0.
""" % (fermi, nelect, lpfac)
        # Format of DOS
        # iskip (not presently used) idebug setgap shiftgap
        # Fermilevel (eV, please note), energygrid (Ry),\
        # 	 energy span around Fermilevel (Ry), No of electrons
        # CALC (calculate expansion coeff), NOCALC read from file
        # lpfac, number of latt-points per k-point
        # run mode (only BOLTZ is supported)
        # (efcut) energy range of chemical potential (Ry)
        # Tmax, temperature grid
        # energyrange of bands given individual \
        # 	DOS output sig_xxx and dos_xxx (xxx is band number)
        tl.write(s, "et.intrans")
        tl.cd('..')
Пример #8
0
 def getPhonons(self):
     maindir = tl.pwd()
     tl.mkcd('phonons')
     self.runscf()
     self.runph()
     self.collect()
     tl.cd(maindir)
Пример #9
0
 def prepareet(self):
     atoms = io.read('POSCAR')
     from pyspglib import spglib
     s = spglib.get_spacegroup(atoms)
     from aces.scanf import sscanf
     sgN = sscanf(s, '%s (%d)')[1]
     sg = Spacegroup(sgN)
     atoms.info = {'spacegroup': sg}
     nelect = self.getNelect(outcar='band/OUTCAR')
     # The remaining part takes care of writing the files required by
     # BoltzTraP.
     bandstructure = vasp2boltz.get_vasp_bandstructure(pathname='band/')
     tl.mkcd('et')
     vasp2boltz.write_bandstructure_boltztrap(bandstructure,
                                              filename='et.energy')
     vasp2boltz.write_structure_boltztrap(atoms, filename='et.struct')
     vasp2boltz.write_intrans_boltztrap(n_electrons=nelect,
                                        filename='et.intrans')
     s = tl.read('et.energy')
     s = s.replace('HTE', 'et')
     tl.write(s, 'et.energy')
     s = tl.read('et.struct')
     s = s.replace('HTE', 'et')
     tl.write(s, 'et.struct')
     tl.cd('..')
Пример #10
0
 def prepareBand(self):
     tl.mkcd('band')
     # run vasp
     tl.cp('../POSCAR', '.')
     self.getVaspRun_vasp()
     # cp('/home1/xggong/zhouy/tcscripts/sis/
     # sis1.1/0/secondorder/dirs/dir_POSCAR-002/EIGENVAL','.')
     # cp('/home1/xggong/zhouy/tcscripts/
     # sis/sis1.1/0/secondorder/dirs/dir_POSCAR-002/OUTCAR','.')
     tl.cd('..')
Пример #11
0
 def prepareBand(self):
     tl.mkcd('band')
     # run vasp
     tl.cp('../POSCAR', '.')
     self.getVaspRun_vasp()
     # cp('/home1/xggong/zhouy/tcscripts/sis/
     # sis1.1/0/secondorder/dirs/dir_POSCAR-002/EIGENVAL','.')
     # cp('/home1/xggong/zhouy/tcscripts/
     # sis/sis1.1/0/secondorder/dirs/dir_POSCAR-002/OUTCAR','.')
     tl.cd('..')
Пример #12
0
 def optimize(self):
     mkcd('optimize')
     cp('../minimize/POSCAR', '.')
     atoms = io.read('POSCAR')
     for i in range(100):
         dir = "%i" % i
         mkcd(dir)
         writevasp(atoms)
         forces, stress, energy = self.energyForce()
         pos = atoms.get_scaled_positions()
         pos += forces * 0.01
Пример #13
0
 def optimize(self):
     mkcd('optimize')
     cp('../minimize/POSCAR', '.')
     atoms = io.read('POSCAR')
     for i in range(100):
         dir = "%i" % i
         mkcd(dir)
         writevasp(atoms)
         forces, stress, energy = self.energyForce()
         pos = atoms.get_scaled_positions()
         pos += forces * 0.01
Пример #14
0
 def getepw(self):
     m = self.m
     maindir = tl.pwd()
     tl.mkcd('epw')
     """为了保证q+k也在k的格点上,必须要求qs*cell*[nk1,nk2,nk3]为整数,即nk=N*nq
     否则可能出现Error in routine createkmap (1):
     """
     u = np.array(m.ekpoints) / np.array(m.kpoints)
     assert np.allclose(np.floor(u + .5), u, rtol=0.01)
     self.runscf()
     self.runnscf()
     self.runepw()
     tl.cd(maindir)
Пример #15
0
 def getepw(self):
     m = self.m
     maindir = tl.pwd()
     tl.mkcd('epw')
     """为了保证q+k也在k的格点上,必须要求qs*cell*[nk1,nk2,nk3]为整数,即nk=N*nq
     否则可能出现Error in routine createkmap (1):
     """
     u = np.array(m.ekpoints) / np.array(m.kpoints)
     assert np.allclose(np.floor(u + .5), u, rtol=0.01)
     self.runscf()
     self.runnscf()
     self.runepw()
     tl.cd(maindir)
Пример #16
0
    def sheng(self):

        self.writeFC()
        m = self.m
        from aces.runners.shengbte import runner as shengbte
        a = shengbte(m)
        tl.mkcd('SHENG')
        tl.cp('../FORCE_CONSTANTS_2ND', '.')
        tl.cp('../FORCE_CONSTANTS_3RD', '.')
        a.getControl()
        # Thermal conductivity calculation
        print("START SHENGBTE...")
        # passthru(config.mpirun+" %s "%m.cores+config.shengbte)
        tl.passthru(config.shengbte)
Пример #17
0
 def getlead(self):
     cd('center')
     left = self.findlead('left')
     right = self.findlead('right')
     cd('..')
     return
     from aces.io.vasp import writevasp
     mkcd('leftlead')
     writevasp(left, 'POSCAR')
     self.runlead()
     cd('..')
     mkcd('rightlead')
     writevasp(right, 'POSCAR')
     self.runlead()
     cd('..')
Пример #18
0
def tDisorder():

    # disorder degree*/
    now = tl.pwd()
    tl.cd('minimize')
    tl.mkcd('disorder')

    disorderLine = tl.shell_exec(
        "cp %s" % SRCHOME + "/in.disorder .;" + config.lammps +
        " <in.disorder 2>err 1>log;tail -1 disorder.txt  2>err;")
    k = disorderLine.split()[1:3]
    if len(k) == 1:
        k.append("")
    disorder, rd = k
    tl.cd(now)
    return (disorder, rd)
Пример #19
0
def tDisorder():

    # disorder degree*/
    now = tl.pwd()
    tl.cd('minimize')
    tl.mkcd('disorder')

    disorderLine = tl.shell_exec(
        "cp %s" %
        SRCHOME +
        "/in.disorder .;" +
        config.lammps +
        " <in.disorder 2>err 1>log;tail -1 disorder.txt  2>err;")
    k = disorderLine.split()[1:3]
    if len(k) == 1:
        k.append("")
    disorder, rd = k
    tl.cd(now)
    return (disorder, rd)
Пример #20
0
    def vfc(self):
        c = self.m.correlation_supercell
        q = []
        u = [int(x / 2) * 2 + 1 for x in c]
        for i in range(u[0]):
            for j in range(u[1]):
                for k in range(u[2]):
                    b = np.array([
                        float(i - c[0] / 2) / c[0],
                        float(j - c[1] / 2) / c[1],
                        float(k - c[2] / 2) / c[2]
                    ])
                    q.append(b)
        m = self.m

        tl.mkcd('vqpoints')
        tl.cp('../FORCE_CONSTANTS', '.')
        tl.cp('../disp.yaml', '.')
        tl.cp('../POSCAR', '.')
        Prun(m).getvqpoints(q)
        tl.cd('..')
Пример #21
0
    def vfc(self):
        c = self.m.correlation_supercell
        q = []
        u = [int(x / 2) * 2 + 1 for x in c]
        for i in range(u[0]):
            for j in range(u[1]):
                for k in range(u[2]):
                    b = np.array([
                        float(i - c[0] / 2) / c[0],
                        float(j - c[1] / 2) / c[1],
                        float(k - c[2] / 2) / c[2]
                    ])
                    q.append(b)
        m = self.m

        tl.mkcd('vqpoints')
        tl.cp('../FORCE_CONSTANTS', '.')
        tl.cp('../disp.yaml', '.')
        tl.cp('../POSCAR', '.')
        Prun(m).getvqpoints(q)
        tl.cd('..')
Пример #22
0
 def writeatoms(self, atoms, label='atoms'):
     tl.mkcd(label)
     self.watoms(atoms)
     tl.cd('..')
Пример #23
0
 def writeatoms(self, atoms, label='atoms'):
     tl.mkcd(label)
     self.watoms(atoms)
     tl.cd('..')