地域密着型エリア広告配信リクルートの地域密着型広告ドコイク?アドネットワーク Ads by ドコイク?[無料でホームページを作成] [通報・削除依頼]
[無料でホームページを作成] [通報・削除依頼]

vasp_phono3py_run

------------------------------------------------------------------------------
■ Youtube動画:
基本的な使い方: https://www.youtube.com/watch?v=59zxKB6W6qM
------------------------------------------------------------------------------
■ setting
1. chmod +x vasp_phono3py_run
2. gedit vasp_phono3py_run
change
------
set vasp_adress = $HOME'/vasp/vasp.5.4.1/bin/vasp_std'
------
3. gedit vasp_phonopy_run
If you get libraries form Ubuntu Software center, I reccommend below,
------before
  mpirun -np $num_core $vasp_adress
#if you get libraries form Ubuntu Software center, I reccommend below,
#mpirun.openmpi -np $num_core $vasp_adress
------
------after
#mpirun -np $num_core $vasp_adress
#if you get libraries form Ubuntu Software center, I reccommend below,
mpirun.openmpi -np $num_core $vasp_adress
------
------------------------------------------------------------------------------
■ Usage
0. calculate optimized structure (for example, vasp_run)
1. vasp_phono3py_run
2. phono3py --fc3 --fc2 --dim="2 2 2" --mesh="11 11 11" -c POSCAR-unitcell --br --bmfp 0.05 --tmin=0 --tmax=1000 --tstep=10 --isotope

plot
1. gnuplot
2. p "kaccum.dat" i 30 u 1:2 w l, "kaccum.dat" i 30 u 1:8 w l
  i 30 = 300 K
  i 15 = 150 K
3. set xlabel "Frequency (THz)"
4. set ylabel "Accumulated kappa (W/m-k)"
5. replot
6. p "kaccum.dat" i 30 u ($1*4.136):2 w l, "kaccum.dat" i 30 u ($1*4.136):8 w l
7. set xlabel "Energy (eV)"
8. replot
------------------------------------------------------------------------------
■ vasp_phono3py_run
----------
#! /bin/csh -f
# VASP run command
#
# user settting
set vasp_adress = $HOME'/vasp/vasp.5.4.1/bin/vasp_std'
#set vasp_adress = $HOME'/vasp/vasp.5.3/vasp'
set __mpirun__ = "mpirun"
#if you get libraries form Ubuntu Software center, I reccommend below,
#set __mpirun__ = "mpirun.openmpi"
# Automatically setting
set num_core = `grep 'core id' /proc/cpuinfo | sort -u | wc -l`
setenv OMP_NUM_THREADS 1
#
set NPAR = `echo 4-"sqrt($num_core)" | bc`
echo "automatic setting NPAR = "$NPAR
#
set No = 1
#
if ( -f phono3py.log ) then
  set No = `cat phono3py.log`
  echo "*******************************************"
  echo "continue calculation"
  set max = `sed -n -e 's/num_displacements_created: //1p' disp_fc3.yaml`
  echo $No"/"$max
  if ( $No <= $max ) then
    if ( $No < 10) then
      cd disp-0000$No
    endif
    if ( 10 <= $No && $No < 100) then
      cd disp-000$No
    endif
    if ( 100 <= $No && $No < 1000) then
      cd disp-00$No
    endif
    if ( 1000 <= $No && $No < 10000) then
      cd disp-0$No
    endif
    if ( 10000 <= $No && $No < 100000) then
      cd disp-$No
    endif
    ${__mpirun__} -np $num_core $vasp_adress
    cd ..
  endif
  @ No = $No + 1
  echo $No > phono3py.log
else
  #
  echo "NPAR = $NPAR      " > INCAR
  echo "  PREC = Accurate " >> INCAR
  echo "IBRION = -1       " >> INCAR
  echo "# ENCUT = 500     " >> INCAR
  echo "  EDIFF = 1.0e-08 " >> INCAR
  echo "ISMEAR = 0; SIGMA = 0.01" >> INCAR
  echo "  IALGO = 38      " >> INCAR
  echo "  LREAL = .FALSE. " >> INCAR
  echo "  LWAVE = .FALSE. " >> INCAR
  echo " LCHARG = .FALSE. " >> INCAR
  mv KPOINTS KPOINTS_
  cp POSCAR POSCAR_backup
  mv POSCAR POSCAR-unitcell
  #
  phono3py -d --dim="2 2 2" -c POSCAR-unitcell
  #
  set max = `sed -n -e 's/num_displacements_created: //1p' disp_fc3.yaml`
