hoomd.variant¶
Overview
A constant value. |
|
A cycle of linear ramps. |
|
A approach from initial to final value of x ^ (power). |
|
A linear ramp. |
|
Variant base class. |
Details
Define quantities that vary over the simulation.
A Variant
object represents a scalar function of the time step. Some
Operations accept Variant
values for certain parameters, such as the
kT
parameter to NVT
.
-
class
hoomd.variant.
Constant
(value)¶ A constant value.
- Parameters
value (float) – The value.
Constant
returns value at all time steps.
-
class
hoomd.variant.
Cycle
(A, B, t_start, t_A, t_AB, t_B, t_BA)¶ A cycle of linear ramps.
- Parameters
Cycle
holds the value A until time t_start. It continues holding that value until t_start + t_A. Then it ramps linearly from A to B over t_AB steps and holds the value B for t_B steps. After this, it ramps back from B to A over t_BA steps and repeats the cycle starting with t_A.Cycle
repeats this cycle indefinitely.
-
class
hoomd.variant.
Power
(A, B, power, t_start, t_ramp)¶ A approach from initial to final value of x ^ (power).
- Parameters
Power
holds the value A until time t_start. Then it progresses at \(x^{power}\) from A to B over t_ramp steps and holds the value B after that.p = Power(2, 8, 1 / 10, 10, 20)
-
class
hoomd.variant.
Ramp
(A, B, t_start, t_ramp)¶ A linear ramp.
- Parameters
Ramp
holds the value A until time t_start. Then it ramps linearly from A to B over t_ramp steps and holds the value B.
-
class
hoomd.variant.
Variant
¶ Variant base class.
Variants define values as a function of the simulation time step. Use one of the built in types or define your own custom function:
class CustomVariant(hoomd.variant.Variant): def __init__(self): hoomd.variant.Variant.__init__(self) def __call__(self, timestep): return (float(timestep)**(1 / 2))