Skip to content

Commit

Permalink
fix logic error in NEB vacancy supercell generation
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksund committed Jul 31, 2021
1 parent c324919 commit c5d8815
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions pymatgen/analysis/diffusion/neb/pathfinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,9 +448,14 @@ def _split_migrating_and_other_sites(self, vac_mode):
if site.specie != self.isite.specie:
other_sites.append(site)
else:
if not vac_mode or (self.isite.distance(site) <= 1e-8 or self.esite.distance(site) <= 1e-8):
if (self.isite.distance(site) <= 1e-8 or self.esite.distance(site) <= 1e-8):
migrating_specie_sites.append(site)
continue
migrating_specie_sites.append(site)

if not vac_mode:
continue
else:
other_sites.append(site)
return migrating_specie_sites, other_sites

def get_sc_structures(
Expand All @@ -477,7 +482,10 @@ def get_sc_structures(
"""
migrating_specie_sites, other_sites = self._split_migrating_and_other_sites(vac_mode)
base_struct = Structure.from_sites(other_sites)
if vac_mode:
base_struct = Structure.from_sites(other_sites+migrating_specie_sites)
else:
base_struct = Structure.from_sites(other_sites)
sc_mat = get_sc_fromstruct(
base_struct=base_struct,
min_atoms=min_atoms,
Expand Down

0 comments on commit c5d8815

Please sign in to comment.