[Pw_forum] Bulk Modulus Calculation

William Parker wparker at anl.gov
Wed Jan 5 00:14:14 CET 2011


Hi Tram,

To use ev.x, you need a file with the lattice constants and total energies tabulated.

Here is a shell script that will take an input file, adjust the lattice parameter over a small range (+/- 2% in my example) and collect the lattice parameters and total energies in an file I call ev.dat (note you must have sed and awk available):

#!/bin/sh

EXE=pw.x
IN=
OUT=`echo $IN | sed 's/\.in/\.out/'`
DAT=ev.dat
A0=

for fac in -0.020 -0.015 -0.010 -0.005 0.000 0.005 0.010 0.015 0.020
do
        alatt=`echo "$fac $A0" | awk '{printf "%5.3f",(1+$1)*$2}'`
        mkdir $alatt
        sed "/celldm(1)/s/=.*/=         $alatt/" $IN > $alatt/$IN
        cd $alatt
        $EXE < $IN >& $OUT
        e=`grep '!    total energy'  $OUT | tail -1 | awk '{printf "%16.10f\n",$5}'`
        echo "$alatt    $e" >> ../$DAT
        cd ..
done

Be sure that the pw.x executable is in your shell path and define your own input file name and lattice constant.  You may also adjust the range you want to sample for the bulk modulus.
Once, you've run the script to get your energies, run ev.x, choose au as the units, choose the appropriate cell shape (fcc in your case), put ev.dat as the input file and name the output whatever you want.  Pick the equation of state you want to use, and the results will appear in the output file you named.  

I hope this helps.  Anyone with additional and/or corrective advice, please chime in.

--William

*********************************************************
  William D. Parker                 phone: (630) 252-1775
  Computational Postdoctoral Fellow   fax: (630) 252-4798
  MSD-212, Rm. C-215
  Argonne National Laboratory
  9700 S. Cass Ave.
  Argonne, IL 60439
*********************************************************

On Jan 4, 2011, at 4:06 PM, Tram Bui wrote:

> Hi All,
>      Hope everyone had great holidays, I had a question before regarding the Bulk Modulus calculation (ev.f90) But I'm having hard time understand  the file and don't know how to use the ev.f to help me calculate the bulk modulus if I have an input file is like below and the structure is zinc blend (b-SiC). Would you help me if you get a chance? here is my file and you can run it in xcyrsden to see the structure.
>  
> &CONTROL
>    calculation='scf'
>    restart_mode='from_scratch',
>    prefix='Silicon',
>    tprnfor=.true.
>    pseudo_dir='/home/trambui/QE/espresso-4.2.1/pseudo',
>    outdir='./tmp7/',
> /
> &SYSTEM
>    ibrav=2, celldm(1)=8.33, nat=2, ntyp=2,
>    ecutwfc= 30,
> /
> &ELECTRONS
>    diagonalization= 'david',
>    mixing_mode= 'plain',
>    mixing_beta= 0.5,
>    conv_thr= 1.0d-7,
> /
> ATOMIC_SPECIES
> Si 28.086 Si.pbe-n-van.UPF
>  C 12.011 C.pbe-van_ak.UPF
> ATOMIC_POSITIONS
> Si 0.00 0.00 0.00
>  C 0.25 0.25 0.25
> K_POINTS automatic
> 10 10 10 0 0 0
> 
> I really appreciate your helps!
> 
> Tram Bui
> 
> B.S. Materials Science & Engineering
> trambui at u.boisestate.edu
> 
> _______________________________________________
> Pw_forum mailing list
> Pw_forum at pwscf.org
> http://www.democritos.it/mailman/listinfo/pw_forum









More information about the users mailing list