cell.plt 1.27 KB
Newer Older
Francois Gygi committed
1 2
#!/bin/bash
# cell.plt: plot cell parameters during an MD simulation
3 4 5 6 7 8
if [ $1 == "-range" ]
then
  range=$2
  shift 2
fi

Francois Gygi committed
9
gnuplot -persist <<EOF
10
plot $range "<grep -h -A3 '<unit_cell' $* | grep a=" u 2 w l, \
Francois Gygi committed
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
     "<grep -h -A3 '<unit_cell' $* | grep a=" u 3 w l, \
     "<grep -h -A3 '<unit_cell' $* | grep a=" u 4 w l, \
     "<grep -h -A3 '<unit_cell' $* | grep b=" u 2 w l, \
     "<grep -h -A3 '<unit_cell' $* | grep b=" u 3 w l, \
     "<grep -h -A3 '<unit_cell' $* | grep b=" u 4 w l, \
     "<grep -h -A3 '<unit_cell' $* | grep c=" u 2 w l, \
     "<grep -h -A3 '<unit_cell' $* | grep c=" u 3 w l, \
     "<grep -h -A3 '<unit_cell' $* | grep c=" u 4 w l, 0
fit ax "<grep -h -A3 '<unit_cell' $* | grep a=" u 0:2 via ax
fit ay "<grep -h -A3 '<unit_cell' $* | grep a=" u 0:3 via ay
fit az "<grep -h -A3 '<unit_cell' $* | grep a=" u 0:4 via az
fit bx "<grep -h -A3 '<unit_cell' $* | grep b=" u 0:2 via bx
fit by "<grep -h -A3 '<unit_cell' $* | grep b=" u 0:3 via by
fit bz "<grep -h -A3 '<unit_cell' $* | grep b=" u 0:4 via bz
fit cx "<grep -h -A3 '<unit_cell' $* | grep c=" u 0:2 via cx
fit cy "<grep -h -A3 '<unit_cell' $* | grep c=" u 0:3 via cy
fit cz "<grep -h -A3 '<unit_cell' $* | grep c=" u 0:4 via cz
print "avg a: ", ax, ay, az
print "avg b: ", bx, by, bz
print "avg c: ", cx, cy, cz
EOF