molsysmt.pbc.wrap_to_pbc#
- molsysmt.pbc.wrap_to_pbc(molecular_system, selection='all', structure_indices='all', box_origin='[0,0,0] nanometers', box_center=None, center_of_selection=None, weights=None, center_coordinates='[0,0,0] nanometers', keep_covalent_bonds=False, syntax='MolSysMT', engine='MolSysMT', in_place=False, skip_digestion=False)[source]#
Wrap coordinates into the primary periodic box.
- Parameters:
molecular_system (molecular system) – Input system.
selection (str, list, tuple or numpy.ndarray, default 'all') – Atoms to wrap.
structure_indices ('all' or array-like, default 'all') – Structures/frames to process.
box_origin (quantity, default '[0,0,0] nanometers') – Origin of the periodic box.
box_center (quantity, optional) – Center of the box; if provided, uses center-based wrapping.
center_of_selection (str or array-like, optional) – Selection to center before wrapping (uses center_coordinates).
weights (array-like, optional) – Weights for centering when center_of_selection is given.
center_coordinates (quantity, default '[0,0,0] nanometers') – Target coordinates for centering the center_of_selection.
keep_covalent_bonds (bool, default False) – Placeholder (not implemented) to preserve covalent connectivity across PBC.
syntax (str, default 'MolSysMT') – Selection syntax for string selections.
engine ({'MolSysMT'}, default 'MolSysMT') – Backend.
in_place (bool, default False) – If True, modify the input system; otherwise return a wrapped copy.
skip_digestion (bool, default False) – Whether to skip argument digestion.
- Returns:
Wrapped system when in_place=False, otherwise None.
- Return type:
molecular system or None
- Raises:
NotImplementedMethodError – If an unsupported engine is requested.
.. versionadded: – 1.0.0: