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

# Source PATO run functions
. $PATO_DIR/src/applications/utilities/runFunctions/RunFunctions

# Initialize the script
pato_init

if [ ! -f "../results.txt" ];
then
    echo "../results.txt" not found
    echo "Run first dakota: ../Allrun-dakota"
    exit 1
fi
replaceDakotaResults ../results.txt ../templatedir/porousMatProperties.template constant/porousMat/porousMatProperties
if [ ! -d 0 ]; then
    scp -r origin.0 0
fi
blockMesh -region porousMat
PATOx
