#!/bin/bash cd "${0%/*}" || exit # Run from this directory . ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions #------------------------------------------------------------------------------ # settings # operand setups setups=" icoReactingMultiphaseInterFoam interCondensatingEvaporatingFoam " #------------------------------------------------------------------------------ plot_t_vs_x() { setup="$1" benchmarkFile="$FOAM_TUTORIALS/resources/dataset/StefanProblem.dat" sampleFile0="results/$setup/postProcessing/interfaceHeight1/1.36" sampleFile="$sampleFile0/positionClean.dat" sed -e 's/[()]//g' "$sampleFile0/position.dat" > "$sampleFile" image="plots/$setup/t_vs_x.png" gnuplot</dev/null || { echo "FOAM FATAL ERROR: gnuplot not found - skipping graph creation" 1>&2 exit 1 } # Check "results" directory [ -d "results" ] || { echo "FOAM FATAL ERROR: No results directory found - skipping graph creation" 1>&2 exit 1 } #------------------------------------------------------------------------------ for setup in $setups do echo "" echo "# Plots for the setup: $setup" echo "" dirPlots="plots/$setup" [ -d "$dirPlots" ] || mkdir -p "$dirPlots" plot_t_vs_x "$setup" done #------------------------------------------------------------------------------