||Initialize particles randomly|
||Initialize from a snapshot|
MPCD system initialization
Commands to initialize the MPCD system data. Currently, random initialization
and snapshot initialization (see
hoomd.mpcd.data) are supported.
Random initialization is useful for large systems where a snapshot is impractical.
Snapshot initialization is useful when you require fine control over the particle
properties and initial configuration.
make_random(N, kT, seed)¶
Initialize particles randomly
Initialized MPCD system data (
MPCD particles are randomly initialized into the simulation box. An MPCD system can be randomly initialized only after the HOOMD system is first initialized (see
hoomd.init). The system can only be initialized one time. The total number of particles N is evenly divided between all domains. Random positions are then drawn uniformly within the (local) box. Particle velocities are drawn from a Maxwell-Boltzmann distribution consistent with temperature kT. All MPCD particles are given unit mass and type A.
mpcd.init.make_random(N=1250000000, kT=1.0, seed=42)
Random number generation is performed using C++11
mt19937seeded by seed plus the rank number in MPI simulations. This random number generator is separate from other generators used in MPCD, so seed can be reasonably recycled elsewhere.
Initialize from a snapshot
Parameters: snapshot (
hoomd.mpcd.data.snapshot) – MPCD system data snapshot
Returns: Initialized MPCD system data (
An MPCD system can be initialized from a snapshot after the HOOMD system is first initialized (see
hoomd.init). The system can only be initialized one time. If no type is specified in the snapshot, a default type A will be assigned to the MPCD particles.
snap = mpcd.data.make_snapshot(N=10) snap.particles.position[:] = L * np.random.random((10,3)) mpcd.init.read_snapshot(snap)
It is expected that the snapshot has the same box size as the HOOMD system. By default, this is how a new snapshot is initialized. If the HOOMD system is resized after the MPCD snapshot is created and before initialization from the MPCD snapshot, an error will be raised if the MPCD snapshot is not properly resized.