orgdisord.enumerate.wrap_components_into_cell

orgdisord.enumerate.wrap_components_into_cell#

orgdisord.enumerate.wrap_components_into_cell(atoms)[source]#

Shift each connected component (molecule) by whole cell vectors so that its centroid lies inside the cell. Molecules are kept whole; atoms of molecules larger than (or straddling) the cell may still lie outside [0, 1).

Only use this on a single reference structure: wrapping several configs independently is discontinuous for molecules whose centroid is near a cell face.

Returns a copy of atoms.