995 |
995 |
|
996 |
996 |
logger.info('Carrying out procedures for the screening of adsorbate-surface'
|
997 |
997 |
' structures.')
|
998 |
|
if not os.path.isdir("isolated"):
|
999 |
|
err = "'isolated' directory not found. It is needed in order to carry "
|
1000 |
|
"out the screening of structures to be adsorbed"
|
1001 |
|
logger.error(err)
|
1002 |
|
raise FileNotFoundError(err)
|
|
998 |
if inp_vars['use_molec_file']:
|
|
999 |
selected_confs = [adapt_format('ase', inp_vars['use_molec_file'])]
|
|
1000 |
logger.info(f"Using '{inp_vars['use_molec_file']}' as only conformer.")
|
|
1001 |
else:
|
|
1002 |
if not os.path.isdir("isolated"):
|
|
1003 |
err = "'isolated' directory not found. It is needed in order to " \
|
|
1004 |
"carry out the screening of structures to be adsorbed"
|
|
1005 |
logger.error(err)
|
|
1006 |
raise FileNotFoundError(err)
|
1003 |
1007 |
|
1004 |
|
finished_calcs, unfinished_calcs = check_finished_calcs('isolated',
|
1005 |
|
inp_vars['code'])
|
1006 |
|
if not finished_calcs:
|
1007 |
|
err_msg = "No calculations on 'isolated' finished normally."
|
1008 |
|
logger.error(err_msg)
|
1009 |
|
raise FileNotFoundError(err_msg)
|
1010 |
|
|
1011 |
|
logger.info(f"Found {len(finished_calcs)} structures of isolated "
|
1012 |
|
f"conformers whose calculation finished normally.")
|
1013 |
|
if len(unfinished_calcs) != 0:
|
1014 |
|
logger.warning(f"Found {len(unfinished_calcs)} calculations more that "
|
1015 |
|
f"did not finish normally: {unfinished_calcs}. \n"
|
1016 |
|
f"Using only the ones that finished normally: "
|
1017 |
|
f"{finished_calcs}.")
|
1018 |
|
|
1019 |
|
conformer_atoms_list = collect_coords(finished_calcs, inp_vars['code'],
|
1020 |
|
'isolated', inp_vars['special_atoms'])
|
1021 |
|
selected_confs = select_confs(conformer_atoms_list, finished_calcs,
|
1022 |
|
inp_vars['select_magns'],
|
1023 |
|
inp_vars['confs_per_magn'],
|
1024 |
|
inp_vars['code'])
|
|
1008 |
correct_calcs, failed_calcs = check_finished_calcs('isolated',
|
|
1009 |
inp_vars['code'])
|
|
1010 |
if not correct_calcs:
|
|
1011 |
err_msg = "No calculations on 'isolated' finished normally."
|
|
1012 |
logger.error(err_msg)
|
|
1013 |
raise FileNotFoundError(err_msg)
|
|
1014 |
|
|
1015 |
logger.info(f"Found {len(correct_calcs)} structures of isolated "
|
|
1016 |
f"conformers whose calculation finished normally.")
|
|
1017 |
if len(failed_calcs) != 0:
|
|
1018 |
logger.warning(
|
|
1019 |
f"Found {len(failed_calcs)} calculations more that "
|
|
1020 |
f"did not finish normally: {failed_calcs}. \n"
|
|
1021 |
f"Using only the ones that finished normally: "
|
|
1022 |
f"{correct_calcs}.")
|
|
1023 |
|
|
1024 |
conformer_atoms_list = collect_coords(correct_calcs, inp_vars['code'],
|
|
1025 |
'isolated',
|
|
1026 |
inp_vars['special_atoms'])
|
|
1027 |
selected_confs = select_confs(conformer_atoms_list, correct_calcs,
|
|
1028 |
inp_vars['select_magns'],
|
|
1029 |
inp_vars['confs_per_magn'],
|
|
1030 |
inp_vars['code'])
|
1025 |
1031 |
surf = adapt_format('ase', inp_vars['surf_file'], inp_vars['special_atoms'])
|
1026 |
1032 |
surf_ads_list = adsorb_confs(selected_confs, surf, inp_vars)
|
1027 |
1033 |
if len(surf_ads_list) > inp_vars['max_structures']:
|