#!/bin/bash
xrangemn=0;
xrangemx=`cat coursework_2011_cuda_tesla_1dv2.cuf | grep inparams%dx | awk '{print $3}'`*`cat coursework_2011_cuda_tesla_1dv2.cuf | grep 'integer, parameter :: grid' | awk '{print $6}'`;
yrangemn=-9;
yrangemx=60;
for i in `seq 1 9`; do
name="plot000${i}.png"
gnuplot << EOF
set encoding utf8
set title ""
set term png font "/usr/share/fonts/corefonts/arial.ttf"
set xlabel "c"
set ylabel "x"
set xrange [$xrangemn:$xrangemx]
set yrange [$yrangemn:$yrangemx]
set grid
set output "./$name"
plot "1d_cuda_p_\ \ \ $i.txt" using 1:2 title "p" lw 2 with lines,\
"1d_cuda_rho_\ \ \ $i.txt" using 1:2 title "P" with lines,\
"1d_cuda_Vx_\ \ \ $i.txt" using 1:2 title "Vx" with lines,\
"ftheta.txt" using 1:2 title "f" with lines
EOF
done
for i in `seq 10 99`; do
name="plot00${i}.png"
gnuplot << EOF
set encoding utf8
set title ""
set term png font "/usr/share/fonts/corefonts/arial.ttf"
set xlabel "c"
set ylabel "x"
set xrange [$xrangemn:$xrangemx]
set yrange [$yrangemn:$yrangemx]
set grid
set output "./$name"
plot "1d_cuda_p_\ \ $i.txt" using 1:2 title " pressure" lw 2 with lines,\
"1d_cuda_rho_\ \ $i.txt" using 1:2 title " density" with lines,\
"1d_cuda_Vx_\ \ $i.txt" using 1:2 title " Vx" with lines,\
"ftheta.txt" using 1:2 title " forces" with lines
EOF
done
for i in `seq 100 999`; do
name="plot0${i}.png"
gnuplot << EOF
set encoding utf8
set title ""
set term png font "/usr/share/fonts/corefonts/arial.ttf"
set xlabel "c"
set ylabel "x"
set xrange [$xrangemn:$xrangemx]
set yrange [$yrangemn:$yrangemx]
set grid
set output "./$name"
plot "1d_cuda_p_\ $i.txt" using 1:2 title " pressure" lw 2 with lines,\
"1d_cuda_rho_\ $i.txt" using 1:2 title " density" with lines,\
"1d_cuda_Vx_\ $i.txt" using 1:2 title " Vx" with lines,\
"ftheta.txt" using 1:2 title " forces" with lines
EOF
done
for i in `seq 1000 3000`; do
name="plot${i}.png"
gnuplot << EOF
set encoding utf8
set title ""
set term png font "/usr/share/fonts/corefonts/arial.ttf"
set xlabel "c"
set ylabel "x"
set xrange [$xrangemn:$xrangemx]
set yrange [$yrangemn:$yrangemx]
set grid
set output "./$name"
plot "1d_cuda_p_$i.txt" using 1:2 title " pressure" lw 2 with lines,\
"1d_cuda_rho_$i.txt" using 1:2 title " density" with lines,\
"1d_cuda_Vx_$i.txt" using 1:2 title " Vx" with lines,\
"ftheta.txt" using 1:2 title " forces" with lines
EOF
done