#! /bin/csh -f -e # The goal of this test is to illustrate the effect of varying # the weights of the energy functions # This is a smaller version of "run-test" that only runs OptShape twice if ( $#argv != 1 ) then echo "usage: run-small-test " exit 1 endif set infile = "$1" set infile = "${infile:r}" set pg = ~marcone/progs/m3-3.5.3/ set nice = ../nice-shapes # Copy all data to a sub-directory and runs test there set d = "${infile}/`date +%y-%m-%d-%H%M%S`" echo "running test in ${d}" mkdir -p $d $d/src-save cp -p ${nice}/${infile}.top ${d} cp -p ${pg}/libm3marcone/src/{*Energy}.?3 ${d}/src-save cp -p ${pg}/OptShape/src/OptShape.m3 ${d}/src-save cp -p run-small-test show-test-plots monotone-energy-plot.nawk ${d} chmod -R a-w ${d}/* cd ${d} # "Usage: OptShape \\\n"); # " -inFile -outFile \\\n"); # " [ -vertexPasses ] \\\n"); # " [ -maxEvals ] \\\n"); # " [ -showEvery | -showAll ] \\\n"); # ParseMinimizerParams.Help); # " \\\n"); # ParseEnergyParams.Help); # "\n"); set maxev = 5000 set every = 50 foreach comb ( \ Curv.PArea.Corner \ ) set tmp = ${comb:r} set ea = ${tmp:r} set eb = ${tmp:e} set ec = ${comb:e} foreach wts ( \ 100.010.100 010.010.100 100.010.500 \ ) set tmp = ${wts:r} set wa = ${tmp:r} set wb = ${tmp:e} set wc = ${wts:e} set outfile = "${infile}-${ea}${wa}+${eb}${wb}+${ec}${wc}" set wwa = "`echo $wa | sed -e 's/^\(.\)/\1\./'`" set wwb = "`echo $wb | sed -e 's/^\(.\)/\1\./'`" set wwc = "`echo $wc | sed -e 's/^\(.\)/\1\./'`" nice OptShape \ -inFile ${infile} \ -outFile ${outfile} \ -maxEvals ${maxev} \ -showEvery ${every} \ -minimizer Grad Euler \ -energy ${wwa} ${ea} \ -energy ${wwb} ${eb} \ -energy ${wwc} ${ec} gzip ${outfile}.st ${outfile}.plot # show-top ${outfile}-final # show-test-plots ${outfile}.plot end end