Downloads

How to reach us

Development

Purpose: In this tutorial you will learn how to set up and execute a series of calculations for strained structures. Additionally, it will be explained how to obtain the derivatives of the energy-vs-strain curves at zero strain and how these quantities are related to the elastic constants.

2. Set up the calculations

i) Preparation of the input file

The first step is to create a directory for each system that you want to investigate. In this tutorial, we consider as an example the calculation of the energy-vs-strain curves for carbon in the diamond structure. However, the procedure we show you is valid for any system. Thus, we will create a directory diamond and we move inside it:

$ mkdir diamond
$ cd diamond

Inside this directory, we create (or copy from a previous calculation) the file input.xml corresponding to a calculation for the equilibrium structure of diamond. This file could look like the following:

In this example, the (on screen) input entries are preceded by the symbol »». The entry values must be typed on the screen when requested. The first entry (in our example 0.10) represents the absolute value of the maximum strain for which we want to perform the calculation. The second entry (11) is the number of deformed structures equally spaced in strain, which are generated between the maximum negative strain and the maximum positive one. The third (last) entry (0) is a self explained label indicating the type of deformation. The latter is always referred to 2-dimensional strain tensors in the Voigt notation (so that, e.g., a strain value of 0.10 corresponds, for the choice 1 of the deformation code, to a linear deformation of 10% along the x direction).

After running the script, a directory called workdir is created, which contains the input files for the different strain values.

Notice that the directory workdir will be overwritten each time you execute the script SETUP-elastic-strain.py. Therefore, before setting up a new run please rename the workdir directory to a different name, e.g.:

$ mv workdir results-label-0

3. Execute the calculations

To execute the series of calculation with input files created by SETUP-elastic-strain.py you have to run the script EXECUTE-elastic-strain.sh:

After the complete run, the results of the calculation for the input file workdir/input.xml-i are contained in the subdirectory workdir/rundir-i where i is running from 01 to the total number of strain values. The data for the energy-vs-strain curves are contained in the file workdir/energy-vs-strain.

4. Post-processing: Extract energy derivatives

In order to analyse the results of the calculations, you first have to move to the working directory.

$ cd workdir

At this point, you can use the python script CHECKFIT-energy-vs-strain.py for extracting the derivatives of the energy-vs-strain curves at zero strain:

In this example, the input entries are preceded by the symbol »». The entry values must be typed on the screen when requested. The first entry (in our example 0.10) represents the absolute value of the maximum strain for which we want to perform the calculation. The second entry (2) is the order of the derivative that we want to obtain.

The script generates the output files check-energy-derivatives and order-of-derivative, which can be used in the post-processing analysis.

5. Post-processing: Visualization tools

All the scripts mentioned here must be executed in the directory where the energy-vs-strain, check-energy-derivatives, and order-of-derivative files are located. The PostScript output file is always named gnu.ps.

i) GNU-energy

This script allows for the visualization of the energy-vs-strain curve. It is executed as follows:

$ GNU-energy

The script generates the PostScript file gnu.ps. In the following, we display the result for the example mentioned above (carbon in the diamond structure, volume-strain deformations up to 10%):

ii) GNU-check

This is a very important script that allows to represent the dependence of the calculated derivatives of the energy-vs-strain curve on

the range of points included in the fitting procedure,

the maximum degree of the polynomial used in the fitting procedure.

The script is executed as follows:

$ GNU-check

An example of the script output is the following:
The most appropriate value for the derivative in this example is represented by the horizontal plateau (at about 3900 GPa) of the curves corresponding to the highest order fits.

iii) GNU-status

Gnuplot visualization tool for the RMS deviations of the effective SCF potential as a function of the iteration number during the SCF loop. It is executed as follows:

$ GNU-status
Enter label [r or 01,02,...] >>>> 01
$

In this example, the input entry, preceded by the symbol »» (in our example 01) represents the label of the calculation for which you would like to plot the RMS deviations. In particular, the choice r refers to the currently running calculation and, e.g., 02 to the calculation already saved in the directory workdir/rundir-02. An example of the script output is the following:

iv) GNU-forces

Gnuplot visualization tool for the maximum amplitude of the force on the atoms during relaxation (only shown if relaxation is present). It is executed as follows:

$ GNU-forces
Enter label [r or 01,02,...] >>>> 01
$

The input entry definition is the same as for the script GNU-status. An example of the script output (for the deformation label 7) is the following:
The red points show the calculated value at each iteration, whereas the blue line indicates the target value of the maximum amplitude of the force for stopping the relaxation.

v) GNU-geometry

Gnuplot visualization tool for the relaxed coordinates of the atoms in the unit cell (implemented only for cells containing 2 atoms). It is executed as follows:

$ GNU-geometry

An example of the script output (for the deformation label 7) is the following:
The vector (a1, a2, a3) represents (in terms of crystal coordinates) the relaxed vector joining the two atoms in the unit cell of the crystal . Similarly, (ref1, ref2, ref3) indicates the corresponding unrelaxed vector.

Remark on the visualization scripts

All the visualization scripts accept two on-the-command-line entries specifying the y-axis limiting values. So that, e.g., the command

$ GNU-check 3850 3950

will visualize the results for the derivative in the y-axis range between 3850 and 3950 GPa .

6. Post-processing: How to derive elastic constants

The second derivatives of the energy-vs-strain curves calculated at zero strain are combinations of the elastic constants Cij where the indexes i,j=1,2,…,6 are given in the Voigt notation. In the example that we are considering here, carbon in the cubic diamond structure, only 3 different elastic constants are non vanishing:

C11

C12

C44

In order to extract these three elastic constants, three different deformation types must be used. For cubic systems the best choice is represented by the following deformation types:

Volume strain (in our script corresponding to the label 0)

Uniaxial strain in the 100 direction (label 1)

Shear strain along the 111 direction (label 7)

Which in turns correspond to the following combination of elastic constants: