#!/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 command line:
#@example
#	mkgeo_grid -t 10 | geo -
#@end example
#DESCRIPTION:       
#  @noindent
#  This command is useful 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 split into two subdomains: @code{east} and @code{west}.
#  Also, the                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  