Interpolate¶
- class hoomd.variant.box.Interpolate(initial_box, final_box, variant)¶
Bases:
BoxVariant
Interpolate between two boxes linearly.
- Parameters:
initial_box (hoomd.box.box_like) – The initial box.
final_box (hoomd.box.box_like) – The final box.
variant (hoomd.variant.variant_like) – A variant used to interpolate between the two boxes.
Interpolate
returns arrays corresponding to a linear interpolation between the initial and final boxes where the minimum of the variant givesinitial_box
and the maximum givesfinal_box
:\[\begin{split}\begin{align*} L_{x}' &= \lambda L_{2x} + (1 - \lambda) L_{1x} \\ L_{y}' &= \lambda L_{2y} + (1 - \lambda) L_{1y} \\ L_{z}' &= \lambda L_{2z} + (1 - \lambda) L_{1z} \\ xy' &= \lambda xy_{2} + (1 - \lambda) xy_{1} \\ xz' &= \lambda xz_{2} + (1 - \lambda) xz_{1} \\ yz' &= \lambda yz_{2} + (1 - \lambda) yz_{1} \\ \end{align*}\end{split}\]Where
initial_box
is \((L_{ix}, L_{iy}, L_{iz}, xy_i, xz_i, yz_i)\),final_box
is \((L_{fx}, L_{fy}, L_{fz}, xy_f, xz_f, yz_f)\), \(\lambda = \frac{f(t) - \min f}{\max f - \min f}\), \(t\) is the timestep, and \(f(t)\) is given byvariant
.
Members inherited from
BoxVariant
:- __call__()¶
Evaluate the function.
Read more...
Members defined in
Interpolate
:- variant¶
A variant used to interpolate between the two boxes.
- Type:
- __reduce__()¶
Reduce values to picklable format.