# replicate command

## Syntax

    replicate nx ny nz offset ox oy oz shift sx sy sz

- nx,ny,nz = replication factors (integers) in each dimension
- offset ox oy oz: required keyword with values

    ox, oy, oz = offset of each replication in box units

- shift sx sy sz: optional keyword with values

    sx, sy, sz = shift all particles by these values in box units

## Examples

    replicate 2 3 2 offset 1.0 1.0 2.0
    replicate 1 2 2 offset 2.0 2.0 2.0 shift -0.1 0.2 0.0

## Description

Replicate the current simulation one or more times in each dimension. For example, replication factors of 2,2,2 will create a simulation with 8x as many atoms by doubling the simulation domain in each dimension. A replication factor of 1 in a dimension leaves the simulation domain unchanged. The offset keyword determines the offset between the original and replicated simulations. In general this should be chosen according to the size of the initial periodic box.

All properties of the atoms are replicated, including their velocities, which may or may not be desirable. New atom IDs are assigned to new atoms, as are molecule IDs. Bonds and other topology interactions are created between pairs of new atoms as well as between old and new atoms. This is done by using the image flag for each atom to “unwrap” it out of the periodic box before replicating it.

This means that any molecular bond you specify in the original data file that crosses a periodic boundary should be between two atoms with image flags that differ by 1. This will allow the bond to be unwrapped appropriately.

The shift keyword allows to shift the entire simulation by a specified vector.

## Restrictions

A 2d simulation cannot be replicated in the z dimension.

If a simulation is non-periodic in a dimension, care should be used when replicating it in that dimension, as it may put atoms nearly on top of each other.

If the current simulation was read in from a restart file (before a run is performed), there can have been no fix information stored in the file for individual atoms. Similarly, no fixes can be defined at the time the replicate command is used that require vectors of atom information to be stored. This is because the replicate command does not know how to replicate that information for new atoms it creates.

Replicating a system that has rigid bodies (defined via the fix rigid command), either currently defined or that created the restart file which was read in before replicating, can cause problems if there is a bond between a pair of rigid bodies that straddle a periodic boundary. This is because the periodic image information for particles in the rigid bodies are set differently than for a non-rigid system and can result in a new bond being created that spans the periodic box. Thus you cannot use the replicate command in this scenario.

Related commands: none

Default: none