Back to main menu

## Option: velocity

#### Syntax

`-velocity <T>`

#### Description

This option assigns a random velocity vector to each atom, so as to comply to a Maxwell-Boltzmann distribution of velocities, and so that the sum of velocities is zero (no global drift of the system). The target temperature <T> must be given in Kelvin.

After applying this option, the distribution of velocities is computed and written to the file `velocity_dist.dat`.

Note that this option attempts to generate random velocities along the cartesian X, Y and Z axis for each atom, therefore it is largely non-reproducible, i.e. starting from the exact same system and applying the present option will likely lead to different results.

By default velocities are defined in Å/ps, units can be changed thanks to the option `-unit`. In order to specify atom velocities manually, one can use the option `-properties`. To remove all velocities one can use the option `-remove-property` to remove the properties `vx`, `vy` and `vz`.

If velocities were defined previously, they are replaced by those set with this option.

If a selection was defined (with the option `-select`) then the distribution of velocities is applied only to selected atoms. Non-selected atoms keep their velocities if they were defined, or else are assigned a zero velocity.

#### Default

By default the velocity of atoms is undefined or unchanged.

#### Examples

- `atomsk relaxed.cfg -velocity 300 MD.cfg lmp`

  This will read the file `relaxed.cfg` and assign velocities of atoms corresponding to a Maxwell-Boltzmann distribution at the temperature T=300 K. The atom positions and velocities will be written to `MD.cfg` and `MD.lmp`.

- `atomsk initial.xsf -select below 20 x -velocity 300 -select above box-20 x -velocity 1000 MD.cfg lmp`

  This will read the file `initial.xsf`, give atoms on the left side of the box (x<20 Å) a distribution of velocities correponding to the temperature T=300 K, and give atoms on the right side velocities corresponding to T=1000 K.

Back to main menu