Guide to Lammps - Creating Atoms

# --------------------- Create Atoms ----------------------------------
lattice diamond 3.57
region diamondBox block 0 10 0 10 0 10 units lattice
create_box 1 diamondBox
create_atoms 1 region diamondBox
mass * 12.0107
velocity all create 300.0 4928459 dist gaussian

The command lattice is used to create a geometric lattice. This is a mathematical construct, and does not actually place any particles on the lattice. There are different types of lattices LAMMPS offers, and one may also define a custom using primitice vectors and basis. In my simulation I created a diamond lattice, with the natural lattice constant of 3.57 Å (distance units being defined by the previous units command).

The command region is used to define a region in space. The previous lattice command creates an infinite lattice in space, and this command limits it to a certain region. In this example, we create a box in space, named 'diamondBox', with dimensions of 35.7 Å in each direction, anchored at the origin.

The command create_box defines a simulation box, where the dynamics happen. The simulation box is named '1', a generic name since we do not need to refer to it in the code, and is defined by the region we previously created, 'diamondBox'.

The command create_atoms places atoms on the lattice points defined by the previous lattice command, in the region of space defined by the region command.

The command mass defines a mass of 12.0107 grams/mole to all atoms in the model. the asterisk assigns the mass to all atoms, and the units of grams/mole is defined by the previous units command.

The command velocity assigns initial velocities to the different atoms. This is important when using a temp/rescale thermostat, as initial velocities are unexpected, and atoms can even be stationary on certain axes, which renders the temp/rescale command useless as a thermostat. We assign velocities to all atoms, with an initial pseudo-random seed of 4928459, and a Gaussian velocity distribution.

Aside from creating atoms on a lattice, it is also possible to load atoms from a file. This is done using the read_data command. Manual page for the command can be found here. As stated in the manual, the format of the file is important. Koren Schreiber has an example of such file on his site, and the file itself can be found here.

To continue in the LAMMPS guide, press here.
To return backwards in the LAMMPS guide, press here.