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

runApplication blockMesh

# Create fine surface
runApplication -s 1 surfaceRefineRedGreen \
    constant/triSurface/box_12.obj constant/triSurface/box_12_1.obj

runApplication -s 2 surfaceRefineRedGreen \
    constant/triSurface/box_12_1.obj constant/triSurface/box_12_2.obj

runApplication -s 3 surfaceRefineRedGreen \
    constant/triSurface/box_12_2.obj constant/triSurface/box_12_3.obj

runApplication -s 4 surfaceRefineRedGreen \
    constant/triSurface/box_12_3.obj constant/triSurface/box_12_4.obj

runApplication -s 5 surfaceRefineRedGreen \
    constant/triSurface/box_12_4.obj constant/triSurface/box_12_5.obj

runApplication -s 6 surfaceRefineRedGreen \
    constant/triSurface/box_12_5.obj constant/triSurface/box_12_6.obj

runApplication -s 7 surfaceRefineRedGreen \
    constant/triSurface/box_12_6.obj constant/triSurface/box_12_7.obj

runApplication -s 8 surfaceRefineRedGreen \
    constant/triSurface/box_12_7.obj constant/triSurface/box_12_8.obj

runApplication -s 9 surfaceRefineRedGreen \
    constant/triSurface/box_12_8.obj constant/triSurface/box_12_9.obj

runApplication -s 10 surfaceRefineRedGreen \
    constant/triSurface/box_12_9.obj constant/triSurface/box.obj


runApplication surfaceTransformPoints \
    -rotate '((1 0 0)(1 0.8 0.9))' \
    -translate '(0.1 0.101 0.103)' \
    constant/triSurface/box.obj constant/triSurface/box_trans.obj


# Run non-parallel
runApplication snappyHexMesh

# Run parallel
runApplication decomposePar

runParallel -s parallel snappyHexMesh

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