endif
#
echo $No, $max
while ( $No <= $max )
  echo "*******************************************"
  echo $No"/"$max
  date
  if ( $No < 10) then
    mkdir disp-0000$No
    mv POSCAR-0000$No ./disp-0000$No/POSCAR
    cp POTCAR ./disp-0000$No/POTCAR
    cp INCAR ./disp-0000$No/INCAR
    cd disp-0000$No
  endif
  if ( 10 <= $No && $No < 100) then
    mkdir disp-000$No
    mv POSCAR-000$No ./disp-000$No/POSCAR
    cp POTCAR ./disp-000$No/POTCAR
    cp INCAR ./disp-000$No/INCAR
    cd disp-000$No
  endif
  if ( 100 <= $No && $No < 1000) then
    mkdir disp-00$No
    mv POSCAR-00$No ./disp-00$No/POSCAR
    cp POTCAR ./disp-00$No/POTCAR
    cp INCAR ./disp-00$No/INCAR
    cd disp-00$No
  endif
  if ( 1000 <= $No && $No < 10000) then
    mkdir disp-0$No
    mv POSCAR-0$No ./disp-0$No/POSCAR
    cp POTCAR ./disp-0$No/POTCAR
    cp INCAR ./disp-0$No/INCAR
    cd disp-0$No
  endif
  if ( 10000 <= $No && $No < 100000) then
    mkdir disp-$No
    mv POSCAR-$No ./disp-$No/POSCAR
    cp POTCAR ./disp-$No/POTCAR
    cp INCAR ./disp-$No/INCAR
    cd disp-$No
  endif
  echo $No > ../phono3py.log
  ${__mpirun__} -np $num_core $vasp_adress
  cd ..
  @ No = $No + 1
end
if ( $No > $max ) then
  echo $No > phono3py.log
endif
#
cp POSCAR_backup POSCAR
#
echo "making file_list.dat"
if ( -f file_list.dat ) then
  rm -f -r file_list.dat
endif
#
set No = 1
echo $No, $max
while ( $No <= $max )
  if ( $No < 10) then
    echo "disp-0000$No/vasprun.xml" >> file_list.dat
  endif
  if ( 10 <= $No && $No < 100) then
    echo "disp-000$No/vasprun.xml"  >> file_list.dat
  endif
  if ( 100 <= $No && $No < 1000) then
    echo "disp-00$No/vasprun.xml"   >> file_list.dat
  endif
  if ( 1000 <= $No && $No < 10000) then
    echo "disp-0$No/vasprun.xml"    >> file_list.dat
  endif
  if ( 10000 <= $No && $No < 100000) then
    echo "disp-$No/vasprun.xml"     >> file_list.dat
  endif
  @ No = $No + 1
end
#
phono3py --cf3_file file_list.dat
phono3py --dim="2 2 2" -c POSCAR-unitcell
phono3py --fc3 --fc2 --dim="2 2 2" --mesh="11 11 11" -c POSCAR-unitcell --br --bmfp 0.05 --tmin=0 --tmax=1000 --tstep=10 --isotope |tee kappa_all_data.dat
phono3py --dim="2 2 2" -c POSCAR-unitcell --mesh="11 11 11" --sym_fc3r --sym_fc2 --tsym --br
kaccum -c POSCAR-unitcell kappa-m111111.hdf5 |tee kaccum.dat
# k vs mean free path
kaccum -c POSCAR-unitcell kappa-m111111.hdf5 --mfp --average --nsp 100 |tee kaccum_mfp.dat
kaccum -c POSCAR-unitcell kappa-m111111.hdf5 --gv  --average --nsp 100 |tee kaccum_gv.dat
#kaccum -c POSCAR-unitcell kappa-m111111.hdf5 --mfp --trace
#kaccum -c POSCAR-unitcell kappa-m111111.hdf5 --gv  --trace
#phono3py --dim="2 2 2" -c POSCAR-unitcell --mesh="19 19 19" --sym_fc3r --sym_fc2 --tsym --br
#kaccum -c POSCAR-unitcell kappa-m191919.hdf5 --mfp --average --trace --gv |tee kaccum_mfp.dat
# scalar data
kaccum -c POSCAR-unitcell kappa-m111111.hdf5 --gamma   --nsp 100 |tee kaccum_gamma.dat
kaccum -c POSCAR-unitcell kappa-m111111.hdf5 --tau     --nsp 100 |tee kaccum_tau.dat
kaccum -c POSCAR-unitcell kappa-m111111.hdf5 --cv      --nsp 100 |tee kaccum_cv.dat
kaccum -c POSCAR-unitcell kappa-m111111.hdf5 --gv_norm --nsp 100 |tee kaccum_gv_norm.dat
#kaccum -c POSCAR-unitcell kappa-m111111.hdf5 --pqj     --nsp 100 |tee kaccum_pqj.dat
#
# plot k vs energy
sed -n -e '/Thermal conductivity/,$p' kappa_all_data.dat > kappa.dat
awk '{if($1=="#"){print $1,$2,$8}else if($1==""){print}else{print ($1*4.136),$2,$8}}' kaccum.dat > kaccum_eV.dat
#
# kappa vs energy plot
set file     = `pwd`
set filename = $file:t
set psformat = "_k.ps"
set epsformat = "_k.eps"
gnuplot -persist << EOF
set title "$filename"
set mxtics 2
set xlabel "Temperature (K)"
set mytics 2
set ylabel "Lattice thermal conductivity (W/mK)"
p "kappa.dat" u 1:2 w l t "kappa xx", "kappa.dat" u 1:4 w l t "kappa zz", "kappa.dat" u 1:6 w l t "kappa xz", "kappa.dat" u 1:7 w l t "kappa xy"
#set size 1.0,1.0
#set terminal postscript color enhanced "Arial" 30
#set out "$filename$psformat"

