#!/bin/bash

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

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

cp -r $FOAM_APP/test/IOField .

pushd IOField > /dev/null
    # objectPath() --> objectPath(false/true)
    sed -i s/"objectPath()"/"objectPath(false)"/g Test-IOField.C

    # copy example case dirs here
    cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity/{constant,system} .
    
    wmake
    
    cp $FOAM_ETC/caseDicts/preProcessing/decomposeParDict system/decomposeParDict
    blockMesh
    decomposePar
    runParallel Test-IOField

popd > /dev/null





