#!/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

cleanCase

# remove the time 0 folder
rm -rf 0 

# remove all the *.pdf files
rm -f plots/*.pdf                                                                                                                                                                       

# remove meshes
rm -rf constant/polyMesh
rm -rf constant/porousMat/polyMesh
rm -rf constant/upwindTube/polyMesh
rm -rf constant/downwindTube/polyMesh

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

# remove dynamicCode folder
rm -rf dynamicCode

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