set size 1.5,2.1
set terminal postscript eps color enhanced "Arial" 30
set out "$filename$epsformat"

replot
set terminal x11
EOF
#
# Accumulated kappa vs energy plot
set file     = `pwd`
set filename = $file:t
set psformat = "_ak.ps"
set epsformat = "_ak.eps"
gnuplot -persist << EOF
set title "$filename"
set xlabel "Energy (meV)"
set ylabel "Accumulated lattice thermal conductivity (W/mK)"
set y2label "Cumulative lattice thermal conductivity (W/mK)"
set y2tics
set ytics mirror
set key top left
p "kaccum_eV.dat" i 30 u 1:2 w l t "Accumulated kappa at 300 K", "kaccum_eV.dat" i 30 u 1:3 w l t "Cumulative kappa at 300 K
#p "kaccum.dat" i 30 u 1:2 w l t "Accumulated kappa at 300 K", "kaccum.dat" i 30 u 1:8 w l t "Cumulative kappa at 300 K"
#p "kaccum.dat" i 30 u 1:2 w l t "Accumulated kappa at 300 K", "kaccum.dat" i 30 u 1:8 w l t "Cumulative kappa at 300 K axes x1y2

#set size 1.0,1.0
#set terminal postscript color enhanced "Arial" 30
#set out "$filename$psformat"

set size 1.5,2.1
set terminal postscript eps color enhanced "Arial" 30
set out "$filename$epsformat"

replot
set terminal x11
EOF
#
# Cumulated kappa vs mean free path plot
awk '{if($1=="#"){print $1,$2,$3}else if($1==""){print}else{print ($1*10),$2,$3}}' kaccum_mfp.dat > kaccum_mfp_eV.dat
set file     = `pwd`
set filename = $file:t
set psformat = "_mfp.ps"
set epsformat = "_mfp.eps"
gnuplot -persist << EOF
set title "$filename"
set xlabel "Mean free path (nm)"
set ylabel "Cumulative lattice thermal conductivity (W/mK)"
#set y2label "Derivative of Cumulative lattice thermal conductivity (W/mK)"
#set y2tics
#set ytics mirror
#set key top left
p "kaccum_mfp_eV.dat" i 30 u 1:2 w l t "Cumulated kappa at 300 K"
#p "kaccum_mfp_eV.dat" i 30 u 1:2 w l t "Cumulated kappa at 300 K", "kaccum_mfp_eV.dat" i 30 u 1:3 w l t "Derivative of Cumulative kappa at 300 K"

#set size 1.0,1.0
#set terminal postscript color enhanced "Arial" 30
#set out "$filename$psformat"

set size 1.5,2.1
set terminal postscript eps color enhanced "Arial" 30
set out "$filename$epsformat"

replot
set terminal x11
EOF
#
# gv(eVxeVxnmxnm) vs meV
awk '{if($1==""){print}else{print ($1*4.136),($2*4.136*4.136*10*10),($3*4.136*4.136*10*10)}}' kaccum_gv.dat > kaccum_gv_eV.dat
set file     = `pwd`
set filename = $file:t
set psformat = "_gv.ps"
set epsformat = "_gv.eps"
gnuplot -persist << EOF
set title "$filename"
set xlabel "Energy / meV"
set ylabel "Cumulative averaged group velocities (meV^2nm^2)"
set y2label "Derivative of cumulative averaged group velocities (meV^2nm^2)"
#set y2tics
#set ytics mirror
#set key top left
#p "kaccum_gv_eV.dat" u 1:2 w l t "Cumulative Averaged group velocities"
p "kaccum_gv_eV.dat" u 1:2 w l t "Cumulative Averaged group velocities", "kaccum_gv_eV.dat" u 1:3 w l t "Derivative of cumulative averaged group velocities"

