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

# Source tutorial run functions

org="0"
const="constant"
system="system"
dyn="dynamicCode"
animation="animation"
data="data"


for f in *
do
    if [ -d $f ]; then
        if                              \
            [ $f != $org ]              \
         && [ $f != $const ]            \
         && [ $f != $system ]           \
         && [ $f != $animation ]        \
         && [ $f != $data ]             \
         && [ $f != $dyn ] ; then
            rm -r $f
        fi
    fi
done

setFields
decomposePar
mpirun -np 3 denseAGFoam -parallel
