Example #1
0
def main():
    a = Poscar("POSCAR") 
    b = a.parser()
    b.assignAtomTypes()
    b.assignEleTypes()
    conf, steps = parse_XDATCAR()
    toPOSCAR(b, conf, steps)
Example #2
0
def main():
    a = Poscar("POSCAR") 
    b = a.parser()
    b.assignAtomTypes()
    b.assignEleTypes()
    conf, steps = parse_XDATCAR()
    toPOSCAR(b, conf, steps)
Example #3
0
def main():
    t0 = 0
    if len(sys.argv) > 1:
        t0 = int(sys.argv[1])
    a = Poscar("POSCAR")
    b = a.parser()
    b.assignAtomTypes()
    b.assignEleTypes()
    conf, steps = parse_XDATCAR(t0)
    toPOSCAR(b, conf, steps)
Example #4
0
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument("fname",
                        default="POSCAR",
                        nargs="?",
                        help="geo file name")
    parser.add_argument("-n", type=int, help="number of fixed atoms")
    parser.add_argument("-r",
                        action='store_true',
                        help="reverse the fixing order")
    args = parser.parse_args()
    if args.n:
        n_fixed = int(args.n)
    else:
        n_fixed = int(input("number of fixed atoms: "))

    poscar_file = args.fname
    a = Poscar(poscar_file)
    b = a.parser()
    b.assignAtomTypes()
    b.assignEleTypes()
    vol = b.getVol()
    mass = b.getMass()
    density = mass / vol * ATOMIC_MASS_CONSTANT * 1e27

    shutil.copy(poscar_file, poscar_file + ".1")

    coords = []
    for i in range(len(b.atoms)):
        coords.append([])

    for i in range(len(b.atoms)):
        coords[i].append(i)
        for j in b.atoms[i].x:
            coords[i].append(j)
    coords.sort(key=lambda x: x[3])
    if args.r:
        coords.sort(key=lambda x: x[3], reverse=True)

    for i in range(len(coords)):
        if i < n_fixed:
            coords[i].append("F")
        else:
            coords[i].append("T")
    coords.sort(key=lambda x: x[0])

    for i in range(len(b.atoms)):
        b.atoms[i].xr = [0, 0, 0]
        if coords[i][-1] == "F":
            b.atoms[i].xr = [1, 1, 1]
    toPoscar(b, "POSCAR_new")
Example #5
0
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument("fname", default="POSCAR", nargs="?", help="geo file name")
    parser.add_argument("-xyz", nargs=1, help="xyz, xy, z")
    parser.add_argument("-scale", nargs=2, type=float, help="scale factor")
    args = parser.parse_args()
    #gen_scan(args)
    
    poscar_file = "POSCAR"
    a = Poscar(poscar_file)
    poscar_file = args.fname
    a = Poscar(poscar_file)
    b = a.parser()
    b.assignAtomTypes()
    b.assignEleTypes()
    gen_scan(b, args)
Example #6
0
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument("fname", default="POSCAR", nargs="?", help="geo file name")
    parser.add_argument("-xyz", nargs=1, help="xyz, xy, z")
    parser.add_argument("-scale", nargs=2, type=float, help="scale factor")
    args = parser.parse_args()
    #gen_scan(args)
    
    poscar_file = "POSCAR"
    a = Poscar(poscar_file)
    poscar_file = args.fname
    a = Poscar(poscar_file)
    b = a.parser()
    b.assignAtomTypes()
    b.assignEleTypes()
    gen_scan(b, args)
Example #7
0
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument("fname", default="POSCAR", nargs="?", help="geo file name")
    args = parser.parse_args()
    
    scan = Scan()
    
    poscar_file = args.fname
    a = Poscar(poscar_file)
    b = a.parser()
    b.assignAtomTypes()
    b.assignEleTypes()

    # Read Config
    read_conf(scan)

    # Generate input
    gen_input(scan, b)
Example #8
0
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument("fname", default="POSCAR", nargs="?", help="geo file name")
    args = parser.parse_args()
    
    poscar_file = args.fname
    a = Poscar(poscar_file)
    b = a.parser()
    b.assignAtomTypes()
    b.assignEleTypes()
    print b.getVol()
    #print b.pbc
    
    toXyz(b)
    toGeo(b, "geo")
    toPdb(b, "sim.pdb")
    toReaxLammps(b, "lammps.data")
    toJdft(b, "coords")
Example #9
0
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument("fname", default="POSCAR", nargs="?", help="geo file name")
    args = parser.parse_args()
    
    poscar_file = args.fname
    a = Poscar(poscar_file)
    b = a.parser()
    b.assignAtomTypes()
    b.assignEleTypes()
    vol = b.getVol()
    mass = b.getMass()
    density = mass/vol*ATOMIC_MASS_CONSTANT*1e27
    print density
    #print b.pbc
    
    toXyz(b, "contcar.xyz")
    toGeo(b, "geo")
    toPdb(b, "sim.pdb")
    toReaxLammps(b, "lammps.data")
    toJdft(b, "coords")
Example #10
0
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument("fname",
                        default="POSCAR",
                        nargs="?",
                        help="geo file name")
    args = parser.parse_args()

    scan = Scan()

    poscar_file = args.fname
    a = Poscar(poscar_file)
    b = a.parser()
    b.assignAtomTypes()
    b.assignEleTypes()

    # Read Config
    read_conf(scan)

    # Generate input
    gen_input(scan, b)
Example #11
0
from mytype import System, Molecule, Atom
from poscar import Poscar
from output_conf import toXyz, toGeo, toPdb, toReaxLammps

import sys

if len(sys.argv) > 1:
    fname = sys.argv[1]
else:
    fname = "CONTCAR"
a = Poscar(fname)
b = a.parser()
b.assignAtomTypes()
b.assignEleTypes()
print b.getVol()

toXyz(b)
toGeo(b, "geo")
toPdb(b, "sim.pdb")
toReaxLammps(b, "lammps.data")

Example #12
0
def main():
    a = Poscar("POSCAR") 
    b = a.parser()
    conf, steps = parse_XDATCAR()
    toPOSCAR(b, conf, steps)
Example #13
0
""" read the geo file and output to data (LAMMPS), geo and xyz file.
"""
import os
from mytype import System, Molecule, Atom
from poscar import Poscar
from output_conf import toXyz, toGeo

os.chdir("/home/tao/Documents/wag/alpha/opt")
a = Poscar("alpha1.vasp")
b = a.parser()
toXyz(b)
toGeo(b)