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

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

runApplication blockMesh
runApplication setFields

runApplication decomposePar
runParallel foamRun
runApplication reconstructPar

( cd validation && ./createGraphs )

case=$(basename "$PWD")
mpytest --suffix "${case}.volumeClass2" almostequal --decimal 8 \
    postProcessing/volumeClass2/0/volFieldValue.dat \
    validation/reference/volumeClass2/0/volFieldValue.dat
mpytest --suffix "${case}.totalNumberOfBubbles" almostequal --decimal 8 \
    postProcessing/totalNumberOfBubbles/0/volFieldValue.dat \
    validation/reference/totalNumberOfBubbles/0/volFieldValue.dat

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