예제 #1
0
        os.system('cp %sPOTCAR .' % mirdir)
        os.system('cp %svaspjob .' % mirdir)
        os.system('cp %sPOSCAR POSCARaflow' % mirdir)
        #        totatoms = km.aflow2poscar(path)
        #        os.system('aconvasp --sprim < POSCAR0 > POSCAR')
        #        back = subprocess.check_output(["echo", "Hello World!"])
        #        back = check_out(["echo", "Hello World!"])
        #        back = os.system('mink_reduction.py < POSCAR0 ')
        #        back = subprocess.check_output(['mink_reduction.py',' <',' POSCAR0 '], shell=True,)
        #        back = nstrip(subprocess.check_output(['mink_reduction.py < POSCAR0'], shell=True,).split())
        #        print 'back'
        #        print back

        pfile = open('POSCARaflow', 'r')
        rlines = [i.strip() for i in pfile.readlines()]
        pos = POSCAR(lines=rlines)
        totatoms = np.sum(pos.types)
        N = np.rint(Nkppra / totatoms).astype(int)
        oldROD = pos.rod
        oldbvecs = np.array(pos.bvecs)
        reallatt = np.array((pos.avecs[0], pos.avecs[1], pos.avecs[2]))
        print "Real lattice"
        print reallatt
        print "Recip lattice"
        reciplatt = np.array((pos.bvecs[0], pos.bvecs[1], pos.bvecs[2]))
        print reciplatt
        print "Recip lattice/2pi"
        reciplatt = np.array((pos.bvecs[0], pos.bvecs[1], pos.bvecs[2]))
        print reciplatt / 2 / np.pi
        print "Real lattice orth defect:", pos.orthogonality_defect
        print "Recp lattice orth defect:", pos.rod
예제 #2
0
############################################################ main

if __name__ == "__main__":

    args = docopt(__doc__)
    # print args

    zmin = float(args['--zmin'])
    zmax = float(args['--zmax'])
    sfplane = args['--plane']
    ndiv = int(args['--ndiv'])
    _fname = args['POSCAR']
    dr = []
    for i in range(len(args['DX'])):
        dr.append((float(args['DX'][i]), float(args['DY'][i])))

    if not sfplane in ('x', 'y', 'z'):
        print ' --plane must be x, y, or z !!!'
        print ' Now --plane=', sfplane
        exit

    if zmin < 0.0 or zmin > 1.0 or zmax < 0.0 or zmax > 1.0 or zmax < zmin:
        print ' Should be 0.0 <= zmin < zmax < 1.0 !!!'
        print ' zmin, zmax = ', zmin, zmax
        exit

    poscar = POSCAR()
    poscar.read(fname=_fname)

    _shift_and_write(poscar, sfplane, ndiv, zmin, zmax, dr)