Example: Periodic lattice optimization under pressure

Download Diamond_under_pressure.run

#! /bin/sh

# Calculate the phonon dispersion curves for diamond under pressure.

# Loop over pressure values (in GPa):
for P in -40 0 40 160 ; do
AMS_JOBNAME=pressure_$P $ADFBIN/ams << EOF

   Task GeometryOptimization

   System
       Atoms
           C -0.44625 -0.44625 -0.44625
           C  0.44625  0.44625  0.44625
       End
       Lattice
           0.0    1.785  1.785
           1.785  0.0    1.785
           1.785  1.785  0.0
       End
   End

   GeometryOptimization
       OptimizeLattice Yes
       Pressure $P
       Convergence Gradients=1.0e-5
   End

   NumericalDifferentiation
       # Parallelize the calculation of the strain displacements, necessary for
       # numerically calculating the stress tensor during the lattice optimization.
       Parallel nGroups=2
   End

   Properties
       # Request the calculation of phonons at the optimized geometry.
       Phonons Yes
   End

   NumericalPhonons
       Parallel nGroups=2
       SuperCell
           2 0 0
           0 2 0
           0 0 2
       End
   End

   Engine DFTB
       ResourcesDir DFTB.org/mio-1-1
       KSpace
           Type Symmetric
           Symmetric KInteg=5
       End
   EndEngine

EOF
done