relentless.simulate.InitializeRandomly#
- class relentless.simulate.InitializeRandomly(seed, N, V, T=None, masses=None, diameters=None)#
Initialize a randomly generated simulation box.
If
diametersisNone, the particles are randomly placed in the box. This can work pretty well for low densities, particularly ifMinimizeEnergyis used to remove overlaps before starting to run a simulation. However, it will typically fail for higher densities, where there are many overlaps that are hard to resolve.If
diametersis specified for each particle type, the particles will be randomly packed into sites of a close-packed lattice. The insertion order is from big to small. No particles are allowed to overlap based on the diameters, which typically means the initially state will be more favorable than using random initialization. However, the packing procedure can fail if there is not enough room in the box to fit particles using lattice sites.- Parameters:
seed (int) – The seed to randomly initialize the particle locations.
N (dict) – Number of particles of each type.
V (
Extent) – Simulation extent.T (float) – Temperature. Defaults to None, which means system is not thermalized.
masses (dict) – Masses of each particle type. Defaults to None, which means particles have unit mass.
diameters (dict) – Diameter of each particle type. Defaults to None, which means particles are randomly inserted without checking their sizes. The value of a diameter can be a
Variable, which will be evaluated at the time the operation is called.
Methods