hoomd.update

Overview

BoxResize

Resizes the box between an initial and final box.

CustomUpdater

Updater wrapper for hoomd.custom.Action objects.

Details

class hoomd.update.BoxResize(box1, box2, variant, trigger, scale_particles=True)

Resizes the box between an initial and final box.

When part of a Simulation updater list, this object will resize the box between the initial and final boxes passed. The behavior is a linear interpolation between the initial and final boxes where the minimum of the variant is tagged to box1 and the maximum is tagged to box2. All values between the minimum and maximum result in a box that is the interpolation of the three lengths and tilt factors of the initial and final boxes.

Note

The passed Variant must be bounded (i.e. it must have a true minimum and maximum) or the behavior of the updater is undefined.

Note

Currently for MPI simulations the rescaling of particles does not work properly in HPMC.

Parameters
  • box1 (hoomd.Box) – The box associated with the minimum of the passed variant.

  • box2 (hoomd.Box) – The box associated with the maximum of the passed variant.

  • variant (hoomd.variant.Variant) – A variant used to interpolate between the two boxes.

  • trigger (hoomd.trigger.Trigger) – The trigger to activate this updater.

  • scale_particles (bool) – Whether to scale particles to the new box dimensions when the box is resized.

box1

The box associated with the minimum of the passed variant.

Type

hoomd.Box

box2

The box associated with the maximum of the passed variant.

Type

hoomd.Box

variant

A variant used to interpolate between the two boxes.

Type

hoomd.variant.Variant

trigger

The trigger to activate this updater.

Type

hoomd.trigger.Trigger

scale_particles

Whether to scale particles to the new box dimensions when the box is resized.

Type

bool

get_box(timestep)

Get the box for a given timestep.

Parameters

timestep (int) – The timestep to use for determining the resized box.

Returns

The box used at the given timestep.

Return type

Box

classmethod linear_volume(box1, box2, t_start, t_size, trigger, scale_particles=True)

Create a BoxResize object that will scale volume/area linearly.

This uses a hoomd.variant.Power variant under the hood.

Parameters
  • box1 (hoomd.Box) – The box associated with t_start.

  • box2 (hoomd.Box) – The box associated with t_start + t_size.

  • t_start (int) – The timestep to start the volume ramp.

  • t_size (int) – The length of the volume ramp

  • trigger (hoomd.trigger.Trigger) – The trigger to activate this updater. scale_particles (bool): Whether to scale particles to the new box dimensions when the box is resized.

  • scale_particles (bool) – Whether to scale particles to the new box dimensions when the box is resized.

Returns

An operation that will scale between the boxes linearly in volume (area for 2D).

Return type

hoomd.update.BoxResize

static update(state, box)

Immediately scale the particle in the system state to the given box.

Parameters

box (Box) – New box.

class hoomd.update.CustomUpdater(action, trigger=1)

Updater wrapper for hoomd.custom.Action objects.

For usage see hoomd.custom.CustomOperation.