Skip to content

Commit

Permalink
Merge pull request #192 from SCM-NV/DavidOrmrodMorley/update-packmol-…
Browse files Browse the repository at this point in the history
…supercell

Update packmol to use make_supercell_trafo SO--
  • Loading branch information
dormrod authored Jan 10, 2025
2 parents 4703678 + f8d1032 commit d320493
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions interfaces/molecule/packmol.py
Original file line number Diff line number Diff line change
Expand Up @@ -920,11 +920,10 @@ def packmol_around(
# Create a supercell that should encompass the target x/y/z lattice
# this is used for the initial packing of molecules to ensure there is no overlap
# with the original atoms
supercell = original_ucs.copy()
trafo = np.linalg.inv(original_ucs.lattice.vectors) @ np.array(target_lattice)
trafo = np.sign(trafo) * np.ceil(np.abs(trafo))
trafo = np.int_(trafo)
supercell.supercell_trafo(trafo)
supercell = original_ucs.make_supercell_trafo(trafo)
supercell.map_atoms(0)
system_for_packing = supercell
tolerance = kwargs.get("tolerance", 1.5)
Expand Down

0 comments on commit d320493

Please sign in to comment.