8.6.7. Set box dimensions — MDAnalysis.transformations.boxdimensions

Set dimensions of the simulation box to a constant vector across all timesteps.

class MDAnalysis.transformations.boxdimensions.set_dimensions(dimensions, max_threads=None, parallelizable=True)[source]

Set simulation box dimensions.

Timestep dimensions are modified in place.

Example

e.g. set simulation box dimensions to a vector containing unit cell dimensions [a, b, c, alpha, beta, gamma], lengths a, b, c are in the MDAnalysis length unit (Å), and angles are in degrees.

dim = [2, 2, 2, 90, 90, 90]
transform = mda.transformations.boxdimensions.set_dimensions(dim)
u.trajectory.add_transformations(transform)
Parameters
  • dimensions (iterable of floats) – vector that contains unit cell lengths and angles. Expected shapes are (6, 0) or (1, 6)

  • max_threads (int, optional) – The maximum thread number can be used. Default is None, which means the default or the external setting.

  • parallelizable (bool, optional) – A check for if this can be used in split-apply-combine parallel analysis approach. Default is True.

Return type

Timestep object