/usr/bin/mkgeo_grid is in rheolef 5.93-2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | #!/bin/sh
#
# This file is part of Rheolef.
#
# Copyright (C) 2000-2009 Pierre Saramito
#
# Rheolef is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Rheolef is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Rheolef; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# -------------------------------------------------------------------------
#Prog:mkgeo_grid
#NAME: mkgeo_grid -- build a regular grid mesh in 1d, 2d or 3d
#@pindex mkgeo_grid
#@pindex geo
#@cindex mesh
#@fiindex @file{.geo} mesh
#SYNOPSIS:
#@example
# mkgeo_grid @var{options} [@var{nx} [@var{ny} [@var{nz}]]]
#@end example
#EXAMPLE:
#@noindent
# The following command build a triangular based 2d 10x10 grid
# of the unit square:
#@example
# mkgeo_grid -t 10 > square-10.geo
# geo square-10.geo
#@end example
#@noindent
# or in one comand line:
#@example
# mkgeo_grid -t 10 | geo -
#@end example
#DESCRIPTION:
# @noindent
# This command is usefull when testing programs on simple geometries.
# It avoid the preparation of an input file for a mesh generator.
# The optional @var{nx}, @var{ny} and @var{nz} arguments are integer
# that specifies the subdivision in each direction. By default
# @var{nx}=10, @var{ny}=@var{nx} and @var{nz}=@var{ny}.
# The mesh files goes on standard output.
#
# @noindent
# The command supports all the possible element types: edges, triangles,
# rectangles, tetraedra, prisms and hexahedra.
#ELEMENT TYPE OPTIONS:
#@table @code
#@itemx -e
# 1d mesh using edges.
#@itemx -t
# 2d mesh using triangles.
#@itemx -q
# 2d mesh using quadrangles (rectangles).
#@itemx -T
# 3d mesh using tetraedra.
#@itemx -P
# 3d mesh using prisms.
#@itemx -H
# 3d mesh using hexahedra.
#@end table
#THE GEOMETRY:
# @noindent
# The geometry can be any [a,b] segment, [a,b]x[c,d] rectangle
# or [a,b]x[c,d]x[f,g] parallelotope. By default a=c=f=0 and b=d=g=1, thus,
# the unit boxes are considered. For instance, the following
# command meshes the [-2,2]x[-1.5, 1.5] rectangle:
#@example
# mkgeo_grid -t 10 -a -2 -b 2 -c -1.5 -d 1.5 | geo -
#@end example
#@table @code
#@itemx -a @var{float}
#@itemx -b @var{float}
#@itemx -c @var{float}
#@itemx -d @var{float}
#@itemx -f @var{float}
#@itemx -g @var{float}
#@end table
#BOUNDARY DOMAINS:
#@table @code
#@itemx -boundary
# The boundary domains for boxes uses names: @code{left}, @code{right},
# @code{top}, @code{bottom},@code{front} and @code{back}.
# Instead of splitting the boundary in faces, this option
# groups all boundary faces in one domain named @code{boundary}.
#@end table
#@example
# mkgeo_grid -t 10 -boundary | geo -
#@end example
#REGIONS:
#@table @code
#@itemx -region
# The whole domain is splitted into two subdomains: @code{east} and @code{west},
# This option is used for testing computations with subdomains (e.g. transmission
# problem; see the user manual).
#@end table
#@example
# mkgeo_grid -t 10 -region | geo -
#@end example
#CORNERS:
#@table @code
#@itemx -corner
# The corners (four in 2D and eight in 3D) are defined as OD-domains.
# This could be usefull for some special boundary conditions.
#@end table
#@example
# mkgeo_grid -t 10 -corner | geo -
# mkgeo_grid -T 5 -corner | geo -
#@end example
#
#COORDINATE SYSTEM OPTION:
# Most of rheolef codes are coordinate-system independant.
# The coordinate system is specified in the geometry file @file{.geo}.
#@table @code
#@itemx -rz
# the 2d mesh is axisymmetric.
#@end table
#
#DATE:
# 2 february 2004
#END:
usage="mkgeo_grid
[-{abcdfg} float]
[-{eptqTPH}]
[nx [ny nz]]]
[-boundary|-region|-corner|-rz]
"
if test $# -eq 0; then
echo ${usage} >&2
exit 0
fi
args=""
dim=""
cartesian=true
while test $# -ne 0; do
case $1 in
-h) echo ${usage} >&2; exit 0;;
-e) dim="1d"; args="$args $1";;
-[tq]) dim="2d"; args="$args $1";;
-[TPH]) dim="3d"; args="$args $1";;
[\-\+0-9e]*) args="$args $1";;
-[abcdfg]) args="$args $1 $2"; shift;;
-rz) args="$args $1"; cartesian=false;;
-boundary | -region | -corner) args="$args $1";;
*) echo ${usage} >&2; exit 1;;
esac
shift
done
if test $cartesian != true -a $dim != 2d; then
echo "mkgeo_grid: incompatible $dim geometry and non-cartesian coordinate system" >&2
exit 1
fi
pkgbindir=`rheolef-config --pkglibdir`
command="$pkgbindir/mkgeo_grid_$dim $args 2>/dev/null"
if test $dim = 3d; then
command="$command | geo -upgrade -geo - 2>/dev/null"
fi
#echo "! $command" >&2
eval $command
|