InverseVolumeRamp¶
- class hoomd.variant.box.InverseVolumeRamp(initial_box, final_volume, t_start, t_ramp)¶
Bases:
BoxVariant
Produce box arrays whose inverse volume changes linearly.
- Parameters:
initial_box (hoomd.box.box_like) – The initial box.
final_volume (float) – The final volume of the box.
t_start (int) – The time step at the start of the ramp.
t_ramp (int) – The length of the ramp.
InverseVolumeRamp
produces box arrays that correspond to a box whose inverse volume (i.e., number density for a constant number of particles) varies linearly. The shape of the box remains constant, that is, the ratios of the lengths of the box vectors (\(L_y / L_x\) and \(L_z / L_x\)) and the tilt factors (\(xy\), \(xz\), \(yz\)) remain constant. Forinitial_box
with volume \(V_0\) andfinal_volume
\(V_f\),InverseVolumeRamp
returns arrays corresponding to boxes with volume \(V(t)\):\[\begin{split}V(t) &= \begin{cases} V_0 & t < t_{\mathrm{start}} \\ \left( \lambda V_f^{-1} + (1 - \lambda) V_0^{-1} \right)^{-1} & t_{\mathrm{start}} \leq t < t_{\mathrm{start}} + t_{\mathrm{ramp}} \\ V_f & t \geq t_{\mathrm{start}} + t_{\mathrm{ramp}} \end{cases}\end{split}\]where \(\lambda = \frac{t - t_{\mathrm{start}}}{t_{\mathrm{ramp}} - t_{\mathrm{start}}}\).
Members inherited from
BoxVariant
:- __call__()¶
Evaluate the function.
Read more...
Members defined in
InverseVolumeRamp
:- __reduce__()¶
Reduce values to picklable format.