Path: blob/devel/elmerice/examples/Inverse_Methods/MacAyeal_SSA/RUN.sh
3206 views
#!/bin/bash12# you can choose to run serial or parallel:3## here is the number of partitions4NP=156# make mesh7ElmerGrid 1 2 mesh2D8##9if [ $NP -gt 1 ]10then11ElmerGrid 2 2 mesh2D -metis $NP12fi1314# compile required USFs15make1617# Parameters18lambda='0.0e00 1.0e03 1.0e04 1.0e05 5.0e05 1.0e06 5.0e06 1.0e07 5.0e07 1.0e08 1.0e09 1.0e10 1.0e11'19DATAFILE="..\/DATA\/MacAyeal_VELOCITIES_NOISE.txt"2021rm -rf LCurve.dat2223# loop over reg. coefs.24c=025for i in $lambda26do27c=$((c+1))2829echo $i30# get .sif file31NAME=OPT_"$c"32sed "s/<Lambda>/"$i"/g;s/<NAME>/$NAME/g;s/<OBS_FILE>/$DATAFILE/g" SIF/OPTIM.sif > OPTIM_$c.sif3334# run35echo OPTIM_$c.sif > ELMERSOLVER_STARTINFO36if [ $NP -gt 1 ]37then38mpirun -np 2 ElmerSolver_mpi39else40ElmerSolver41fi4243# post process44python ../SCRIPTS/MakeReport.py $NAME45echo $(tail -n 1 Cost_"$NAME".dat | awk '{print $3}') $(tail -n 1 CostReg_"$NAME".dat | awk '{print $2}') $i >> LCurve.dat46done474849