#set size 1.0,1.0
#set terminal postscript color enhanced "Arial" 30
#set out "$filename$psformat"

set size 1.5,2.1
set terminal postscript eps color enhanced "Arial" 30
set out "$filename$epsformat"

replot
set terminal x11
EOF
#
# tau vs meV
awk '{if($1=="#"){print $1,$2,$3}else if($1==""){print}else{print ($1*4.136),$2,$3}}' kaccum_tau.dat > kaccum_tau_eV.dat
set file     = `pwd`
set filename = $file:t
set psformat = "_tau.ps"
set epsformat = "_tau.eps"
gnuplot -persist << EOF
set title "$filename"
set xlabel "Energy / meV"
set ylabel "Cumulative lifetime (ps)"
set y2label "Derivative of cumulative lifetime (ps)"
#set y2tics
#set ytics mirror
#set key top left
#p "kaccum_tau_eV.dat" i 30 u 1:2 w l t "Cumulative lifetime at 300 K"
p "kaccum_tau_eV.dat" i 30 u 1:2 w l t "Cumulative lifetime at 300 K", "kaccum_tau_eV.dat" i 30 u 1:3 w l t "Derivative of cumulative lifetime at 300 K"

#set size 1.0,1.0
#set terminal postscript color enhanced "Arial" 30
#set out "$filename$psformat"

set size 1.5,2.1
set terminal postscript eps color enhanced "Arial" 30
set out "$filename$epsformat"

replot
set terminal x11
EOF
#
# cv (eV/K) vs meV
awk '{if($1=="#"){print $1,$2,$3}else if($1==""){print}else{print ($1*4.136),$2,$3}}' kaccum_cv.dat > kaccum_cv_eV.dat
set file     = `pwd`
set filename = $file:t
set psformat = "_cv.ps"
set epsformat = "_cv.eps"
gnuplot -persist << EOF
set title "$filename"
set xlabel "Energy / meV"
set ylabel "Cumulative modal heat capacity  (eV/K)"
set y2label "Derivative of cumulative modal heat capacity (eV/K)"
#set y2tics
#set ytics mirror
#set key top left
#p "kaccum_cv_eV.dat" i 30 u 1:2 w l t "Cumulative modal heat capacity  at 300 K"
p "kaccum_cv_eV.dat" i 30 u 1:2 w l t "Cumulative modal heat capacity  at 300 K", "kaccum_cv_eV.dat" i 30 u 1:3 w l t "Derivative of cumulative modal heat capacity at 300 K"

#set size 1.0,1.0
#set terminal postscript color enhanced "Arial" 30
#set out "$filename$psformat"

set size 1.5,2.1
set terminal postscript eps color enhanced "Arial" 30
set out "$filename$epsformat"

replot
set terminal x11
EOF
#
# gv_norm (eV*nm) vs meV
awk '{if($1==""){print}else{print ($1*4.136),($2*4.136*10),($3*4.136*10)}}' kaccum_gv_norm.dat > kaccum_gv_norm_eV.dat
set file     = `pwd`
set filename = $file:t
set psformat = "_gv_norm.ps"
set epsformat = "_gv_norm.eps"
gnuplot -persist << EOF
set title "$filename"
set xlabel "Energy / meV"
set ylabel "Cumulative absolute value of group velocity (meV.nm)"
set y2label "Derivative of cumulative absolute value of group velocity (meV.nm)"
#set y2tics
#set ytics mirror
#set key top left
#p "kaccum_gv_norm_eV.dat" u 1:2 w l t "Cumulative absolute group velocities at 0 K"
p "kaccum_gv_norm_eV.dat" u 1:2 w l t "Cumulative absolute group velocities at 0 K", "kaccum_gv_norm_eV.dat" u 1:3 w l t "Derivative of cumulative averaged group velocities at 0 K"

#set size 1.0,1.0
#set terminal postscript color enhanced "Arial" 30
#set out "$filename$psformat"

set size 1.5,2.1
set terminal postscript eps color enhanced "Arial" 30
set out "$filename$epsformat"

replot
set terminal x11
EOF
#
----------
------------------------------------------------------------------------------
アクセス数
ページビュー数