exit(0) rcut = 3.2 filename = sys.argv[1] outcarFlag = False lammpsFlag = False if "OUTCAR" in filename: outcarFlag = True lammpsFlag = False else: outcarFlag = False lammpsFlag = True if outcarFlag: nAtoms = outcarIO.nIons(filename) basis = array(map(array, outcarIO.basis(filename))) #Find the starting locations of atomic data in outcarfile grepResults = subprocess.check_output("grep -b POSITION %s" % filename, shell=True).split("\n") bytenums = [int(i.split(":")[0]) for i in grepResults if len(i) > 2] outcar = open(filename, "r") tetraOut = open(filename + ".tetra", "w") tetraOut.write("AverageTetra PerAtomTetra\n") for i, b in enumerate(bytenums): outcar.seek(b) outcar.readline() outcar.readline()
filename = sys.argv[1] rcut = float(sys.argv[2]) outcarFlag=False lammpsFlag=False if "OUTCAR" in filename: outcarFlag=True lammpsFlag=False else: outcarFlag=False lammpsFlag=True neighbs=list() if outcarFlag: nAtoms = outcarIO.nIons(filename) basis = array(map(array,outcarIO.basis(filename))) bounds = [[0,basis[0][0]],[0,basis[1][1]],[0,basis[2][2]]] #Find the starting locations of atomic data in outcarfile grepResults = subprocess.check_output("grep -b POSITION %s"%filename,shell=True).split("\n") bytenums=[int(i.split(":")[0]) for i in grepResults if len(i)>2] outcar = open(filename,"r") for i,b in enumerate(bytenums): outcar.seek(b) outcar.readline() outcar.readline() atoms = [map(float,outcar.readline().split()[:3]) for a in range(nAtoms)] neighbs.append(neighbors.neighbors(atoms,bounds,rcut))
#make a directory for the movie #for configs in outcar # read in a config from outcar # calculate tetrahedral order param or CN # generate the image and save as a file def usage(): print "Usage: %s <Outcar> <Reference Config #>"%sys.argv[0].split("/")[-1] if len(sys.argv)<2: usage() exit(0) outcarFile = sys.argv[1] nAtoms = outcarIO.nIons(outcarFile) basis = array(map(array,outcarIO.basis(outcarFile))) movieDir = "./outcarMovie/" prefix = "outcarTet" suffix = ".png" if not os.path.exists(movieDir): os.makedirs(movieDir) #Find the starting locations of atomic data in outcarfile grepResults = subprocess.check_output("grep -b POSITION %s"%outcarFile,shell=True).split("\n") bytenums=[int(i.split(":")[0]) for i in grepResults if len(i)>2] outcar= open(outcarFile,"r") mlab.figure(bgcolor=(0.8,0.8,0.8)) for i,b in enumerate(bytenums): if i%2==0:
# read in a config from outcar # calculate tetrahedral order param or CN # generate the image and save as a file def usage(): print "Usage: %s <Outcar> <Reference Config #>" % sys.argv[0].split( "/")[-1] if len(sys.argv) < 2: usage() exit(0) outcarFile = sys.argv[1] nAtoms = outcarIO.nIons(outcarFile) basis = array(map(array, outcarIO.basis(outcarFile))) movieDir = "./outcarMovie/" prefix = "outcarTet" suffix = ".png" if not os.path.exists(movieDir): os.makedirs(movieDir) #Find the starting locations of atomic data in outcarfile grepResults = subprocess.check_output("grep -b POSITION %s" % outcarFile, shell=True).split("\n") bytenums = [int(i.split(":")[0]) for i in grepResults if len(i) > 2] outcar = open(outcarFile, "r") mlab.figure(bgcolor=(0.8, 0.8, 0.8)) for i, b in enumerate(bytenums):