#! /bin/csh -f -e

# Runs Optshape and saves all data in a sub-directory.
# Usage: run-test

set infile = "sausage-4-0002-s"

set d = "`date +%y-%m-%d-%H%M%S`"

echo "running in ${d}"

mkdir $d #$d/src-save
#cp -p ../src/OptShape.m3 ${d}/src-save
#cp -p ../../libm3marcone/src/*Energy.?3 ${d}/src-save
cp -p ${infile}.top ${d}
cp -p run-test show-plots monotone-energy-plot.nawk ${d}
#chmod -R a-w ${d}/*

cd ${d}

set outfile = "${infile}-ae"

nice ../../SOLgnu/OptShape \
  -inFile ${infile} \
  -outFile ${outfile} \
  -showEvery 100 \
  -maxEvals 3000 \
  -energy 0.1000 Curv \
  -energy 0.0000 PArea \
  -energy 0.0000 Corner \
  -energy 1.0000 Excen \
  -energy 0.0000 Poten \
  -energy 0.0100 Elect fuzz 0.01\
  -minimizer Grad Euler

show-plots ${outfile}

