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

runApplication blockMesh

#runApplication -s 1 topoSet -dict system/topoSetDictRefine
#runApplication -s 1 refineMesh -overwrite -dict system/refineMeshDict
runApplication -s 1 topoSet -dict system/topoSetDictRefine
runApplication -s 1 refineMesh -overwrite -dict system/refineMeshDict.2

runApplication -s 2 topoSet -dict system/topoSetDictRefine
runApplication -s 2 refineMesh -overwrite -dict system/refineMeshDict.2

runApplication -s 7 topoSet -dict system/topoSetDictRefine.3
runApplication -s 7 refineMesh -overwrite -dict system/refineMeshDict.2

runApplication -s 8 topoSet -dict system/topoSetDictRefine.4
runApplication -s 8 refineMesh -overwrite -dict system/refineMeshDict.2

# Select cellSets
runApplication -s hull topoSet -dict system/topoSetDictHull
runApplication -s hull subsetMesh keepBox -patch hullWall -overwrite

# Select cellSets
runApplication -s propeller topoSet -dict system/topoSetDictPropeller
runApplication -s propeller subsetMesh keepBox -patch propellerWall -overwrite

# Select cellSets
runApplication -s rudder topoSet -dict system/topoSetDictRudder
runApplication -s rudder subsetMesh keepBox -patch rudderWall -overwrite

restore0Dir

# Use cellSets to write zoneID
runApplication -s 1 setFields -dict system/setFieldsDict
runApplication -s 2 setFields -dict system/setFieldsDictWaterLevel

touch boatAndPropeller.foam

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