#!/bin/bash

###################################
## Simulation of the core-mantle boundary 
## (define CMB model in defs.h)
###################################

## remove all previously generated files
#./clean -f
./clean

if [ ! -e genesis ]; then
  ln -s ../src/genesis .
fi
if [ ! -e rescal ]; then
  ln -s ../src/rescal .
fi

## parameters file (input)
PAR_FILE="cmb.par"

## general log files (output)
GENESIS_LOG_FILE="GENESIS.log"
RESCAL_LOG_FILE="RESCAL.log"

## generation of binary cellular space 
#./genesis -f $PAR_FILE -s 2000 > $GENESIS_LOG_FILE

## generation of 20 PNG images with delays in t0, and stop
(time ./rescal $PAR_FILE -cv0 -dlog 100t0 -dpng 100t0 -stop 2000t0 >> $RESCAL_LOG_FILE ) 2> time.out

## generation of PNG images and CSP files with delays in seconds (resp. minutes)
#nice ./rescal $PAR_FILE -cv0 -dlog 10 -dpng 10 -dcsp 5 -stop 30 >> $RESCAL_LOG_FILE


