#!/bin/bash

###################################
## Avalanches simulation
## with 2 colors of grain
###################################


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

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

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

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

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

## default command
#nice ./rescal $PAR_FILE -cv0 -lc -al 0 -vcol >> $RESCAL_LOG_FILE 

## generation of png images, data files and info logs, then stop after 30 minutes
nice ./rescal $PAR_FILE -cv0 -lc -al 0 -vcol -info -dpng 10 -dcsp 1 -stop 30 >> $RESCAL_LOG_FILE
#nice ./rescal $PAR_FILE -cv0 -lc -vcol -info -dpng 10 -dcsp 1 -stop 30 >> $RESCAL_LOG_FILE

