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

# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions

# copy DTC hull surface from resources folder
#cp $FOAM_TUTORIALS/resources/geometry/DTC-scaled.stl.gz constant/triSurface/

#start=$(date +%s.%N)
#runApplication surfaceFeatureExtract
#play -n synth 0.1 sine 880 vol 1
#dur=$(echo "$(date +%s.%N) - $start" | bc)
#echo 'TIME :' $dur



start=$(date +%s.%N)
runApplication blockMesh
play -n synth 0.1 sine 880 vol 1
dur=$(echo "$(date +%s.%N) - $start" | bc)
echo 'TIME :' $dur



#start=$(date +%s.%N)
#for i in 1 2 3 4 5 6
#do
#    runApplication -s $i \
#        topoSet -dict system/topoSetDict.${i}
#
#    runApplication -s $i \
#        refineMesh -dict system/refineMeshDict -overwrite
#done
#play -n synth 0.1 sine 880 vol 1
#dur=$(echo "$(date +%s.%N) - $start" | bc)
#echo 'TIME :' $dur

#start=$(date +%s.%N)
#runApplication snappyHexMesh -overwrite
#play -n synth 0.1 sine 880 vol 1
#dur=$(echo "$(date +%s.%N) - $start" | bc)
#echo 'TIME :' $dur


#rm -rf 0
#cp -r 0.orig 0

#start=$(date +%s.%N)
#runApplication setFields
#play -n synth 0.1 sine 880 vol 1
#dur=$(echo "$(date +%s.%N) - $start" | bc)
#echo 'TIME :' $dur

#start=`date +%s`
#runApplication decomposePar
#play -n synth 0.1 sine 880 vol 1
#end=`date +%s`
#runtime=$((end-start))
#echo 'TIME :' $runtime

#start=`date +%s`
#runParallel renumberMesh -overwrite
#play -n synth 0.1 sine 880 vol 1
#end=`date +%s`
#runtime=$((end-start))
#echo 'TIME :' $runtime

start=$(date +%s.%N)
runApplication interFoam
for i in {1..10}
do
	play -n synth 0.1 sine 880 vol 1
done
dur=$(echo "$(date +%s.%N) - $start" | bc)
echo 'TIME :' $dur

#while true
#do

#done
#start=`date +%s`
#runApplication reconstructPar
#play -n synth 0.1 sine 880 vol 1
#end=`date +%s`
#runtime=$((end-start))
#echo 'TIME :' $runtime
#------------------------------------------------------------------------------
