Skip to content

Commit

Permalink
select adsorbate by lowest energy including ZPE
Browse files Browse the repository at this point in the history
  • Loading branch information
mjohnson541 committed Nov 2, 2024
1 parent 95409b0 commit e100a5a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pynta/coveragedependence.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from pynta.mol import *
from pynta.geometricanalysis import *
from pynta.tasks import *
from pynta.postprocessing import get_adsorbate_energies
from pysidt import *
from pysidt.extensions import split_mols
from pysidt.sidt import *
Expand Down Expand Up @@ -1104,15 +1105,17 @@ def get_best_adsorbate_xyz(adsorbate_path,sites,nslab):
xyzs = get_unique_sym(geoms)
adsorbate = None
min_energy = np.inf
Es,_,freq = get_adsorbate_energies(adsorbate_path)
for xyz in xyzs:
geo = read(xyz)
strind = os.path.split(xyz)[1].split(".")[0]
occ = get_occupied_sites(geo,sites,nslab)
required_surface_inds = set([ind+nslab for ind in ase_to_mol_surface_atom_map.keys()])
found_surface_inds = set([site["bonding_index"] for site in occ])
if len(occ) >= len(mol.get_adatoms()) and required_surface_inds.issubset(found_surface_inds):
if geo.get_potential_energy() < min_energy:
if Es[strind] < min_energy:
adsorbate = xyz
min_energy = geo.get_potential_energy()
min_energy = Es[strind]

return adsorbate

Expand Down

0 comments on commit e100a5a

Please sign in to comment.