#!/bin/sh

# create the mesh
blockMesh

# create the intial time folder
cp -r 0_org 0

# map the fields
mapFields -sourceTime  3 Case1D/
mv 0/pointDisplacement.unmapped 0/pointDisplacement

# Decompose the case in order to run in parallel (on 12 cores)
decomposePar

# Run sedFoam in parallel
mpirun -np 12 --oversubscribe overSedDymFoam_rbgh -parallel > log.out&
echo "The simulation is executed in background, with output to log.out"

#  Postprocessing
echo "-------------------------------------------------------------------"
echo "To generate the postprocessing files you need to execute ./makeFiles"
echo "Then go to ../Py and run the python3 script plot2DCylinderPosition.py"

