#!/bin/bash
cd ${0%/*} || exit 1 # Run from this directory

# Source PATO run functions
. $PATO_DIR/src/applications/utilities/runFunctions/RunFunctions

# Initialize the script
pato_init

# Source tutorial clean functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions

# Remove 0 directory
rm -rf 0 > /dev/null  2>&1

# remove all the pdf files from plots
rm -f plots/*.pdf > /dev/null  2>&1

# remove output folder and add an empty file for git repository
if [ -d output ]; then
    rm -rf output
fi
mkdir output
touch output/empty

# Remove meshes
rm -rf constant/solid/polyMesh > /dev/null 2>&1
rm -rf constant/fluid/polyMesh > /dev/null 2>&1

# Clean case
cleanCase

# remove temporary files
find . -name '*~' -ls -delete

