Another useful tool included in the distribution is located in /tools/GridGen. This utility can be used for the generation of smoothly distributed grid lines for one coordinate direction. Such smooth grid spaces are required to preserve the second order accuracy of the difference stencils. GridGen uses routines from [6].
GridGen is included in the distribution only for convenience and is not officialy supported. It is distributed as source only, you need a Fortran-77 compiler to build a binary. Since the tool consists of only one source file, this is a straightfoward compile process, e.g. with the Gnu Fortran compiler you would just use g77 GridGen.f -o gridgen which would produce the binary file gridgen.
The necessary parameters for the use of GridGen are explained in table .
value | type | description |
L | int | number of locations where grid spaces should take prescribed values |
x0 | float | locations in increasing order |
: | ||
xL | ||
dx0 | float | prescribed grid spaces at locations x0...xL |
: | ||
dxL | ||
K | int | number of grid lines, which should have exactly some prescribed coordinates |
xe0 | float | locations in increasing order |
: | Note, xe0==x0 and xeK==xL are required | |
xeK | This feature allows to generate meshes, which respect some geometrical constraints | |
fak | float | the grid spaces dx0,..dxL can be multiplied with fak. This allows a simple coarsening / refinement of the computational grid |
"workdir" | string | a directory in which the output files should be written |
GridGen reads these parameters from standard input. If you run GridGen without arguments, it will prompt you for each needed parameter, but it may be be more convenient to put the parameters in a simple text file (just one parameter a line) and run GridGen with the command GridGen < input.dat.
An example file named gg-input.txt is located in tools/GridGen. Running GridGen with this file as input produces a point distribution with a grid spacing of approximately .01295 at the boundary points 0 and 1 and a spacing of approximately 0.0518 around the midpoint.
The results of GridGen are written to the following files:
gridpoints.gnu | contains a numbered list of the gridpoints which can then be used in a scene description file (see section ) |
gridspaces.gnu | this file contains the distribution of grid spaces |
Both files can be plotted by gnuplot to control the results.