In this tutorial, we will calculate the elastic constants of the TiO2 compound in its tetragonal structure according to the procedure in the following link:

https://castep-docs.github.io/castep-docs/tutorials/Tools/elastic_constants/

TiO2.cell

#TiO2.cell
%BLOCK lattice_cart
4.594 0.000 0.000
0.000 4.594 0.000
0.000 0.000 2.959
%ENDBLOCK lattice_cart

%BLOCK positions_frac
Ti 0.000 0.000 0.000
Ti 0.500 0.500 0.500
O 0.305 0.305 0.000
O -0.305 -0.305 0.000
O 0.805 0.195 0.500
O -0.805 -0.195 0.500
%ENDBLOCK positions_frac

symmetry_generate

kpoint_mp_grid 3 3 3


TiO2.param

#TiO2.param
task : geometryoptimisation
cutoff_energy : 700 eV
xc_functional : PBE
max_scf_cycles : 100
calculate_stress : true
opt_strategy : speed
num_dump_cycles : 0
WRITE_CELL_STRUCTURE : true


Steps of calculation

Task 1: Perform a variable cell geometry optimisation and make sure to include calculate_stress : true in your param file. Test the kinetic energy cut-off and k-point grid such that the stress is converged to within the default geom_stress_tol value. (Hint: Use CASTEP's built-in help utility to find the defaut.)

$ mpirun -np 4 castep.mpi TiO2

Task 2: Use the generate_strain.py script to generate a set of .cell files deformed according to the appropriate strain pattern. The command generate_strain.py TiO2 should be sufficient. You should now have twelve (in this case) sets of input files - individual .cell files and corresponding .param, symbolically linked to the original TiO2.param file. Notice that the new .cell files all have the FIX_ALL_CELL true option set.

$ mv TiO2.cell TiO2_old.cell
$ cp TiO2_out.cell TiO2.cell
$ generate_strain.py TiO2

 Task 3: Run CASTEP on each of the 12 sets of input files. Note that the cell distortions can break the symmetry of the crystal, hence changing the number of k-points in the symmetry reduced sample. The -dryrun option of CASTEP can be used to do a quick check for how many k-points are required. This can help when selecting how many cores to run the calculation on if you are running CASTEP in parallel.

we need to use this script to do the calculation automatically.

run4elast.sh

#!/bin/bash

run=TiO2
for b in 1 2 ; do
for a in 1 2 3 4 5 6 ; do

echo " running ${run}_cij__${b}__${a} "
mpirun -np 4 castep.mpi ${run}_cij__${b}__${a}

done
done

$ sh run4elasrt.sh

 

Task 4: Run the elastics.py script to obtain the elastic constants. The command elastics.py TiO2 will print the results to the terminal. The --latex option generates a LaTeX formatted summary of the results and the --graphics option produces a graphical representation of the stress-strain fits in a .png file.

$ elastics.py TiO2

 

We get the files:  TiO2.cijdat and  TiO2_cij.txt

The content of the file TiO2_cij.txt

2.764546628704155751e+02 1.536461312566156323e+02 1.526943799973934972e+02 0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00
 

1.536461312566156323e+02 2.764546628704155751e+02 1.526943799973934972e+02 0.000000000000000000e+00 0.000000000000000000e+00 -0.000000000000000000e+00
 

1.526943799973934972e+02 1.526943799973934972e+02 4.730549402654040705e+02 0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00
 

0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 1.159642406107628005e+02 0.000000000000000000e+00 0.000000000000000000e+00
 

0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 1.159642406107628005e+02 0.000000000000000000e+00
 

0.000000000000000000e+00 -0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 2.116479184935963360e+02

 

The values of the elastic constants are:

C11= 276.45 GPa
C12= 153.64 GPa
C13= 152.69 GPa
C33= 473.05 GPa
C44= 115.96 GPa
C66= 211.64 GPa


Reference: