The Swiss-army knife of atomic simulations

Tutorial: Grain Boundaries

In this tutorial you will learn how to generate grain boundaries with the mode "--polycrystal".

▶ For more information, refer to the corresponding documentation page.

If properly used, the mode "--polycrystal" (described in a previous tutorial) can be used to generate grain boundaries. After all, an atomic system containing a grain boundary can be described as a polycrystal with only two grains of specific orientation and position.

1. Basics: the example of the symmetric tilt grain boundary

Tilt grain boundaries are a specific type of grain boundary, where the two grains are rotated around the same crystallographic axis. When the two grains are rotated by opposite angles, the tilt grain boundary is symmetric.

The steps to construct a symmetric tilt grain boundary are as follow (here we consider the Cartesian Y axis as being normal to the grain boundary, and Z normal to the figure):

(a) Insert two nodes at the reduced coordinates (0.5,0.25,0) and (0.5,0.75,0). By doing so, the grain boundary is located at the center of the final cell (horizontal blue line). Note that, because of periodic boundary conditions, there will also be a grain boundary at the bottom of the box, and one at the top.

(b) Insert the seeds at the positions of the nodes. Rotate one seed by an angle +α/2 and the other one by -α/2 around Z, so that the desorientation between the two grains is α.

(c) Duplicate the seed in all directions of space, and cut each grain at the grain boundary.

2. Constructing a grain boundary in aluminium

In the following, a unit cell of aluminium will be used as a seed. Such a unit cell can be generated with:

atomsk --create fcc 4.046 Al aluminium.xsf

As an example, let us construct a {210}[001] symmetric grain boundary in aluminium. We want the two grains to meet with {210} surfaces, so we need to turn the crystals by ±26.57° around the Z axis. Create a new text file and copy the following information inside:


box 100 100 0
node 0.5*box 0.25*box 0 0° 0° -26.57°
node 0.5*box 0.75*box 0 0° 0° 26.57°

This file has to comply to the format expected in the mode "--polycrystal", as explained in the previous tutorial. A grain boundary is just a special case of a polycrystal where only two grains are constructed -each keyword "node" corresponds to one grain. The first grain is located at the position (0.5,0.25,0) and the second one at (0.5,0.75,0) as explained above. The first grain is rotated by 0° around X, 0° around Y, and -26.57° around the Z axis; similarly the second grain is only rotated by +26.57° around the Z axis. Also, note that in the first line the dimension of the box is set to zero along the Z direction. Atomsk will automatically replace that zero with the size of the seed along Z -in that case, by the lattice parameter of the aluminium unit cell, 4.046 Å.

Now, all one has to do is run Atomsk in mode "--polycrystal", using the file "aluminium.xsf" as a seed, and the parameters from the file "polyX.txt":

atomsk --polycrystal aluminium.xsf polyX.txt polycrystal.cfg

3. Dealing with boundary conditions

The instructions above construct two grains with the desired orientation, however the visualization (e.g. with Atomeye) shows that there are problems at the boundaries of the cell. Indeed, in the parameter file "polyX.txt" the size of the box was arbitrarily set to 100 Å along X and Y, which does not match the periodicity of the lattice.

Along the X and Y Cartesian axes are <210> directions of the crystal. Along these directions the periodicity of the lattice is 4.046*√5, therefore the dimensions of the box must be an integer number of that value to ensure periodicity. For instance:


box 9.047131 36.188524 0
node 0.5*box 0.25*box 0 0° 0° -26.57°
node 0.5*box 0.75*box 0 0° 0° 26.57°

Constructing the polycrystal with this file instead of the previous one should yield a proper tilt grain boundary, with periodic boundary conditions. Also, because of periodicity there are grain boundaries at the top and bottom of the cell. Using appropriate box dimensions ensures that these grain boundaries are strictly equivalent to the one at the center of the cell. Here we chose different box lengths along X and Y, but we could have used identical values. You can play with these values to construct smaller or larger systems while still keeping periodicity. You may open the final system "polycrystal.cfg" with Atomeye for visualization:

Note that the dimensions of the box depends on the crystallographic direction, i.e. on the tilt angle, and hence have to be re-calculated for each different direction.

As an exercise you may try to construct grain boundaries with different orientations, e.g. {310}. You may also construct symmetric grain boundaries with different orientations along Z, e.g. using a seed of fcc aluminium oriented X=[110], Y=[001], Z=[110]. Finally, you may also construct grain boundaries in materials with other symmetries, e.g. in bcc iron, in silicon, or any other material, by changing the seed and carefully designing the parameter file.

4. Duplicate the system

Sometimes, one wants to study a large system containing a grain boundary. In such cases, it is discouraged to give the final box size in the parameter file ("polyX.txt"), because Atomsk may have a hard time filling it with atoms if the box is very large. Instead, for better efficiency, it is recommended to construct a grain boundary of minimal box size, and then use the option "-duplicate" to duplicate it after it is constructed. For example, to duplicate it 5 times along X and 3 times along Y you can use:

atomsk --polycrystal aluminium.xsf polyX.txt polycrystal.cfg -dup 5 3 1

And thus the previous atomic configuration is duplicated:

5. Twist grain boundaries

Another particular type of grain boundaries are twist grain boundaries, where the two grains are rotated around the axis normal to the grain boundary, i.e. around the Y axis in the examples above. In this case, the box size along Y is an integer multiple of the lattice constant, and the sizes along X and Z change depending on the twist angle.

As an example, let us construct a pure twist grain boundary in aluminium, using the same rotation angle as in the previous section. We know that the box size along Y must be multiple of the lattice constant, so let us set it to ten times the lattice constant, 40.46 Å. Along X and Z, the box size must be a multiple of the length of the [210] lattice vector; let us use the minimum period, 9.047131 Å, in each direction. Finally the seeds must be placed in the middle of the XZ plane, i.e. at the reduced coordinates (½ ¼ ½) and (½ ¾ ½). If we incorporate all that into the parameter file, it should look like the following:


box 9.047131 40.46 9.047131
node 0.5*box 0.25*box 0.5*box 0° -26.57° 0°
node 0.5*box 0.75*box 0.5*box 0° 26.57° 0°

Running the same command as previously, we obtain this time a twist grain boundary:

atomsk --polycrystal aluminium.xsf polyX.txt polycrystal.cfg

Again, this system can be duplicated afterwards to obtain a larger grain boundary area.