8.6.6. 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)
Returns:
Return type:Timestep object