#!/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

mkdir 0
cp 0.org/* 0/

setFields
denseAGFoam
# decomposePar
# mpirun -np 4 denseAGFoam -parallel
