/usr/bin/mkgeo_grid is in rheolef 6.5-1+b1.
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 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 | #!/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: @code{mkgeo_grid} -- build a strutured mesh of a parallelotope, 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
#@item -e
# 1d mesh using edges.
#@item -t
# 2d mesh using triangles.
#@item -q
# 2d mesh using quadrangles (rectangles).
#@item -T
# 3d mesh using tetraedra.
#@item -P
# 3d mesh using prisms.
#@item -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
#@item -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
#@item -sides
#@itemx -nosides
# The boundary sides are representd by domains: @code{left}, @code{right},
# @code{top}, @code{bottom},@code{front} and @code{back}.
#@item -boundary
#@itemx -noboundary
# This option defines a domain named @code{boundary} that groups all sides.
#@end table
#By default, both sides and the whole boundary are defined as domains:
#@example
# mkgeo_grid -t 10 > square.geo
# geo square.geo
# mkgeo_grid -t 10 -nosides > square.geo
# geo square.geo
# mkgeo_grid -t 10 -noboundary > square.geo
# geo square.geo
# mkgeo_grid -t 10 -noboundary -nosides > square.geo
# geo square.geo
#@end example
#REGIONS:
#@table @code
#@item -region
#@itemx -noregion
# 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
#@item -corner
#@itemx -nocorner
# 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
#@cindex axisymmetric coordinate system
#@item -zr
#@itemx -rz
# the 2d mesh is axisymmetric: @code{zr} (resp. @code{rz}) stands when the symmetry is related
# to the first (resp. second) coordinate.
#@end table
#
#FILE FORMAT OPTION:
#@table @code
#@end table
#
#DATE:
# 2 february 2004
#END:
usage="mkgeo_grid
[-{abcdfg} float]
[-{eptqTPH}]
[nx [ny nz]]]
[-[no]sides]
[-[no]boundary]
[-[no]region]
[-[no]corner]
[-rz|-zr]
[-v4]
"
if test $# -eq 0; then
echo ${usage} >&2
exit 0
fi
args=""
dim=""
sys_coord="cartesian"
new_format=`rheolef-config --have-new-code 2>/dev/null`
GEO_BIN=${GEO_BIN-"geo"}
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"; sys_coord="rz";;
-zr) args="$args $1"; sys_coord="zr";;
-sides | -boundary | -region | -corner | -nosides | -noboundary | -noregion | -nocorner)
args="$args $1";;
*) echo ${usage} >&2; exit 1;;
esac
shift
done
if test ${new_format} = true; then
args="$args -v4"
fi
#echo "! GEO_BIN=${GEO_BIN}" >&2
#echo "! new_format=${new_format}" >&2
pkgbindir=`rheolef-config --pkglibdir`
if test $sys_coord != "cartesian" -a $dim != 2d; then
echo "mkgeo_grid: incompatible $dim geometry and non-cartesian \"${sys_coord}\"coordinate system" >&2
exit 1
fi
command="$pkgbindir/mkgeo_grid_$dim $args 2>/dev/null"
if test $dim = 3d || test ${new_format} = true; then
command="$command | ${GEO_BIN} -upgrade -geo - 2>/dev/null"
fi
#echo "! $command" >&2
eval $command
status=$?
if test $status -ne 0; then
echo "$0: command failed" 1>&2
exit $status
fi
|