-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplot_force_signo.gpi
41 lines (35 loc) · 1.26 KB
/
plot_force_signo.gpi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
set terminal postscript enhanced color
#set terminal epslatex solid
filebase='fuerzas_signo'
#texFileName=filebase.".tex"
#epsfilename=filebase.".eps"
pdfFileName=filebase.".pdf"
#set output 'fuerzas_signo.ps'
set output pdfFileName
NION=system("grep NIONS OUTCAR | awk '{print $NF}'")
set logscale y
set key
set grid ytics
set xlabel " Ciclo Ionico"
set ylabel " Fuerza (eV / ".angstrom.")"
set xtics format "%h"
set ytics format "%h" #"10^{%S}"
do for [atom=1:NION] {
atomnum=sprintf("%03d",atom)
atomvar=sprintf("%d",atom)
input='force'.atomnum
getdynamics="awk -v ver=".atomvar." '/Direct/ {for(i=1;i<=ver;i++)getline;print $(NF-2) $(NF-1) $NF}' CONTCAR"
dynamics=system(getdynamics)
if (dynamics eq "TTT") {
print "buscando en ".input
set title 'Fuerzas sobre el atomo '.atomnum.' Dinamica : '.dynamics
plot input u 0:($6>=0?$6:1/0) w lp title 'Fz >= 0',\
'' u 0:($6<0?-$6:1/0) w lp title 'Fz < 0 ',\
'' u 0:($5>=0?$5:1/0) w lp title 'Fy >=0 0 ',\
'' u 0:($5<0?-$5:1/0) w lp title 'Fy < 0 ',\
'' u 0:($4>=0?$4:1/0) w lp title 'Fx >=0 0 ',\
'' u 0:($4<0?-$4:1/0) w lp title 'Fx < 0 ',\
5e-2 w l lt 1 dt 2 noti , 1e-2 w l lt 1 dt 2 noti,\
'borders.dat' u 1:(1e-5):(0):(1) w vectors nohead notitle
}
}