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
157 Mesh.SecondOrderIncomplete = 0;
158 /* Mesh.ElementOrder = $order; */
160 Mesh.SecondOrderLinear = 0;
161 Mesh.SecondOrderExperimental = 0;
162 Mesh.SmoothInternalEdges = 100;
163 Mesh.Smoothing = 100;
165 n = $n; // the density of discretisation
169 if test $variant = t -o $variant = tq; then
170 echo
"h = 1.0*(b-a)/n;"
172 echo
"h = 2.0*(b-a)/n;"
177 Point(40) = {ab, cd, 0, h};
178 Point(41) = { b, cd, 0, h};
179 Point(42) = {ab, d, 0, h};
180 Point(43) = { a, cd, 0, h};
181 Point(44) = {ab, c, 0, h};
182 Circle(21) = {41, 40, 42};
183 Circle(22) = {42, 40, 43};
184 Circle(23) = {43, 40, 44};
185 Circle(24) = {44, 40, 41};
186 Line Loop (51) = {21,22,23,24};
187 Physical Line(
"boundary") = {21,22,23,24};
189 if 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
225 Mesh.SecondOrderIncomplete = 0;
226 n = $n; // the density of discretisation
234 if test $variant = t -o $variant = tq; then
235 echo
"h = 1.0*(b-a)/n;"
237 echo
"h = 2.0*(b-a)/n;"
240 Point(1) = {ab, cd, fg, h};
241 Point(2) = { b, cd, fg, h};
242 Point(3) = {ab, d, fg, h};
243 Point(4) = {ab, cd, g, h};
244 Point(5) = {a, cd, fg, h};
245 Point(6) = {ab, c, fg, h};
246 Point(7) = {ab, cd, f, h};
247 Circle(1) = {2,1,3}; // {start,center,end}
256 Circle(10) = {7,1,3};
257 Circle(11) = {3,1,4};
258 Circle(12) = {4,1,6};
259 Line Loop(1) = {1,11,8};
260 Line Loop(2) = {2,7,-11};
261 Line Loop(3) = {3,-12,-7};
262 Line Loop(4) = {4,-8,12};
263 Line Loop(5) = {5,10,-1};
264 Line Loop(6) = {-2,-10,6};
265 Line Loop(7) = {-3,-6,-9};
266 Line Loop(8) = {-4,9,-5};
268 Ruled Surface(1) = {1};
269 Ruled Surface(2) = {2};
270 Ruled Surface(3) = {3};
271 Ruled Surface(4) = {4};
272 Ruled Surface(5) = {5};
273 Ruled Surface(6) = {6};
274 Ruled Surface(7) = {7};
275 Ruled Surface(8) = {8};
276 Surface Loop (1) = {1,2,3,4,5,6,7,8};
277 Physical Surface(
"boundary") = {1,2,3,4,5,6,7,8};
279 if 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};"
333 pkgbindir=`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;;
384 if test
"${surface_only}" = true; then
385 dim=`expr ${map_dim} + 1`
395 mkgmsh ${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"
402 if test ! -f $tmp.msh; then
403 echo
"$0: gmsh failed"
406 MSH2GEO=
"${bindir}msh2geo"
408 my_eval
"$MSH2GEO $tmp.msh > ${tmp}-v2.geo"
412 fix_filter=
"$pkgbindir/mkgeo_ball_gmsh_fix -order $order"
416 my_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"