#!/bin/bash

if ! which gnuplot > /dev/null 2>&1
then
    echo 'gnuplot not found - skipping graph creation' >&2
    exit 1
fi

#\*----------------------------Retention tatio--------------------------------*/
gnuplot<<EOF

    set terminal pngcairo enhanced color size 800,600 font "Arial,18"

    set output 'retentionRatio.png'

    set grid
    set key box
    set key spacing 1
    set xlabel 't [s]'
    set ylabel '{/Symbol a}^{gas}_{particle} \
/ {/Symbol a}^{gas}_{particle0} [-]'

    p = '../postProcessing/probes/0/particleVolumeFraction.gas'
    rP = 'probes/0/particleVolumeFraction.gas'

    stats p u 2 name 'statpVF' nooutput

    plot p u 1:(\$2/statpVF_max) w l lw 3 lc rgb 'magenta' t 'Simulation' ,\
         rP u 1:(\$2/statpVF_max) w l dt "-  -" lw 3 lc rgb 'black' t 'Reference',\

EOF
#------------------------------------------------------------------------------
