Beispiel #1
0
def prepare_ts(work_dir, finished_dirs):
    result_path = os.path.join(work_dir, 'prepare_ts.xu')
    if not os.path.exists(result_path):
        print('Start!')
    else:
        print('%s exists!' % (result_path))
        os.system(r'rm %s' % (result_path))
        print('%s is removed!' % (result_path))
    ###
    for dir in finished_dirs:
        suf_dir = os.path.join(dir, 'suf')
        ts_dir = os.path.join(dir, 'ts')
        if os.path.exists(ts_dir):
            if not os.path.exists(os.path.join(ts_dir, 'print-out')):
                shutil.rmtree(ts_dir)
                os.system(r'echo %s rming and making ts >> %s' %
                          (ts_dir, result_path))
                os.mkdir(ts_dir)
                mC.create_VASPsp(dir, suf_dir, ts_dir)
                mC.create_INCAR(dir, suf_dir, ts_dir, '1')
                shutil.copyfile(os.path.join(suf_dir, 'KPOINTS'),
                                os.path.join(ts_dir, 'KPOINTS'))
                create_POSCAR(dir, suf_dir, ts_dir)
                mC.create_POTCAR(ts_dir, './potpaw_PBE.54')
                create_fort188(dir, suf_dir, ts_dir)
        else:
            os.system(r'echo %s making ts >> %s' % (ts_dir, result_path))
            os.mkdir(ts_dir)
            mC.create_VASPsp(dir, suf_dir, ts_dir)
            mC.create_INCAR(dir, suf_dir, ts_dir, '1')
            shutil.copyfile(os.path.join(suf_dir, 'KPOINTS'),
                            os.path.join(ts_dir, 'KPOINTS'))
            create_POSCAR(dir, suf_dir, ts_dir)
            mC.create_POTCAR(ts_dir, './potpaw_PBE.54')
            create_fort188(dir, suf_dir, ts_dir)
Beispiel #2
0
def make_dopdirs(work_dir):
    numbers = ['22', '23', '32', '42', '44', '45', '76', '77', '82']
    elements = ['Ti', 'V', 'Ge', 'Mo', 'Ru', 'Rh', 'Os', 'Ir', 'Pb']
    for base_element in elements:
        suf_dir = os.path.join(work_dir, base_element + 'O2')
        contcar = os.path.join(suf_dir, 'CONTCAR')
        for dop_element in elements:
            dop_dirname = 'dop' + base_element + 'O2' + '_' + dop_element
            dop_dir = os.path.join(work_dir, dop_dirname)
            dopsuf_dir = os.path.join(dop_dir, 'suf')
            if not os.path.exists(dopsuf_dir):
                os.mkdir(dop_dir)
                os.mkdir(dopsuf_dir)
            shutil.copyfile(os.path.join(suf_dir, 'INCAR'),
                            os.path.join(dopsuf_dir, 'INCAR'))
            mS.set_INCAR(os.path.join(dopsuf_dir, 'INCAR'), 'SYSTEM',
                         dop_dirname + '_suf', 1)
            shutil.copyfile(os.path.join(suf_dir, 'POSCAR'),
                            os.path.join(dopsuf_dir, 'POSCAR'))
            change_POSCAR(os.path.join(dopsuf_dir, 'POSCAR'), base_element,
                          dop_element)
            shutil.copyfile(os.path.join(suf_dir, 'KPOINTS'),
                            os.path.join(dopsuf_dir, 'KPOINTS'))
            shutil.copyfile(os.path.join(suf_dir, 'vasp.script'),
                            os.path.join(dopsuf_dir, 'vasp.script'))
            mC.create_POTCAR(dopsuf_dir, './data/potpaw_PBE.54')
Beispiel #3
0
def prepare_ab(work_dir, finished_dirs):
    result_path = os.path.join(work_dir, 'prepare_Hab_sp2.xu')
    if not os.path.exists(result_path):
        print('Start!')
    else:
        print('%s exists!' % (result_path))
        os.system(r'rm %s' % (result_path))
        print('%s is removed!' % (result_path))
    ###
    for dir in finished_dirs:
        suf_dir = os.path.join(dir, 'suf')
        ab_dir = os.path.join(dir, 'Hab_sp2')
        if os.path.exists(ab_dir):
            print(ab_dir)
            if not os.path.exists(os.path.join(ab_dir, 'print-out')):
                shutil.rmtree(ab_dir)
                os.system(r'echo %s rming and making ab >> %s' %
                          (ab_dir, result_path))
                os.mkdir(ab_dir)
                mC.create_VASPsp(dir, suf_dir, ab_dir)
                mC.create_INCAR(dir, suf_dir, ab_dir, '2')
                shutil.copyfile(os.path.join(suf_dir, 'KPOINTS'),
                                os.path.join(ab_dir, 'KPOINTS'))
                create_POSCAR(dir, suf_dir, ab_dir)
                mC.create_POTCAR(ab_dir, './data/potpaw_PBE.54')
        else:
            print(ab_dir)
            os.system(r'echo %s making ab >> %s' % (ab_dir, result_path))
            os.mkdir(ab_dir)
            mC.create_VASPsp(dir, suf_dir, ab_dir)
            mC.create_INCAR(dir, suf_dir, ab_dir, '2')
            shutil.copyfile(os.path.join(suf_dir, 'KPOINTS'),
                            os.path.join(ab_dir, 'KPOINTS'))
            create_POSCAR(dir, suf_dir, ab_dir)
            mC.create_POTCAR(ab_dir, './data/potpaw_PBE.54')
Beispiel #4
0
def prepare_fs(work_dir, finished_dirs):
    result_path = os.path.join(work_dir, 'prepare_fs_M.xu')
    if not os.path.exists(result_path):
        print('Start!')
    else:
        print('%s exists!' % (result_path))
        os.system(r'rm %s' % (result_path))
        print('%s is removed!' % (result_path))
    ###
    for dir in finished_dirs:
        ts_dir = os.path.join(dir, 'ts')
        fs_dir = os.path.join(dir, 'fs')
        if os.path.exists(fs_dir):
            if not os.path.exists(os.path.join(fs_dir, 'print-out')):
                print(fs_dir)
                shutil.rmtree(fs_dir)
                os.system(r'echo %s rming and making fs >> %s' %
                          (fs_dir, result_path))
                os.mkdir(fs_dir)
                mC.create_VASPsp(dir, ts_dir, fs_dir)
                mC.create_INCAR(dir, ts_dir, fs_dir, '2')
                shutil.copyfile(os.path.join(ts_dir, 'CONTCAR'),
                                os.path.join(fs_dir, 'POSCAR'))
                shutil.copyfile(os.path.join(ts_dir, 'KPOINTS'),
                                os.path.join(fs_dir, 'KPOINTS'))
                mC.create_POTCAR(fs_dir, './data/potpaw_PBE.54')
        else:
            print(fs_dir)
            os.system(r'echo %s making fs >> %s' % (fs_dir, result_path))
            os.mkdir(fs_dir)
            mC.create_VASPsp(dir, ts_dir, fs_dir)
            mC.create_INCAR(dir, ts_dir, fs_dir, '2')
            shutil.copyfile(os.path.join(ts_dir, 'KPOINTS'),
                            os.path.join(fs_dir, 'KPOINTS'))
            shutil.copyfile(os.path.join(ts_dir, 'CONTCAR'),
                            os.path.join(fs_dir, 'POSCAR'))
            mC.create_POTCAR(fs_dir, './data/potpaw_PBE.54')