#!/bin/sh
cd "${0%/*}" || exit                                # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
#------------------------------------------------------------------------------

restore0Dir

runApplication blockMesh

cp -f system/decomposeParDict.hierarchical system/decomposeParDict

runApplication decomposePar

cp -f system/decomposeParDict.ptscotch system/decomposeParDict

runParallel snappyHexMesh -overwrite

find . -iname '*level*' -type f -delete

# Set the initial fields
restore0Dir -processor

runParallel topoSet

runParallel $(getApplication)

runApplication reconstructParMesh -constant

runApplication reconstructPar

#------------------------------------------------------------------------------
