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

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

runApplication -s fluid blockMesh -region fluid

runApplication decomposePar -region fluid -noFields

# Create a set for the bits of the mesh that are not boxes
runParallel topoSet -region fluid

# Create the boxes and add their surfaces to the boxes patch
runParallel subsetMesh notBoxes -region fluid -patch film -overwrite -noFields

# Create the film mesh
runParallel extrudeToRegionMesh -region fluid -overwrite

runApplication -s fields decomposePar -fields -copyZero

printf "\n%s\n" "Creating files for paraview post-processing"
paraFoam -touchAll
echo

runParallel $(getApplication);

runApplication reconstructPar -allRegions

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