#!/bin/bash
cd "${0%/*}" || exit 1    # run from this directory

if [ -z "${SINGULARITY_NAME}" ]
then
    echo 'Not operating in Apptainer container - skipping test'
    exit 0
fi

# Source run functions
. "$WM_PROJECT_SITE/$WM_PROJECT_VERSION/bin/tools/RunFunctions"

if [ ! -d "squareBend" ]; then
  foamCloneCase "$FOAM_TUTORIALS/fluid/squareBend" squareBend
fi

( \
    cd squareBend \
 && foamDictionary -entry writeInterval system/controlDict -set 20 \
 && runApplication blockMesh \
 && runApplication checkMesh \
 && runApplication decomposePar \
 && runParallel foamRun \
 && runApplication foamLog log.foamRun \
)

./createGraphs

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