Exemplo n.º 1
0
    You should set a 'kpoints_test' tag in the specs file, like

        kpoints_test:
          density_change: [1000, 2000, 4000]
          force_gamma: True

    Obviously, 'kpoints' tag should be omitted.

    """

    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_specs = run_specs['kpoints_test']
    if 'force_gamma' in kpoints_specs:
        force_gamma = kpoints_specs['force_gamma']
    else:
        force_gamma = False

    if 'density_change' in kpoints_specs:
        density_change = np.array(kpoints_specs['density_change'])
    else:
        density_change = np.array(range(kpoints_specs['begin'], kpoints_specs['end'], kpoints_specs['step']))
    energy = np.zeros(len(density_change))
Exemplo n.º 2
0
    parameters and find the correct volumes corresponding to the given pressure
    range. A second run is done using those volume values. the tag
    'skip_test_run' tells the code to just use the fitting_params.json in the
    working directory without doing the test run.

    If 'dump_to_json' exists in the specs file and is set to a path, output some
    important results to that file.

    """

    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)

    is_mag = incar['ISPIN'] == 2 if 'ISPIN' in incar else False

    if 'volume' in run_specs and run_specs['volume']:
        volume_params = run_specs['volume']
        V_begin = volume_params['begin']
        V_end = volume_params['end']
        V_sample_point_num = volume_params['sample_point_num']
    else:
        V0 = structure.volume
        V_begin = V0 * 9./10
        V_end = V0 * 11./10