1 hoomd_script::init::read_xml hoomd_script::dump::dcd hoomd_script::update::box_resize hoomd_script::variant::linear_interp
2 # Due to deficiencies in doxygen, the commands used in this example are listed explicitly here
3 # run this script with "python -x filename" to skip the first line, or remove this header
5 # ---- box_resize.py ----
6 from hoomd_script import *
8 # read in the initial configuration
9 system = init.read_xml(filename="box_resize_rigid.xml")
11 # shrink the box to 1/4 its original size over 100 steps (assumes cubic box)
12 initial_L = system.box[0];
13 shrink_L = variant.linear_interp(points = [(0, initial_L),
14 (100, initial_L/4.0)])
16 resizer = update.box_resize(Lx=shrink_L, period=1);
18 # uncomment the next line to enable no scaling of the particles in the box
19 resizer.set_params(scale_particles=False)
21 # dump a .dcd file of the resize operation
22 dcd = dump.dcd(filename='box_resize_rigid.dcd', period=1, overwrite=True, unwrap_rigid=True)