BoxVariant

class hoomd.variant.box.BoxVariant

Box-like vector variant base class.

hoomd.variant.box.BoxVariant provides an interface to vector variants that are valid hoomd.box.box_like objects. The return value of the __call__ method is a list of scalar values that represent the quantities Lx, Ly, Lz, xy, xz, and yz of a simulation box.

Subclasses should override the __call__ method and must explicitly call the base class constructor in __init__:

class CustomBoxVariant(hoomd.variant.box.BoxVariant):
    def __init__(self):
        hoomd.variant.box.BoxVariant.__init__(self)

    def __call__(self, timestep):
        return [10 + timestep / 1e6, 10, 10, 0, 0, 0]
__call__(timestep)

Evaluate the function.

Parameters:

timestep (int) – The time step.

Returns:

The value of the function at the given time step.

Return type:

[float, float, float, float, float, float]