rm -f *[0s].msh
g=
quad=
if [ "$1" = "-g" ] ;then g=-g;shift; fi
if [ "$1" = "-q" ] ;then quad="-2q -coef 2 -thetaquad 10" ;shift; fi
if [ "$1" = "-g" ] ;then g=-g;shift; fi

if [ -z "$bamg" -o ! -x "$bamg" ] ;then bamg=bamg$g; fi
echo " to close the graphic enter f on graphic window until they exist "
echo "Mesh  square " 
echo ${bamg} -g  square_g.msh -o square_0.msh $quad
${bamg} -g  square_g.msh -o square_0.msh $quad
if [  $? -ne 0 -o ! -s square_0.msh ] ; then echo "the file square_0.msh  is empty or d'ont exist";exit 1 ; fi

echo ${bamg} -g  square_g.msh -o square_0.msh $quad
${bamg} -splitpbedge  -g  square_g.msh -o square_s.msh  $quad
if [  $? -ne 0 -o ! -s square_0.msh ] ; then echo "the file square_s.msh  is empty or d'ont exist";exit 1 ; fi

echo "Mesh  circle  " 
${bamg} -g  circle_g.msh -o circle_0.msh $quad
if [ $? -ne 0 -o  ! -s circle_0.msh ] ; then echo "the file circle_0.msh  is empty or d'ont exist";exit 1 ; fi

echo "Mesh  a octogone  " 
${bamg} -g  octogone_g.msh -o octogone_0.msh $quad
if [ ! -s octogone_0.msh ] ; then echo "the file octogone_0.msh  is empty or d'ont exist";exit 1 ; fi

echo "Mesh  a  square with raff  " 
${bamg} -g  square_raf_g.msh -o square_raf_0.msh $quad
if [ $? -ne 0 -o ! -s  square_raf_0.msh ] ; then echo "the file  square_raf_0.msh  is empty or d'ont exist";exit 1 ; fi

echo "Mesh  a  square with raff  split pb edge" 
${bamg} -splitpbedge -g  square_raf_g.msh -o square_raf_s.msh $quad
if [ $? -ne 0 -o ! -s  square_raf_0.msh ] ; then echo "the file  square_raf_0.msh  is empty or d'ont exist";exit 1 ; fi

echo "Mesh  a  square with anisotropique mesh  " 
${bamg} -g  square_raf_g.msh -o square_raf_ani_0.msh -M square_raf_ani_g.mtr $quad
if [ $? -ne 0 -o ! -s  square_raf_ani_0.msh ] ; then echo "the file  square_raf_ani_0.msh  is empty or d'ont exist";exit 1 ; fi

echo "Mesh  a  square with anisotropique mesh with -splitpbedge " 
${bamg} -splitpbedge -g  square_raf_g.msh -o square_raf_ani_s.msh -M square_raf_ani_g.mtr $quad
if [ $? -ne 0 -o ! -s  square_raf_ani_s.msh ] ; then echo "the file  square_raf_ani_s.msh  is empty or d'ont exist";exit 1 ; fi

${bamg} -splitpbedge -g  l_g.msh -o l_0.msh  $quad
if [ $? -ne 0 -o ! -s  l_0.msh ] ; then echo "the file   l_0.msh  is empty or d'ont exist";exit 1 ; fi

