Révision de04dab9

b/modules/refinement.py
27 27
    @param inp_vars: Calculation parameters from input file.
28 28
    """
29 29
    import os
30
    import numpy as np
30 31
    from modules.formats import collect_confs
31 32
    from modules.calculation import run_calc, check_finished_calcs
32 33

  
......
59 60
    selected_confs = select_stable_confs(conf_list, inp_vars['energy_cutoff'])
60 61
    logger.info(f"Selected {len(selected_confs)} structures to carry out the"
61 62
                f" refinement")
62
    run_calc('refinement', inp_vars, selected_confs)
63
    # run_calc('refinement', inp_vars, selected_confs)
63 64
    finished_calcs, failed_calcs = check_finished_calcs('refinement',
64 65
                                                        inp_vars['code'])
65 66
    conf_list = collect_confs(finished_calcs, inp_vars['code'], 'refinement',
66 67
                              inp_vars['special_atoms'])
67
    most_stable_conf = select_stable_confs(conf_list, 0)[0]
68
    sorted_confs = select_stable_confs(conf_list, np.inf)
68 69
    logger.info("Finished the procedures for the refinement of "
69
                "adsorbate-surface structures section. Most stable structure "
70
                f"is {most_stable_conf.info['id']} with a Total energy of "
71
                f"{most_stable_conf.info['energy']} eV.")
70
                "adsorbate-surface structures section. ")
71
    logger.info("Most stable structure "
72
                f"is {sorted_confs[0].info['ref']} with a total energy of "
73
                f"{sorted_confs[0].info['energy']} eV.")
74
    confs_str = "\n".join([" ".join((str(conf.info['ref']), 'E =',
75
                                     str(conf.info['energy'] -
76
                                         sorted_confs[0].info['energy']),
77
                                     'eV'))
78
                           for conf in sorted_confs])
79
    logger.info("The relative energies, of all structures obtained at the "
80
                "refinement stage, respect the most stable one "
81
                f"({sorted_confs[0].info['ref']}) are:\n{confs_str}")

Formats disponibles : Unified diff