Révision 1e9e784d modules/refinement.py
b/modules/refinement.py | ||
---|---|---|
3 | 3 |
logger = logging.getLogger('DockOnSurf') |
4 | 4 |
|
5 | 5 |
|
6 |
def select_confs(orig_conf_list, energy_cutoff, code): |
|
6 |
def select_confs(orig_conf_list, calc_dirs, energy_cutoff, code):
|
|
7 | 7 |
"""From a list of atomic configurations selects the most stable ones. |
8 | 8 |
|
9 | 9 |
Given a list of ase.Atoms configurations and an energy cutoff, selects all |
10 |
the structures that have an energy at most the value of energy cutoff larger |
|
11 |
than the most stable one. |
|
12 |
@param orig_conf_list: The original list of atomic configurations |
|
10 |
the structures that have an energy lower than, the energy of the most stable |
|
11 |
conformer plus the cutoff. |
|
12 |
|
|
13 |
@param orig_conf_list: List of ase.Atoms objects of the conformers |
|
14 |
@param calc_dirs: List of the directories of the finished calculations |
|
13 | 15 |
@param energy_cutoff: The maximum energy above the most stable configuration |
14 | 16 |
@param code: the code used to carry out the screening of structures. |
15 | 17 |
@return: list of the the most stable configurations within the energy cutoff |
... | ... | |
19 | 21 |
|
20 | 22 |
conf_list = deepcopy(orig_conf_list) |
21 | 23 |
selected_ids = [] |
22 |
conf_enrgs = collect_energies(code, 'screening') * 27.2113845 # Ha to eV
|
|
24 |
conf_enrgs = collect_energies(calc_dirs, code, 'screening')
|
|
23 | 25 |
|
24 | 26 |
for i, conf in enumerate(conf_list): |
25 | 27 |
conf.info['energy'] = conf_enrgs[i] |
... | ... | |
64 | 66 |
conf_list = collect_coords(inp_vars['code'], 'screening', 'ase', |
65 | 67 |
inp_vars['special_atoms']) |
66 | 68 |
logger.info(f"Found {len(conf_list)} structures on screening directory.") |
67 |
selected_confs = select_confs(conf_list, inp_vars['energy_cutoff'],
|
|
68 |
inp_vars['code']) |
|
69 |
selected_confs = select_confs(conf_list, finished_calcs,
|
|
70 |
inp_vars['energy_cutoff'], inp_vars['code'])
|
|
69 | 71 |
run_calc('refinement', inp_vars, selected_confs) |
70 | 72 |
logger.info('Finished the procedures for the refinement of ' |
71 | 73 |
'adsorbate-surface structures section.') |
Formats disponibles : Unified diff