#!/bin/sh # # calculate pair correlation functions for a whole simulation output # frank.zirkelbach@physik.uni-augsburg.de # do_it() { echo "processing $1 ..." ./pair_correlation_calc $2 $1 trg=`echo $1 | sed 's%s-%pair_corr-%' | sed 's%.save%%'` mv pair_corr_func.txt $trg echo "done" } if [ -d $1 ]; then for file in $1/*.save; do do_it $file $2 done fi if [ -f $1 ]; then do_it $1 $2 fi # gnuplot if [ "$3" = "g" ]; then if [ -d $1 ]; then pdir=$1 else pdir=`dirname $1` fi pfile=$pdir/pair_corr.scr cat > $pfile <<-EOF set autoscale unset log unset label set xtic auto set ytic auto set title 'Pair correlation function' set xlabel 'r [A]' set ylabel 'g(r) [a.u.]' unset ytics set terminal postscript eps enhanced color solid lw 1 'Helvetica' 14 set output '$pdir/pair_corr.eps' EOF echo -en "plot [1.0:6.0] " >> $pfile komma=0 for i in $pdir/pair_corr-*; do time=`basename $i | awk -F- '{print $2}'` if [ ! -z `echo $4 | grep a` ]; then [ "$komma" = "1" ] && echo -en ", " >> $pfile echo -en "\"$i\" u 1:2 w l t \"ab $time\"" >> $pfile komma=1 fi if [ ! -z `echo $4 | grep b` ]; then [ "$komma" = "1" ] && echo -en ", " >> $pfile echo -en "\"$i\" u 1:3 w l t \"aa $time\"" >> $pfile komma=1 fi if [ ! -z `echo $4 | grep c` ]; then [ "$komma" = "1" ] && echo -en ", " >> $pfile echo -en "\"$i\" u 1:4 w l t \"bb $time\"" >> $pfile komma=1 fi done echo -en "\n" >> $pfile gnuplot $pfile fi