GRIDGEN is a program developed by the United States Geological Survey (USGS) to create unstructured grids to be used in numerical models such as MODFLOW-USG.
The use of unstructured grids has advantages, like the capacity of refining specific areas. However, its design and manipulation is more complicated than in structured grids. The most complex step is the creation of input data, specifically the ones related to cell connectivity. For this reason, GRIDGEN is an useful tool that helps to simplify the process.
The program starts reading a base 3D grid, which can have variable row and column widths and spatially variable cell top and bottom elevations. From this base grid, GRIDGEN will continuously divide into four any cell intersecting user-provided refinement features (points, lines, and polygons) until the desired level of refinement is reached. GRIDGEN will then smooth, or balance, the grid so that no two adjacent cells, including overlying and underlying cells, differ by more than a user-specified level tolerance.
Once these gridding processes are completed, GRIDGEN saves a tree structure file so that the layered quadtree grid can be quickly reconstructed as needed.
With this structure created, GRIDGEN can export the grid as a shapefile, export the connectivity and cell data as text files or intersect the grid with points, lines or polygons shapefiles and save this output intersection as text files or shapefiles.
Also, GRIDGEN reads and writes "definition files", which are text files with the ".dfn" suffix that give instructions and information required by GRIDGEN.
Among these "definition files"; there are blocks that define objects or specific actions. These can be used but not necessary all of them are required in each instance.
GRIDGEN and MODFLOW - USG
GRIDGEN has been designed to create input data for MODFLOW-USG, but it can also be used for other models. It generates the majority of discretization information needed by MODFLOW-USG, including the connectivity between cells and other connection properties, but it does not create the input discretization file for MODFLOW-USG. This one has to be created by other means.
How to visualize the grid
GRIDGEN has a useful tool to export the grid as VTK. In this way, the file can be opened in Paraview.
Find more information about GRIDGEN 1.0 here: https://pubs.usgs.gov/of/2014/1109/pdf/ofr2014-1109.pdf
Lien, Jyh-Ming, Liu, Guilin, and Langevin, C.D., 2015, GRIDGEN version 1.0—A computer program for generating unstructured finite-volume grids: U.S. Geological Survey Open-File Report 2014–1109, 26 p., http://dx.doi.org10.3133/ofr20141109.