if os.path.isfile('../properties.json'):
        properties = rmd.fileload('../properties.json')
        if 'ISPIN' not in incar:
            if rmd.detect_is_mag(properties['mag']):
                incar.update({'ISPIN': 2})
            else:
                incar.update({'ISPIN': 1})

    # higher priority for run_specs
    if 'poscar' in run_specs:
        structure = rmd.get_structure(run_specs)
    elif os.path.isfile('../POSCAR'):
        structure = mg.Structure.from_file('../POSCAR')
        rmd.insert_elem_types(run_specs, structure)

    kpoints = rmd.read_kpoints(run_specs, structure)

    run_volume_dirname = phonopy_specs['volumes_and_structures']['from']\
        if 'volumes_and_structures' in phonopy_specs and \
           'from' in phonopy_specs['volumes_and_structures'] and \
           phonopy_specs['volumes_and_structures']['from'] else 'run_volume'

    if isinstance(run_volume_dirname, str):
        fitting_results = rmd.fileload(os.path.join('..',
            run_volume_dirname, 'fitting_results.json'))[-1]
        volume = fitting_results['volume']
        energy = fitting_results['energy']
        structures = fitting_results['structures']
    elif isinstance(run_volume_dirname, list):
        volume = []
        energy = []
예제 #2
0
    if os.path.isfile('../properties.json'):
        properties = rmd.fileload('../properties.json')
        if 'ISPIN' not in incar:
            if rmd.detect_is_mag(properties['mag']):
                incar.update({'ISPIN': 2})
            else:
                incar.update({'ISPIN': 1})

    # higher priority for run_specs
    if 'poscar' in run_specs:
        structure = rmd.get_structure(run_specs)
    elif os.path.isfile('../POSCAR'):
        structure = mg.Structure.from_file('../POSCAR')
        rmd.insert_elem_types(run_specs, structure)

    kpoints = rmd.read_kpoints(run_specs, structure)

    # first SC run
    incar.write_file('INCAR')
    kpoints.write_file('KPOINTS')
    structure.to(filename='POSCAR')
    rmd.write_potcar(run_specs)
    rmd.run_vasp()

    # second non-SC run
    incar.update(run_specs['dos']['incar'])
    kpoints = rmd.read_kpoints(run_specs['dos'], structure)
    structure = mg.Structure.from_file('CONTCAR')

    incar.write_file('INCAR')
    kpoints.write_file('KPOINTS')
예제 #3
0
    relaxation parameters, and the second and after runs with high relaxation
    parameters.

    """

    # pre-config
    run_specs, filename = rmd.get_run_specs_and_filename()
    rmd.chdir(rmd.get_run_dir(run_specs))
    rmd.filedump(run_specs, filename)
    rmd.init_stdout()

    # read settings
    rmd.infer_from_json(run_specs)
    structure = rmd.get_structure(run_specs)
    incar = rmd.read_incar(run_specs)
    kpoints = rmd.read_kpoints(run_specs, structure)
    stack_oszicar()

    # write input files and run vasp
    structure.to(filename='POSCAR')
    incar.write_file('INCAR')
    kpoints.write_file('KPOINTS')
    rmd.write_potcar(run_specs)
    rmd.run_vasp()

    # rerun once according to the specs
    if 'rerun' in run_specs:
        stack_oszicar()
        structure = mg.Structure.from_file('CONTCAR')
        structure.to(filename='POSCAR')
        if 'incar' in run_specs['rerun']:
예제 #4
0
        KPAR_NPAR_test
          change: [[4,1], [4,2], [4,4], [4,8], [4,16], [8,1], [8,2],
                   [8,4], [8,8], [16,1], [16,2], [16,4], [32,1], [32,2]]

    """

    run_specs, filename = rmd.get_run_specs_and_filename()
    rmd.chdir(rmd.get_run_dir(run_specs))
    rmd.filedump(run_specs, filename)
    rmd.init_stdout()

    rmd.infer_from_json(run_specs)
    structure = rmd.get_structure(run_specs)
    incar = rmd.read_incar(run_specs)
    kpoints = rmd.read_kpoints(run_specs, structure)

    KPAR_NPAR_change = np.array(run_specs['KPAR_NPAR_test']['change'])
    energy = np.zeros(len(KPAR_NPAR_change))
    time = np.zeros(len(KPAR_NPAR_change))

    kpoints.write_file('KPOINTS')
    structure.to(filename='POSCAR')
    rmd.write_potcar(run_specs)

    # main workflow
    for i, KPAR_NPAR in enumerate(KPAR_NPAR_change):
        incar['KPAR'] = KPAR_NPAR[0]
        incar['NPAR'] = KPAR_NPAR[1]
        incar.write_file('INCAR')
        rmd.run_vasp()
예제 #5
0
    It will cause the INCAR and/or KPOINTS to change before starting the static
    run.

    """

    # pre-config
    run_specs, filename = rmd.get_run_specs_and_filename()
    rmd.chdir(rmd.get_run_dir(run_specs))
    rmd.filedump(run_specs, filename)
    rmd.init_stdout()

    # read settings
    incar = rmd.read_incar(run_specs)
    structure = rmd.get_structure(run_specs)
    kpoints = rmd.read_kpoints(run_specs, structure)

    # write input files and run vasp
    incar.write_file('INCAR')
    kpoints.write_file('KPOINTS')
    structure.to(filename='POSCAR')
    rmd.write_potcar(run_specs)
    rmd.run_vasp()

    # static
    structure = mg.Structure.from_file('CONTCAR')
    structure.to(filename='POSCAR')
    if 'incar' in run_specs['static']:
        incar.update(run_specs['static']['incar'])
        incar.write_file('INCAR')
    if 'kpoints' in run_specs['static']: