def main(): a = Poscar("POSCAR") b = a.parser() b.assignAtomTypes() b.assignEleTypes() conf, steps = parse_XDATCAR() toPOSCAR(b, conf, steps)
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)
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")
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)
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)
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")
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")
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")
def main(): a = Poscar("POSCAR") b = a.parser() conf, steps = parse_XDATCAR() toPOSCAR(b, conf, steps)
""" 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)