orgdisord.enumerate.make_whole_molecule#
- orgdisord.enumerate.make_whole_molecule(atoms, cutoff_scale=1.25, preserve_pbc=False, exclude_hh=True)[source]#
Unwrap connected molecules so each connected component is contiguous in Cartesian space.
atoms: ASE Atoms (can be periodic). Function works from current positions and cell.
cutoff_scale: multiplier for (r_i + r_j) to determine bond cutoff between atoms i and j.
preserve_pbc: if True, preserve atoms.pbc; otherwise set pbc=False on returned Atoms.
exclude_hh: if True, ignore H-H pairs when building connectivity graph (prevents false H-H bonds).
Returns a copy of atoms with positions moved by integer multiples of cell vectors so connected components are placed compactly (no pieces split across periodic images).