コード例 #1
0
ファイル: poscar2.py プロジェクト: ryokbys/vasp-utils
    (options,args)= parser.parse_args()

    out_format= options.format
    outfname= options.outfname
    sid1= options.sid1
    sid2= options.sid2
    sid3= options.sid3
    #...check output format
    if not out_format[0] in ('a','p'):
        print ' ERROR: Output format must be akr or pmd.'
        exit()

    #...read POSCAR as 0th step
    if len(args)==0 and not os.path.exists('./POSCAR'):
        print ' ERROR: Any POSCAR file have not been specified.'
        exit()
    elif len(args)==0:
        infname= './POSCAR'
    else:
        infname= args[0]
    #aSys= AtomSystem()
    aSys.read_POSCAR(infname)

    change_species(sid1,sid2,sid3)

    if out_format[0] in ('a'):
        aSys.write_akr(outfname)
    elif out_format[0] in ('p'):
        aSys.write_pmd(outfname)