137 if test
"$verbose" = true; then echo
"! $command" 1>&2; fi
139 if test $? -ne 0; then
140 echo
"$0: error on command: $command" >&2
148 surface_only=$1; shift
157Mesh.SecondOrderIncomplete = 0;
158/* Mesh.ElementOrder = $order; */
160Mesh.SecondOrderLinear = 0;
161Mesh.SecondOrderExperimental = 0;
162Mesh.SmoothInternalEdges = 100;
165n = $n; // the density of discretisation
169if test $variant = t -o $variant = tq; then
170 echo
"h = 1.0*(b-a)/n;"
172 echo
"h = 2.0*(b-a)/n;"
177Point(40) = {ab, cd, 0, h};
178Point(41) = { b, cd, 0, h};
179Point(42) = {ab, d, 0, h};
180Point(43) = { a, cd, 0, h};
181Point(44) = {ab, c, 0, h};
182Circle(21) = {41, 40, 42};
183Circle(22) = {42, 40, 43};
184Circle(23) = {43, 40, 44};
185Circle(24) = {44, 40, 41};
186Line Loop (51) = {21,22,23,24};
187Physical Line(
"boundary") = {21,22,23,24};
189if test
"${surface_only}" != true; then
190 echo
"Mesh.Algorithm = 1;"
191 echo
"Plane Surface(61) = {51};"
192 echo
"Physical Surface(\"interior\") = {61};"
193 if test $variant = q; then
194 echo
"Mesh.RecombinationAlgorithm = 1;" ;
199 echo
"Mesh.SubdivisionAlgorithm = 1;"
200 echo
"Recombine Surface {61};"
202 if test $variant = tq; then
203 echo
"Mesh.RecombinationAlgorithm = 0;"
205 echo
"Recombine Surface {61} = angle;"
214 surface_only=$1; shift
225Mesh.SecondOrderIncomplete = 0;
226n = $n; // the density of discretisation
234if test $variant = t -o $variant = tq; then
235 echo
"h = 1.0*(b-a)/n;"
237 echo
"h = 2.0*(b-a)/n;"
240Point(1) = {ab, cd, fg, h};
241Point(2) = { b, cd, fg, h};
242Point(3) = {ab, d, fg, h};
243Point(4) = {ab, cd, g, h};
244Point(5) = {a, cd, fg, h};
245Point(6) = {ab, c, fg, h};
246Point(7) = {ab, cd, f, h};
247Circle(1) = {2,1,3}; // {start,center,end}
259Line Loop(1) = {1,11,8};
260Line Loop(2) = {2,7,-11};
261Line Loop(3) = {3,-12,-7};
262Line Loop(4) = {4,-8,12};
263Line Loop(5) = {5,10,-1};
264Line Loop(6) = {-2,-10,6};
265Line Loop(7) = {-3,-6,-9};
266Line Loop(8) = {-4,9,-5};
268Ruled Surface(1) = {1};
269Ruled Surface(2) = {2};
270Ruled Surface(3) = {3};
271Ruled Surface(4) = {4};
272Ruled Surface(5) = {5};
273Ruled Surface(6) = {6};
274Ruled Surface(7) = {7};
275Ruled Surface(8) = {8};
276Surface Loop (1) = {1,2,3,4,5,6,7,8};
277Physical Surface(
"boundary") = {1,2,3,4,5,6,7,8};
279if test
"${surface_only}" = true; then
280 if test $variant = q; then
281 echo
"Mesh.RecombinationAlgorithm = 1;"
282 echo
"Mesh.SubdivisionAlgorithm = 1;"
283 echo
"Recombine Surface {1};"
285 if test $variant = tq; then
286 echo
"Mesh.RecombinationAlgorithm = 0;"
288 echo
"Recombine Surface {1} = angle;"
291 echo
"Mesh.Algorithm3D = 1; // attention: Tetgen is not available in debian packages"
292 echo
"Mesh.OptimizeNetgen = 1;"
293 echo
"Mesh.Optimize = 1;"
294 echo
"Mesh.Smoothing = 10;"
295 echo
"Volume (1) = {1};"
296 if test $variant = H; then
297 echo
"Mesh.RecombinationAlgorithm = 1;"
298 echo
"Mesh.SubdivisionAlgorithm = 2;"
300 echo
"Physical Volume(\"internal\") = {1};"
333pkgbindir=`rheolef-config --pkglibdir`
348 -h) echo ${usage} >&2; exit 0;;
350 -noclean) clean=false; verbose=true;;
351 -verbose) verbose=true;;
352 -noverbose) verbose=false;;
355 -s) surface_only=true;;
356 -e) map_dim=1; variant=`echo x$1 | sed -e
's/x-//'`;;
357 -[tq]|-tq) map_dim=2; variant=`echo x$1 | sed -e
's/x-//'`;;
358 -[TPH]|-TP|-PH|-TPH) map_dim=3; variant=`echo x$1 | sed -e
's/x-//'`;;
359 -[abcdfg]) var=`echo x$1 | sed -e
's/x-//'`
360 if test x
"$2" = x
""; then echo
"$0: $1: missing arg" >&2; echo ${usage} >&2; exit 1; fi
365 -order)
if test x
"$2" = x
""; then echo
"$0: $1: missing arg" >&2; echo ${usage} >&2; exit 1; fi
371 if test x
"$2" = x
""; then echo
"$0: $1: missing arg" >&2; echo ${usage} >&2; exit 1; fi
375 *) echo
"$0: invalid option: $1" >&2; echo ${usage} >&2; exit 1;;
384if test
"${surface_only}" = true; then
385 dim=`expr ${map_dim} + 1`
395mkgmsh ${dim} ${surface_only} $variant $n $a $b $c $d $f $g > $tmp.mshcad
398 my_eval
"$GMSH -${map_dim} $tmp.mshcad -format msh2 -o $tmp.msh > $tmp.log 2>&1"
400 my_eval
"$GMSH -${map_dim} -order $order $tmp.mshcad -format msh2 -o $tmp.msh > $tmp.log 2>&1"
402if test ! -f $tmp.msh; then
403 echo
"$0: gmsh failed"
406MSH2GEO=
"${bindir}msh2geo"
408my_eval
"$MSH2GEO $tmp.msh > ${tmp}-v2.geo"
412 fix_filter=
"$pkgbindir/mkgeo_ball_gmsh_fix -order $order"
416my_eval
"$fix_filter < ${tmp}-v2.geo"
418 my_eval
"rm -f $tmp.log ${tmp}-v1.geo ${tmp}-v2.geo"
419 my_eval
"rm -f $tmp.mshcad $tmp.msh"