134usage=
"usage: mkgeo_contraction
135 [nx=$nx_default [ny=nx]]
146pkgbindir="`rheolef-config --pkglibdir`"
150 [0-9]*)
if test x$nx = x
""; then nx=$1;
else ny=$1; fi;;
152 -Lu) Lu=
"$2"; shift;;
153 -Ld) Ld=
"$2"; shift;;
154 -zr|-rz|-cartesian) sys_coord_opt=
"$1";;
155 -name) name=$2; shift;;
156 -hmin) hmin=$2; shift;;
158 -nosplit) split=false;;
160 -noclean) clean=false;;
161 -verbose) verbose=true;;
162 -noverbose) verbose=false;;
163 -h) /bin/echo -E ${usage} >&2; exit 0;;
164 *) /bin/echo -E ${usage} >&2; exit 1;;
168if test x
"$nx" = x
""; then
171if test x
"$ny" = x
""; then
180h0=`echo $hmin $nx | awk
'{print 1.0*$1/$2}'`
181hd=`echo $h $nx | awk
'{print 1.0*$1/$2}'`
182hu=`echo $h $c $nx | awk
'{print 1.0*$1*$2/$3}'`
183hux=`echo $h $Lu $nx | awk
'{print 1.0*$1*$2/$3}'`
184huy=`echo $h $c $ny | awk
'{print 1.0*$1*$2/$3}'`
185hdx=`echo $h $Ld $nx | awk
'{print 1.0*$1*$2/$3}'`
186hdy=`echo $h $ny | awk
'{print 1.0*$1/$2}'`
191m0=` echo $h0 | awk
'{print 1./($1*$1) }'`
192md=` echo $hd | awk
'{print 1./($1*$1) }'`
193mu=` echo $hu | awk
'{print 1./($1*$1) }'`
194mux=`echo $hux | awk
'{print 1./($1*$1) }'`
195muy=`echo $huy | awk
'{print 1./($1*$1) }'`
196mdx=`echo $hdx | awk
'{print 1./($1*$1) }'`
197mdy=`echo $hdy | awk
'{print 1./($1*$1) }'`
199c2=`echo $c $Ld | awk
'{ c2 = 2*$1; print (c2 < $2 ? c2 : $2) }'`
218cat > $name.bamgcad << EOF2
250echo
"! $name.bamgcad created" 1>&2
252cat > $name.mtr << EOF1b
266$verbose && echo
"! $name.mtr created" 1>&2
267to_clean=
"$to_clean $name.mtr"
269cat > $name.dmn << EOF3
277echo
"! $name.dmn created" 1>&2
281command=
"bamg -g $name.bamgcad -M $name.mtr -o $name.bamg"
283 command=
"$command 1>&2"
285 command=
"$command 1> $name.bamglog"
286 to_clean=
"$to_clean $name.bamglog"
288$verbose && echo
"! $command" 1>&2
291if test $status -ne 0; then
292 if $verbose; then true;
else cat $name.bamglog 1>&2; fi
293 echo
"$0: command failed" 1>&2
296echo
"! $name.bamg created" 1>&2
299 filter=
"| ${pkgbindir}/geo_split | geo -upgrade -geo -"
303command=
"bamg2geo $name.bamg $name.dmn $sys_coord_opt $filter > $name.geo"
304$verbose && echo
"! $command" 1>&2
307if test $status -ne 0; then
308 echo
"$0: command failed" 1>&2
311echo
"! $name.geo created" 1>&2
313 command=
"rm -f $to_clean"
314 $verbose && echo
"! $command" 1>&2