Sie sind auf Seite 1von 93

GRID BUILDER

A pre-processor for 2-D, triangular element,


finite-element programs
R.G. McLaren, University of Waterloo

c
R.G.
McLaren
Groundwater Simulations Group

September 18, 2008

ii

Problems?
Authorized users encountering problems with the codes, or requiring specific implementations not supported in this version, are encouraged to contact the author at
the following location for possible assistance.

Waterloo Centre for Groundwater Research


University of Waterloo
Waterloo, Ontario, Canada
N2L 3G1
Telephone:
Extension:
FAX
:
E-MAIL
:

(519) 888-4567
32257 (Rob McLaren)
(519) 746-7484
mclaren@sciborg.uwaterloo.ca

iii

About this manual


The following conventions are used throughout the manual.
Typed commands, filenames and GRID BUILDER prompts are presented in a
typewriter-style font (e.g. run77 gb, INSTALL.BAT, etc.). This includes prompts
and field labels in I/O boxes.
GRID BUILDER menu items and I/O box button labels are presented in a sans
serif font. When listed in sequence, menu and submenu options are separated by
the backslash character /. For example, the instruction choose menu option Generate/Irregular/Import indicates that you should choose the menu option Generate,
which leads to a submenu where you should choose Irregular which leads to another
submenu where you should choose Import.
The following keyboard key indicators are used throughout:
Key Symbol
Enter

Key to be pressed
Return or enter

Esc

Escape

Cursor left

Cursor right

Cursor up

Cursor down

Spc

Spacebar

End

End

F1

F1

F2

F2

F7

F7

iv

Contents
1 Introduction

1.1

Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1.2

Quitting GRID BUILDER . . . . . . . . . . . . . . . . . . . . . . . .

1.3

In the event of trouble... . . . . . . . . . . . . . . . . . . . . . . . . .

2 Grid generation

2.1

Rectangular grids . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.2

Wedge grids . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.3

Layered Grids . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.4

Irregular grids . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

11

2.4.1

Defining grid boundaries . . . . . . . . . . . . . . . . . . . . .

12

2.4.1.1

Using the mouse to define grid boundaries . . . . .

12

2.4.1.2

Retrieving previously saved grid boundaries . . . . .

13

2.4.1.3

Importing grid boundary data . . . . . . . . . . . .

13

2.4.1.4

Importing reference information . . . . . . . . . . .

13

2.4.2
2.5

Modifying grid boundaries and grid generation parameters

14

Regenerating the grid . . . . . . . . . . . . . . . . . . . . . . . . . .

17

3 Grid Checks

19

3.1

Closest nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

19

3.2

Zero area elements . . . . . . . . . . . . . . . . . . . . . . . . . . . .

19

3.3

4 node connections . . . . . . . . . . . . . . . . . . . . . . . . . . . .

20

3.4

Relax grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

20

vi

CONTENTS

4 File Input/Output

21

4.1

Saving grid data . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

21

4.2

Retrieving grid data . . . . . . . . . . . . . . . . . . . . . . . . . . .

22

4.3

Exporting grid data to other applications . . . . . . . . . . . . . . .

23

4.4

Importing foreign grid data . . . . . . . . . . . . . . . . . . . . . . .

23

4.5

Grid-related data . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

24

4.6

Grid-independent data . . . . . . . . . . . . . . . . . . . . . . . . . .

25

5 Special tools

27

5.1

Modifying the screen image . . . . . . . . . . . . . . . . . . . . . . .

27

5.2

Examining grid subregions in detail . . . . . . . . . . . . . . . . . . .

29

5.3

Changing mouse precision . . . . . . . . . . . . . . . . . . . . . . . .

30

5.4

Generating plotted output . . . . . . . . . . . . . . . . . . . . . . . .

30

5.5

Refreshing the screen . . . . . . . . . . . . . . . . . . . . . . . . . . .

31

5.6

Getting general information . . . . . . . . . . . . . . . . . . . . . . .

31

5.7

Changing the current drive . . . . . . . . . . . . . . . . . . . . . . .

31

5.8

Shifting menu position . . . . . . . . . . . . . . . . . . . . . . . . . .

32

5.9

Distance estimator . . . . . . . . . . . . . . . . . . . . . . . . . . . .

32

5.10 Changing the pick mode . . . . . . . . . . . . . . . . . . . . . . . . .

32

5.11 Exporting area boundaries . . . . . . . . . . . . . . . . . . . . . . . .

32

6 Editing grid data

33

6.1

Mesh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

33

6.2

Nodes and related data . . . . . . . . . . . . . . . . . . . . . . . . .

34

6.2.1

Modifying nodal property values . . . . . . . . . . . . . . . .

35

6.2.2

Other considerations . . . . . . . . . . . . . . . . . . . . . . .

37

Elements and related data . . . . . . . . . . . . . . . . . . . . . . . .

39

6.3.1

Other considerations . . . . . . . . . . . . . . . . . . . . . . .

41

6.4

Segments and related data . . . . . . . . . . . . . . . . . . . . . . . .

41

6.5

Boundary condition data . . . . . . . . . . . . . . . . . . . . . . . . .

41

6.3

CONTENTS
6.5.1

1
Other considerations . . . . . . . . . . . . . . . . . . . . . . .

43

6.6

Field data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

44

6.7

Overlay data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

46

6.8

Raster data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

47

6.9

Hydrographs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

50

6.10 Wells . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

51

7 GRID BUILDER Demonstration

53

7.1

Starting GRID BUILDER . . . . . . . . . . . . . . . . . . . . . . . .

53

7.2

Importing grid boundary data . . . . . . . . . . . . . . . . . . . . . .

54

7.3

Changing the mouse precision . . . . . . . . . . . . . . . . . . . . . .

56

7.4

Modifying grid boundary data . . . . . . . . . . . . . . . . . . . . . .

57

7.5

Changing the current directory and prefix . . . . . . . . . . . . . . .

59

7.6

Grid checks and conditioning . . . . . . . . . . . . . . . . . . . . . .

61

7.7

Grid refinement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

61

7.8

Modifying the default plot . . . . . . . . . . . . . . . . . . . . . . . .

62

7.9

Quitting GRID BUILDER . . . . . . . . . . . . . . . . . . . . . . . .

65

7.10 Restarting GRID BUILDER with existing grid data . . . . . . . . .

65

7.11 Assigning element property values . . . . . . . . . . . . . . . . . . .

66

7.12 Examining property values using fills . . . . . . . . . . . . . . . . . .

66

7.13 Generating hardcopy . . . . . . . . . . . . . . . . . . . . . . . . . . .

69

7.14 Defining field data . . . . . . . . . . . . . . . . . . . . . . . . . . . .

69

7.15 Generating node property values using kriging . . . . . . . . . . . . .

69

7.16 Examining property values using contouring . . . . . . . . . . . . . .

70

7.17 Assigning boundary conditions . . . . . . . . . . . . . . . . . . . . .

72

7.18 Importing results from a finite-element program . . . . . . . . . . . .

76

7.19 Importing old grid data . . . . . . . . . . . . . . . . . . . . . . . . .

79

8 References

83

A Importing DXF formatted boundary data

85

CONTENTS

Chapter 1

Introduction
GRID BUILDER allows you to generate a variety of two-dimensional, finite-element
grids. It was designed primarily to produce triangular element meshes but there are
some facilities for producing rectangular meshes.
One of the most time consuming tasks involved when doing finite-element modelling is the preparation, debugging and subsequent refinement of the finite-element
grid. For small problems with a few thousand nodes and elements, this stage in
model development would take days or weeks to finish by hand. Unfortunately, large
grids are often required to satisfy the accuracy requirements of the finite-element
approach, and so access to an automated grid generation procedure becomes critical.
With GRID BUILDER you can reduce the time needed in this step, usually to few
hours at most, even for irregular grids with several thousand nodes.
How does GRID BUILDER do this? Briefly, it presents you with an interactive,
graphical interface for grid creation and manipulation. First, the outer boundary
and any internal grid boundaries can be defined with the mouse or read from a
file. Once the boundaries are defined to your satisfaction, the grid is automatically
filled with triangular elements. You can then, for example, use the mouse to choose
areas of the grid to be refined. There are several other options available through
context-sensitive menus. Because the program is menu-driven, you can move around
quickly, and perform any desired task. During these steps, you do not have to
concern yourself with element or node numbers, because the program handles this
internally and just presents you with a picture of the current state of the grid.
The purpose of this manual is to introduce the general structure of GRID
BUILDER and illustrate its use with a few examples. For help in more specific
areas I will refer you to the on-line documentation, which supplies detailed, contextsensitive help screens while you are running the program. For information about
finite-element methods, I will refer you to any of the basic texts on the subject, for
example Huyakorn et al. [1983] or Pinder and Gray [1977].

CHAPTER 1. INTRODUCTION

1.1

Getting started

The recommended method for running GRID BUILDER is to open a Command


prompt, make the directory in which you want to store your finite-element mesh the
current directory, and then to type the command:
gb
Assuming everything is installed and the program has been started, you will currently have the title screen on your monitor. Press any key or click the mouse on
the OK button and the title screen will be replaced by the Main menu, shown below:

This menu appears at the top left-hand corner of the screen. You should also
see a mouse cursor (white arrow) near the centre of the screen. Usually, each menu
item begins with a unique letter, and one of the items will be highlighted. To pick
a menu item you can either point and click with left or right mouse buttons, type
its first letter or move the highlight with the keys , or Spc and then press
Enter to select the highlighted menu item.
The first time you run GRID BUILDER I would urge you to choose the Help
option. This gives an on-line help screen which explains how you interact with GRID
BUILDER using such things as menus, I/O boxes or the mouse. This general help
screen is the only one which can be accessed from a menu. Many other help screens
are available and can be accessed by pressing the F1 function key. If you press
F1 you will see the Help screen which is specific to the menu, I/O box or mouse
procedure that is currently active.
The first four items in the Main menu (File, Generate, Edit and Check) lead to
submenus which can be accessed to perform specific tasks. The entire set of menus
and submenus which are accessible from the Main menu are referred to as regular
menus. There is another set of menus, which will be referred to as the Tool menus,
which are accessible from any regular menu by pressing F7 or by clicking the left or
right mouse button outside a regular menu. The Tool menu contains options which
need to be easily accessible at any time. For example, the Zoom option allows you
to zoom in on a subregion of the domain and examine it in detail. The Tool menu
pops up near the current location of the mouse cursor and does not have a title so it

1.2. QUITTING GRID BUILDER

can be easily distinguished from the regular menu. The Tool menu procedures are
discussed in detail in Chapter 5.
When you start GRID BUILDER and first enter the Main menu, there will be
no grid information stored in memory. Only those menu options which produce grid
data (Generate or File) or dont require grid data (Help or Quit) are enabled. The
options Edit and Check will be enabled when you have a grid in memory.

1.2

Quitting GRID BUILDER

Quit allows you to exit GRID BUILDER. It is included to avoid accidentally exiting
the program and losing data. Should you choose this option, the following prompt
will appear:
Are you sure you want to quit? Yes/No
If you answer yes, and if there is grid data in memory which has not been saved
to disk the following prompt will appear:
Save changes to grid? Yes/No
If you answer yes you can save the information in the normal manner. If you
say no, you will exit to DOS and any current changes to the grid will be lost.

1.3

In the event of trouble...

In some cases (e.g. GRID BUILDER is unresponsive or taking too long to perform
a task) you may wish to halt execution and start over.
In Windows 2000 or XP press Ctrl-Alt-Delete, choose Task Manager/Applications
and then choose GRID BUILDER and End Task.

CHAPTER 1. INTRODUCTION

Chapter 2

Grid generation
The menu option Generate leads to a submenu with four options, which represent
the basic types of grids which can be generated with GRID BUILDER. The procedures for generating the different grid types are discussed below. We will start our
discussion with the simple grid generation options Rectangular, Wedge and Layered
and then move on to the more complex procedures associated with the Irregular grid
generation option.
You may find it helpful to run the appropriate sections of GRID BUILDER as
you read about them in the following chapters. Many of the procedures are discussed
in detail in the on-line help screens so you should examine these if you have any
problems. They can be accessed by pressing the F1 key while in a menu or I/O
box or when the mouse is active.

2.1

Rectangular grids

Many simple, conceptual problems can be simulated using a rectangular grid. The
option Generate/Rectangular/Uniform spacing presents an I/O box in which you specify the title, range (minimum and maximum in X and Y) of the rectangular domain,
number of nodes in each direction and numbering scheme (e.g. along Y first). An
I/O box is a window which appears on-screen, and contains a number of fields in
which you can enter the required text or numeric data. See on-line help for further
details. Once these input parameters are supplied, a simple, rectangular grid is
generated. An example is shown in Figure 2.1. Nodes are numbered starting at the
bottom left-hand corner and moving up the left-most column parallel to the y-axis.
The option Generate/Rectangular/Variable spacing reads x and y grid line coordinates from a file and then automatically generates the grid. When you choose this
option you are presented with a menu made up of files in the current directory with
the extension .GLINES. Here is an example of a file which defines 5 grid lines in x
and y.
7

CHAPTER 2. GRID GENERATION

Figure 2.1: Example grid generated by Generate/Rectangular/regular

2.2. WEDGE GRIDS


NX

NY

5
910722.00
910839.50
5
6891334.5
6891372.5
6891422.5
6891472.5
6891522.5

910739.50
910889.50

910789.50

The first line defines the number of grid lines in x, and then the x coordinates
are listed in order from smallest to largest. The file is read in free format mode so
one or more coordinates can be given per line.
NOTE: Frac3dvs/HydroGeoSphere users should know that the format of the
xy glines .dat file is the same as that generated by Frac3dvs/HydroGeoSphere
when they write grid line information to the .eco file when the instruction Generate
blocks interactive is used. So you can use these programs in conjunction with GRID
BUILDER to generate rectangular meshes with regions of graded mesh refinement.

2.2

Wedge grids

Wedge grids are useful for simulating systems which are radially symmetric (e.g.
flow to a pumping well).
The option Generate/Wedge presents an I/O box in which you specify the title,
inner and outer radius, number of degrees of arc, and the number of nodes along
the edge and arc. Once these input parameters are supplied, a wedge-shaped grid
is generated. An example is shown in Figure 2.2.
This grid is really just a deformed, rectangular grid (i.e. node numbering patterns are similar to a regular rectangular grid). In most situations, wedge grids can
be limited to 2 or 3 nodes around the arc, since the problem is radially symmetric.
For flow to a well, the inner radius is usually taken to be the well radius, while the
outer radius could be extended so that a Theis-type aquifer (infinite areal extent) is
represented. As long as pumping effects do not reach the outer boundary this holds
true.

2.3

Layered Grids

This grid type was originally developed to facilitate the generation of finite-element
meshes for cross-sections which were constructed from borehole data. This type of
problem could also be handled in a more general way using the Generate/Irregular/Cross-section option.

10

CHAPTER 2. GRID GENERATION

Figure 2.2: Example grid generated by Generate/Wedge

2.4. IRREGULAR GRIDS

11

Figure 2.3: Example grid generated by Generate/Layered


NOTE: This option was restored from an old version of GRID BUILDER and
so the I/O boxes have not been updated and will behave and appear a bit strange.
The option Generate/Layered uses a series of I/O boxes to supply the input
parameters. The domain is defined by a number of control points and layers. A
control point is like a borehole in a cross-section, for which layer elevations are
known. For each control point, the base elevation, layer top elevations and element
length to the next control point are required. Finally, the number of nodes across
each layer is required. Once these input parameters are supplied, a layered grid is
generated. An example with 2 layers and 3 control points is shown in Figure 2.3.
For comparison, we generated the rectangular, wedge and layered grid examples
with approximately the same dimensions and number of nodes in the X and Y
directions.

2.4

Irregular grids

One of the most useful features of GRID BUILDER is its ability to generate irregular finite-element grids. These types of grids are necessary in a host of 2-D
finite-element problems where complex geometry (e.g. a real watershed boundary)
is encountered. As opposed to finite-difference techniques in which irregular bound-

12

CHAPTER 2. GRID GENERATION

aries are incorporated by making elements lying outside the region of interest inactive, the finite-element technique only defines the mesh inside the boundaries of the
region of interest. This can result in a significant reduction in the size of the arrays
required to solve a given problem. Another advantage of the finite-element method
is that grid refinement can be a local feature without affecting distant portions of
the mesh.

2.4.1

Defining grid boundaries

The first step in generating an irregular grid is to define the geometry of the outer
(and inner if required) grid boundaries. The option Generate/Irregular leads to a
submenu with three choices, two of which (Plan-view and Cross-section) allow you
to interactively define the boundaries using the mouse. The third, Import, leads to
a submenu which allows you to read previously defined or digitized boundaries or
read an overlay which can be used as a reference during grid generation.

2.4.1.1

Using the mouse to define grid boundaries

The first two options; Generate/Irregular/Plan-view and Generate/Irregular/Crosssection, present an I/O box in which you specify the title, range (minimum and
maximum in X and Y) of the domain and the desired element length (which affects
the size of the elements generated). Once the values are supplied, the screen will
be scaled automatically and you will enter the procedure which allows you to define
the outer boundary interactively using the mouse. Isotropic scaling in X and Y is
always maintained in the Plan-view option, while in the Cross-section option, vertical
exaggeration is allowed.
Generally, when the mouse is active, a window will appear in the upper left-hand
corner of the screen which contains the coordinates of the current position of the
mouse cursor. The precision of the coordinates can be altered with the Tool menu
option Mouse. For example, for a particularly large problem, you might want mouse
coordinates to be rounded to the nearest 10 metres. Note that while the mouse is
active, the Tool menu cannot be accessed. You will have to exit the mouse procedure
and then activate the Tool menu.
The disadvantage of defining node coordinates with the mouse is that the returned values change in discrete jumps, which are a function of the screen resolution,
therefore the exact coordinate at which you wish to define a node may not be available. If this is a problem, you can either correct the locations later using the Move
option (which allows keyboard input), or try importing the boundary information
in a .DIG file, which is described in section 2.4.1.3. In the file you can define the
node locations exactly.

2.4. IRREGULAR GRIDS


2.4.1.2

13

Retrieving previously saved grid boundaries

The option Generate/Irregular/Import/Boundary .GEN is used to retrieve previously


defined grid boundary data, which was stored in a .GEN file using the Save .GEN
menu option in the Gen Edit menu, which is described in Section 2.4.2. When you
choose this option you are presented with a menu made up of files in the current
directory with the extension .GEN. See Section 4.2 for detailed information about
retrieving files. Once they are retrieved, the boundary data can be altered as desired,
and a new grid can be generated.

2.4.1.3

Importing grid boundary data

The option Generate/Irregular/Import/Digitized .DIG is used to import a file of digitized (or manually generated) boundary node information. When you choose this
option you are presented with a menu made up of files on the current directory with
the extension .DIG. See online help for a description of the file structure. An example of such a file can be found in gridbldr\demo\bnds.dig, which can be examined
with a text editor.
Once you choose a file the outer boundary will be drawn on-screen, followed by
any internal boundaries. This boundary data is treated in a way similar to that
generated using the mouse, so the rules which apply there also apply here (see online help for details). For example, the outer boundary should be defined first, and
any internal boundaries should start and end by crossing an existing boundary.

2.4.1.4

Importing reference information

The option Generate/Irregular/Import/Overlay .OVR is used to import a file of digitized (or manually generated) graphical reference information (e.g. a watershed
boundary). The file structure is identical to a .DIG file. An example can be found
in gridbldr\demo\waterloo moraine.ovr, which can be examined with a text editor. When you choose this option you are presented with a menu made up of files
on the current directory with the extension .OVR.
Once you choose a file the reference information will be be drawn on-screen.
Since this data is not used to define grid boundaries, none of the normal rules apply
and you are free to enter it in any way you see fit, as long as you adhere to the proper
file format. The screen will be scaled to accomodate the reference data. Whether
the system is treated as plan-view or cross-sectional is determined by the value of
the true/false switch on the second line of the .OVR file. You will then be asked if
you want to read a previously saved .GEN file or define the outer boundary using
the mouse.

14

CHAPTER 2. GRID GENERATION

2.4.2

Modifying grid boundaries and grid generation parameters

Once the grid boundaries have been defined, control passes to the Gen Edit menu
which allows you to manipulate and save the grid boundaries and grid generation
parameters. The menu options are described below:
Cut Subdivide the current grid areas by defining a new internal boundary. New
nodes are created by a mouse click or by the intersection of the new boundary
and an existing boundary. The situation sometimes arises where a new node is
extremely close to an existing node. This can be remedied with the Fix option,
described below. Some useful tips are outlined below:
If you want to insert a new node on a boundary segment, you can do so
by cutting a single line segment across the boundary (i.e. by defining 2
nodes). This will insert one node at the intersection point.
If a cut ending inside an area has more than 1 node inside that area, it
will be extended to the area boundary automatically.
If you want to define an interior node at a specific location (e.g. for a
pumping well in a two-dimensional flow simulation) you should define it
as part of a cut.
Move node Pick a node with the mouse and move it to a new location. You can
enter exact coordinates from the keyboard should you so desire.
Parameters This option is used to modify the three grid generation parameters:
target element length, stretch factor and node drop rate as explained below.
It leads to the following submenu:
Info This option allows you to click the mouse inside an area to find out the
current values for target element length, stretch factor and node drop
rate.
Single area Click the mouse inside an area to open a dialogue box which allows
you to modify the target element length, stretch factor and node drop
rate. The target element length specifies the target size of the elements to
be generated. This is a guide only, final element sizes may vary somewhat.
Stretch factor controls the aspect ratio of elements in zones of transition
from fine boundary elements to larger target elements while node drop
rate controls the frequency at which nodes are removed as we go from
fine to coarse elements.
Multiple areas This option allows you to choose one or more areas and modify
the target element length, stretch factor and node drop rate. Area numbers are shown on-screen at the area centroid. White numbers indicate
that the area is not chosen, while yellow numbers indicate a chosen area.
The following submenu allows you to change which areas are chosen:
Flip Reverses the current state of each area.

2.4. IRREGULAR GRIDS

15

Off Turns all areas off (i.e. they are not chosen).
Area Click the mouse in an area to reverse its current state.
Hole Assign an area as a hole and do not generate elements in that area. The
area should not touch the outer boundary or be adjacent to another area
which is made into a hole.
Fix interactive This leads to a submenu which allows you to interactively eliminate
boundary nodes which are too close together. This often occurs when making
a cut or when importing digitized boundary data. When entered, the two
nodes at the ends of the shortest boundary segment are shown, one blue and
one yellow. You can cycle through all the boundary segments or press Esc
at any time to return to the Gen Edit menu.
The Fix submenu options are as follows:
Info For the blue and yellow nodes, show the node number, X- and Y-coordinate
and the distance separating them. Press any key to remove the window.
Blue Keep the blue node and delete the yellow node.
Yellow Keep the yellow node and delete the blue node.
Average Create a new node halfway between the blue and yellow nodes and
delete the blue and yellow nodes.
Skip Leave the blue and yellow nodes as they are.
Zoom Zoom in on the region around the blue and yellow nodes.
Undo Restore the boundaries as they were prior to the last fix
Fix batch This option allows you to automatically eliminate boundary nodes which
are closer together than a defined tolerance. A dialogue box allows you to
enter the minimum segment length (i.e. tolerance)
Refine boundary This option allows you to choose a subset of nodes using the procedure described in Section 6.2.1. Once you exit the procedure, a dialogue
box allows you to enter the element length to apply to any boundary sections
which lie bewteen the chosen nodes. If you want different section to have
different element lengths, they must be defined one at a time.
Fill boundary This option generates nodes along the outer and inner boundaries
using the current set of grid generation parameters.
Disconnect boundary nodes This option allows you to disconnect nodes along a portion of a subarea boundary. This could be used, for example, to prevent
surface water from flowing across the boundary where the nodes have been
disconnected.
You must choose a subset of at least 3 nodes which are contiguous and located
on a single subarea boundary. The nodes located between the two end nodes
are duplicated, and element lists are modified so that elements on one side of
the disconnected boundary contain the original nodes, while elements on the
opposite side contain the duplicate nodes.

16

CHAPTER 2. GRID GENERATION

Undo This option restores the grid boundary state to what it was before the last
action. It only works for options located above Undo in the Gen Edit. For
example, if you executed the Fix Batch option and the results were not satisfactory, you could restore the grid boundaries as they existed prior to the
operation and try again.
Do Generate the triangular finite-element grid. If the boundary information has not
been saved you will be prompted to do so before grid generation begins. You
should see GRID BUILDER fill each area with triangular elements. One of
the most common problems at this stage is that GRID BUILDER slowly fills
the grid with tiny elements. This is most likely because you specified a small
element target length. You can either let the program proceed or try halting it
by pressing the Ctrl-Pause/Break. This should exit the program and put you
in the debugger window, which can be exited by pressing Shift-F1. Hopefully,
you saved the boundary data in a .GEN file. If you did, you can retrieve it
with Generate/Irregular/Import Boundary .GEN and increase the element target
length before you generate it again.
No Grading This menu item indicates the current element size grading scheme in
effect. The default No grading indicates that uniformly sized elements will be
generated.
Choosing this option will change the menu item to Grading, and activate the
element size grading feature. It leads to a submenu which allows you to enter
element grading factors, which are similar to field data points (see section 6.6).
Grading factors are used in conjunction with the target element size to generate
elements of a certain size. For example, if the target size is 10, a grading factor
of 0.1 would generate elements of size 1 in that region, while a grading factor of
2.0 would generate elements of size 20. If you subsequently choose the Grading
option, you will be presented with the prompt
Edit grading factors or disable grading? Edit/Disable
Choose disable to resume generating uniformly sized elements. The menu
option will return to No grading.
Save .GEN Save the current grid boundary data and generation parameters in a
.GEN file. See Section 4.1 for detailed information about saving files. When
the grid boundaries are defined to your satisfaction, I would advise you to save
the data before you proceed to generate the grid. This will allow you to return
to this point in the grid generation process at a later time.
Node info Obtain information about a specific node, such as the X and Y coordinate.
You will be prompted as to whether you want to choose nodes with the mouse
or by entering a node number. The mouse is most commonly used to pick
nodes but if you have a node number and do not know its exact location you
can use the latter method to find it quickly. When you pick a node, a window
appears which contains information specific to that node.

2.5. REGENERATING THE GRID

17

Area info Obtain information about a specific area, such as area number and grid
generation parameters target length, stretch factor and node drop rate. You
will be prompted as to whether you want to choose areas with the mouse or
keyboard. The mouse is most commonly used to pick areas but if you have an
area number and do not know its exact location you can use the latter method
to find it quickly. When you pick an area, a window appears which contains
information specific to that area.

2.5

Regenerating the grid

Once a grid has been generated using one of the three Generate options, you will be
presented with the prompt
Regenerate? Yes/No
If you say yes you can alter the grid generation parameters and regenerate the grid.
In the case of the Rectangular, Wedge and Layered options you are returned to the
I/O box where you can alter the appropriate parameters. In the case of the Irregular
option you are returned to the Gen Edit menu where you can make the appropriate
changes. Once you get the grid the way you want, you should answer no to the
Regenerate... prompt. You will be returned to the Main menu where you can save
or edit the grid and its associated files.

18

CHAPTER 2. GRID GENERATION

Chapter 3

Grid Checks
Some general grid checking options can be performed from the Check menu.

3.1

Closest nodes

The option Closest nodes leads to a submenu which allows you to investigate nodes
which are potentially too close together. When entered, the two nodes which have
the shortest separation distance are shown, one blue and one yellow. You can cycle
through all the node pairs using Skip or press Esc at any time to return to the
Edit/Check menu.
The Closest nodes submenu options are as follows:
Info For the blue and yellow nodes, show the node number, X- and Y-coordinate
and the distance separating them. Press any key to remove the window.
Skip Move on to the pair of nodes with the next shortest separation distance.
Zoom Zoom in on the region around the blue and yellow nodes.
Relax nodes Each of the two closest nodes are moved to the centroid of the nodes
to which they are connected. Nodes lying on a boundary (outer or inner) are
not moved.

3.2

Zero area elements

The option Zero area elements looks for elements with area less than or equal to
zero. If there are any such elements, a message window will indicate this and a list
of the element numbers will be written to the file prefix.chk.
19

20

3.3

CHAPTER 3. GRID CHECKS

4 node connections

If so desired, nodes which are only connected to 4 neighbours can be deleted if they
do not define a break in a boundary. The 4 elements connected to the node will be
reduced to 2 elements.
Such nodes are flagged with filled blue circles as the procedure is carried out,
and the final result can be plotted using the option Tool/Refresh.

3.4

Relax grid

Evenly distribute all nodes in the grid by moving each node to the centroid of
the nodes to which it is connected. Nodes lying on a boundary (outer or inner)
are never moved. In some cases, particularly around sharp corners on an interior
boundary, this operation may result in a corrupt grid (elements may overlap). Also,
smoothing of a rectangular or wedge grid may give undesirable results. Therefore,
you are strongly advised to save any grid information prior to smoothing.

Chapter 4

File Input/Output
As you build a finite element model of a physical system, GRID BUILDER creates
many files to store various types of data. These files are linked together with a common prefix, and are differentiated using unique extensions and descriptors. General
I/O operations can be performed from the File menu but it should be noted that
there are other types of files which can be saved and retrieved from other submenus.
These other files are discussed briefly in section 4.5.

4.1

Saving grid data

The option File/Save .GRD allows you to save grid data in a format which can
be retrieved later by GRID BUILDER. When performing this and other file save
operations (e.g. the Save .GEN option in the Gen Edit menu) you will be presented
with an I/O box which allows you to enter a prefix, with the current prefix used
as the default. Once you enter a valid prefix, it will become the prefix for all file
naming operations.
If you supply a prefix of a set of files which exist in the current directory, you will
be asked whether you want to overwrite them or not. If not, you will be prompted
to enter a new prefix.
The directory you are in when you start GRID BUILDER automatically becomes
the current directory, which is where GRID BUILDER reads and writes all files. The
current directory is shown below the prefix in the I/O box, and can be changed if
desired using the Change directory button. Should you wish to change the default
drive, you will need to do so using the instructions outlined in Section 5.7.
Besides creating a .GRD file, there are other associated files created by this operation for which GRID BUILDER assigns certain file extensions. The extensions
and contents of these files are:
21

22

CHAPTER 4. FILE INPUT/OUTPUT


EXTENSION
.grd
.xyc
.in3
.seg
.gbc
.ean
.bni

CONTENTS
General grid data
Nodal x-, y-coordinates
Triangular element node list
Line segment node list
Node, element, segment and
boundary condition data
Element area numbers
Area information and boundary node lists

FORMAT
ascii
binary
binary
binary
binary
binary
binary

Most of these files are saved using binary format (also referred to as unformatted). Internally, GRID BUILDER uses binary files to store most of the data. These
are smaller and more efficient than ascii files. However, if you wish to view the files
(using a text editor), transfer the files to another platform (e.g. Unix workstation)
or import them to another program, they can be converted to ascii format using the
instruction File/Export/All to ASCII format described in Section 4.3.

4.2

Retrieving grid data

File/Get .GRD allows you to retrieve GRID BUILDER grid data which was stored
previously using the option File/Save .GRD. It reads all associated files as discussed
in section 4.1.
Any time you execute this or other file read operations which show a default
file extension (e.g. Generate/Irregular/Import/Boundary .GEN) you will be presented
with a context-sensitive menu of files to choose from. In this case they will have the
extension .GRD. The entries in the menu are the files in the current directory which
match the extension type, and any subdirectories in the current directory. If there
are no files with the appropriate extension found in the current directory, you can
change directories by clicking the mouse on any given subdirectory or {..} (i.e. the
parent directory to the current directory). In this menu you are limited to changing
directories on the current drive only. To change drives, you must do so as described
in section 5.7.
You can pick a file with the mouse or by highlighting the appropriate one with
the keys , or Spc and then pressing Enter . Alternatively, you can type
the first letter of a file name, and GRID BUILDER will immediately read that file,
providing the first letter is unique. If the first letter is not unique, you will jump to
the first file in the menu which begins with that letter, and that file will be read.
If you pick a file, the file descriptor becomes the current prefix, and will be
presented as the default (with the appropriate extension) in any subsequent file
read/write operation, such as File/Save .GRD.

4.3. EXPORTING GRID DATA TO OTHER APPLICATIONS

4.3

23

Exporting grid data to other applications

By using the File/Export/All to ASCII format option, files generated by GRID BUILDER
can be read directly by a finite-element program which has appropriately formatted
read statements, even if they are running on other platforms (e.g. UNIX). You can
also create your own intermediate programs which read these files and write them
out in a format which is compatible with a third-party program.
In this version of GRID BUILDER, File/Export leads to a submenu with these
options:
GMS Mesh .2DM This option can be used to write the current 2D mesh to a file
which is compatible with the Department of Defense Groundwater Modelling
System (GMS) software. The file name used to store this information is generated from the current prefix and the extension .2DM.
Element node lists are written as triangles unless the option Edit/Mesh/Treat
as rectangles (see Section ??) has been chosen, in which case they are written
as rectangles.
Tecplot This option can be used to write the current 2D mesh to a file which is
compatible with Tecplot software. The file name used to store this information
is generated from the current prefix, current nodal property name and the
extension .tec.dat.
Element node lists are written as triangles unless the option Edit/Mesh/Treat
as rectangles (see Section ??) has been chosen, in which case they are written
as rectangles.
OB as .dig file This option writes out the x and y coordinates of the outer boundary
in .DIG file format. The file name used to store this information is generated
from the current prefix and the extension _ob.dig.
OB ordered node list This option writes out the list of node numbers in counterclockwise order around the outer boundary. The file name used to store this information is generated from the current prefix and the extension _ob.ordered_node_list.
All to ASCII format This option writes a copy of each file with the current grid prefix
to an ascii file whose name is made of the original name with the string ascii_
preceding the file extension. For example, mygrid.xyc is written in ascii
format to mygrid.ascii_xyc and mygrid.nprop.nodal property is written
in ascii format to mygrid.ascii_nprop.nodal property.

4.4

Importing foreign grid data

The menu option File/Import allows you to import triangular finite-element grid data
from other programs GRID BUILDER. It leads to a submenu with these options:

24

CHAPTER 4. FILE INPUT/OUTPUT

Lists .IMP This option reads 2-D grid data created by the user. The file name used
to store this information must have the extension .IMP.
If you have used finite-element programs in the past and have problems for
which detailed grids have already been defined, you can import these grids
into GRID BUILDER and use them without further modification. The online help provides a detailed discussion of how to set up the .imp file. There
is also an example which you can examine in gridbldr\demo\agrid.imp.
GMS .2DM This option reads 2-D grid data created by the Department of Defense
Groundwater Modelling System (GMS) software. The file name used to store
this information must have the extension .2DM.

4.5

Grid-related data

There are certain types of data in GRID BUILDER which are associated with
the grid that is currently in memory. For example, while you are running GRID
BUILDER, room is set aside in the computer memory for one set of node property
values. This conserves computer memory but means that in order to work with
multiple sets of property values, we have to be able to save and retrieve them from
disk. In order to keep track of these files, GRID BUILDER uses a special name
which is composed of the current prefix, the extension .nprop. and a descriptor.
The extension indicates what type of data the file contains, and the conventions
used are:
EXTENSION
.nprop.
.nchos.
.eprop.
.echos.
.evec.
.bc.

CONTENTS
Node property data.
Chosen node data.
Element property data.
Chosen element data.
Element velocity vector data.
Boundary condition data.

Once you define a grid, GRID BUILDER will scan the contents of the current
directory to find the files which are associated with the current prefix and have the
appropriate extension (i.e. if reading a nodal property files with extension .nprop.
are found). The user is then presented with a menu composed of the file-specific
descriptors. These descriptors are usually defined by the user during the file save
operation.
Because GRID BUILDER scans the current directory each time a read operation on a file is performed, the user can manipulate the file names (e.g. in Windows
Explorer) and any changes will be immediately reflected in the list of found descriptors. For example, to remove a file from the list of nodal property files associated
with a specific grid, just rename it so that the prefix or extension do not match
the required values. For example, a file called mygrid.nprop.topography could be

4.6. GRID-INDEPENDENT DATA

25

renamed either agrid.nprop.topography or mygrid.nprop_old.topography and


its descriptor would no longer be picked up by the read operation.
There are many other output files in which the extensions and descriptors are
generated automatically by GRID BUILDER (or by a separate application) when
the file is written. For example, the option Edit/Boundary/Export creates a file name
using the current prefix, the extension .bc_exported. and the current boundary
condition descriptor (e.g. mygrid.bc_exported.boundary data).

4.6

Grid-independent data

Some data are more general in nature and are not associated with a specific grid. For
example, ground surface elevation may be collected at a set of arbitrary locations
defined by x and y coordinates. Such data can be used by GRID BUILDER to
generate a set of node elevations for a finite-element mesh, but the data itself is not
associated with a specific grid. In this case we store the data in a file whose name
does not contain the current prefix.
There are currently three types of files which contain such data whose names
are made up of a descriptor and an extension. The extension indicates what type
of data the file contains, and the conventions used are:
EXTENSION
.fld
.ovr
.asc
.wel

CONTENTS
Field data values.
Overlay data.
Raster data (e.g. DEM Digital Elevation Model data).
Well data.

So for example, our ground surface data could be stored in a file called topo.fld.
When asked to load a specific type of data, GRID BUILDER will scan the
contents of the current directory to find all files which have the appropriate extension
(i.e. if reading a field data files with extension .fld are found). The user is then
presented with a menu composed of the file-specific descriptors.

26

CHAPTER 4. FILE INPUT/OUTPUT

Chapter 5

Special tools
The Tool menu contains options which you can access from any regular menu by
pressing F7 or by clicking the left or right mouse buttons outside a regular menu.
The options available in the Tool menu are discussed below. While in the Tool
menus, pressing the left or right mouse buttons outside the menu is equivalent to
pressing the Esc key, and causes you to exit the current menu.

5.1

Modifying the screen image

The Tool menu option Plot leads to a submenu which allows you to modify the
graphic information which is shown on the screen. The screen image is composed
of a number of objects which can be manipulated in various ways. The submenu
options are described below:
Size Change the size of the screen image. It presents a rubber box which is controlled
by moving the mouse and is initially sized to reflect the extreme extents of
the current mesh. Because of this using the option while you are zoomed in
on a subregion of the mesh is not recommended. In plan-view grids, isotropic
scaling between X and Y is maintained so that no distortion occurs. For crosssectional grids horizontal movement controls X scaling and vertical movement
controls Y scaling.
All objects are affected by the change, but text aspect ratios are maintained
in spite of changes in the X/Y scaling factor ratios.
Although changes in size are automatically reflected in plotted output, you
should be aware that there are other options which can be used to scale the
plotted output when it is generated (see section 5.4).
Move mesh Change the position of the screen image. Click the mouse inside an
element and drag it to make a rubber band line and element appear. Position
the mesh as desired and release the mouse button.
27

28

CHAPTER 5. SPECIAL TOOLS


All objects are affected by this option.
Although changes in position are automatically reflected in plotted output, you
should be aware that there are other options which can be used to position
the plotted output when it is generated (see section 5.4).

Flags Presents a submenu where each menu item represents a plot object which can
be toggled on or off (i.e. drawn or not drawn). An item whose toggle is on will
be highlighted with an asterisk to the left of the object name. You can toggle
the option on or off by clicking on it with the mouse. Alternatively, you can
move up and down with the cursor keys and turn a flag on or off by pressing
F2 . The screen will be re-plotted with the new set of items when you exit
the Plot Flags submenu.
Areas Spawns a submenu which controls the plotting of individual grid area boundaries. The option Plot Areas All can be used to toggle on (ie. plot) all area
boundaries. Plot Areas Pick is used to pick individual area boundaries to toggle
on or off. This can be useful, for example, if you want to show an isolated area
(e.g. a lake) without showing the surrounding area boundaries. Note that to
get a segment of area boundary to disappear, it is necessary to toggle off the
area boundaries on each side of the segment.
X-axis, Y-axis Change the parameters which control the position and appearance
of the axes. They each produce an I/O box which allows you to modify the
desired parameters.
Each axis is plotted from a start value to an end value and tick marks and
labels are controlled by an increment value.
Titles, Our name, Date These three options each produce I/O boxes which allow you
to edit, position, size and toggle (ie. on or off) the appropriate object.
Changing the company name (ie. with Our name) from this menu affects
this set of grid data only. In order to change the default company name
for all subsequent grids you should alter the name as it appears in the file
\GRID\GRIDBLDR.CNF. You can do so using an appropriate text editor.
A changed date will only remain in effect for the current session of GRID
BUILDER. The current date (as set with the DOS DATE command) will be
used as the default the next time you start GRID BUILDER.
Colours Changes the colour of individual plot objects. On the screen you will see
a menu which contains the list of objects whose colours can be changed and
a matrix of available colours to choose from. When you choose an object, its
name will be plotted over the colour matrix, and its current colour will be
outlined. Simply click the mouse on the new desired colour. The screen will
be re-plotted with the new colours when you exit the Plot/Colours submenu.
Palette Change the colour palette used when colour contouring or colour filling
node or element property values. On the screen you will see a submenu, a

5.2. EXAMINING GRID SUBREGIONS IN DETAIL

29

matrix of available colours and colour numbers, and a colour bar showing the
current palette. The size of the matrix shown is dependent on the capabilities
of your graphics card and the current Interacter settings. It will contain 16
colours for Windows 95/NT colour palettes of 256 colours or less (see display,
colors, changing the number of in Windows 95 Help Index) and 256 colours
for Windows 95 High color or True color settings
The submenu, which allows you to modify the current palette, has the following
options:
Manual Specify the palette start and end colour numbers manually.
Reverse Reverses the start and end numbers of the current palette.
Greyscale Set the palette start and end numbers to 208 and 255 respectively,
which corresponds to the greyscale portion of the default palette. If you
load a custom palette these numbers may no longer be meaningful.
Tecplot .MAP Reads colour palette information which is in Tecplots colourmap
format. These files can be produced by Tecplot. There are a few samples
palettes in the CMAPS directory.
The screen will be re-plotted with the new colours when you exit the Plot/Palette
submenu.
General allows you to change character size factor for all plotted text, the size of
plotted nodes and the general numeric format for numbers presented in I/O
boxes.
White BG Change the background screen colour to white and change this option to
Black BG. Many plot objects which are by default white are changed to black.
If the default colours of these plot objects has been changed they will be lost
if the user reverts back to a black background.

5.2

Examining grid subregions in detail

The Tool menu options Zoom +/- and Restore allow you to examine subregions of
the mesh in greater detail and then restore the view to its default state. This is
useful if you want to see a region where the elements are very small or when you want
to check node or element numbers which, at the normal scale, are often obscured
because of overlap.
When you choose Zoom +/- you are in effect activating the mouse buttons so
that the view is zoomed in (left button) or out (middle mouse button or scroll wheel
if present) by a factor of 2 if pressed. Also, a zoom rectangle can be activated by
dragging the mouse while holding down the left button.
The zoomed view remains in effect until you execute the Restore option, even if
you return to the regular menus. This aids in refining finely discretized grid regions.

30

CHAPTER 5. SPECIAL TOOLS

Note that if you do grid refinement while zoomed in, chosen elements may lie offscreen. Therefore it is advisable to first execute the option Edit/Element/Pick/Off.
When you zoom, the plot will be clipped to leave an empty border and the axes will
be redrawn so that they lie on the screen. The axis start, end and increment values,
as well as the placement values are temporarily altered. Once the grid is restored
to full-screen, the original axes are re-drawn. Therefore, any modifications made to
the axes while you are zoomed in will be lost.
The option Plot/Move mesh can be used to pan the zoomed subregion up, down,
left or right.

5.3

Changing mouse precision

The Tool menu option Mouse can be used to alter the precision of the X- and
Y-coordinates returned by the mouse. A cycling menu is presented with options
ranging from 0.00001 to 10000.0 units. You can cycle through the choices using the
or keys and press Enter to make your choice.

5.4

Generating plotted output

The Tool menu option Hardcopy can be used to modify the graphical output generated by GRID BUILDER. It produces a submenu with the following options:
Adjust Produces an I/O box which can be used to change the output driver and
the size and position of the plotted output with respect to the screen. There
are currently five output drivers available; normal Postscript, encapsulated
Postscript, HP-GL, raster image and DXF. You can alter three parameters
which allow you to scale and shift (up/down and left/right) the plotted output
in relation to the screen output. Although shifting the plot on the screen using
Plot/Move is reflected in the plotted output, it is preferable to leave the screen
contents centered, and align the plotted output with Plot/Hardcopy/Adjust.
Default plotter adjust data is stored in the file \GRID\GRIDBLDR.CNF. This data
is used every time you run GRID BUILDER and generate a grid. Depending
on the peculiarities of your plotter (such as where you place paper etc.) you
may want to adjust these parameters (by editing the file with a text editor)
and then use them on all subsequent plotted output. However, there may be
individual cases in which you will want to change these values. You can do
so (in the input box), and the new values will automatically be saved in the
.GRD file and used whenever plotted output for that specific grid is generated.
File Sends the output to a file in the current directory. The name of the file depends
on how many plots have been sent to file in the current session and which
output driver is currently being used. The prefix PICnn is initially set to PIC1

5.5. REFRESHING THE SCREEN

31

and is incremented each time a file is produced. If you restart GRID BUILDER
the counter will be reset to 1, and earlier files with the same extension will
be overwritten. The extensions depend on the current hardcopy output driver
and are as follows:
EXTENSION
.HP
.PS
.EPS
.PCX
.DXF

CONTENTS
HP-GL
Normal Postscript
Encapsulated Postscript
Raster Image
Autocad DXF format

Plotter Outputs the plot commands directly to the plot-device which is connected
to the port which is set with a plotter statement in the INTERACT.INI file.
See Appendix ?? for details. Be careful to send output to a device with the
appropriate driver.

5.5

Refreshing the screen

The Tool menu option Refresh cause the screen to be re-drawn.

5.6

Getting general information

The Tool menu option Info outputs general information to the screen. There are
two columns on the right-hand side of the screen called CURRENT and MAXIMUM. Under these headings are the current and maximum (dimensioned) value of
the property if appropriate (e.g. number of segments). This information includes
the number of nodes and node property files, bandwidth, number of elements and
element property files, node connections, grid areas, colour fills, boundary nodes,
field data files, field data points, menu files and the current directory and prefix.

5.7

Changing the current drive

The option Change drive presents a menu made of the drive letters available on your
computer, excluding drives A: and B:, which are normally reserved for floppy drives.
When you choose a drive letter the root directory on that drive will become the
current directory. You can then use any file save or retrieve option to navigate to
the desired directory.

32

5.8

CHAPTER 5. SPECIAL TOOLS

Shifting menu position

The Tool menu option Shift Menus allows you to move the regular menus to some
location other than the default (top left hand corner). Just click the mouse in the
desired position and the menu will be re-drawn.

5.9

Distance estimator

The Tool menu option Distance can be used to output the distance between two
points. When active, a window will show the current mouse XY coordinates. Move
the mouse to the starting point a click once to anchor one end of a rubber line.
Move the mouse to the end point and click again to output the distance between
the endpoints of the rubber line.

5.10

Changing the pick mode

The Tool menu option Pick mode can be used to change the way that grid components (e.g. nodes) are chosen. It produces a submenu with the following options:
Toggle When choosing grid components (e.g. Edit/Node/Pick) the current state of
the component (i.e. chosen vs not chosen) is toggled (i.e. switched to the
other state).
Off When choosing grid components the current state of the component is set to be
not chosen.
On When choosing grid components the current state of the component is set to be
chosen.

5.11

Exporting area boundaries

The Tool menu option Area bn as .DIG prompts the user for an area number. Note
that you can get area numbers using the Edit/element/info/mouse option.
Given an area number, GRID BUILDER writes the boundary node x and y
coordinate list for the area in the file area.dig, which can be imported into GRID
BUILDER using the Generate/Irregular/Import/Digitzed .DIG option.
The Tool menu option All area bn as .DIG causes GRID BUILDER to write the
boundary node x and y coordinate lists for all areas to a series of files area_001.dig,
area_002.dig ... etc, which can be imported into GRID BUILDER using the
Generate/Irregular/Import/Digitzed .DIG option.

Chapter 6

Editing grid data


6.1

Mesh

Trim Allows you to remove elements from the current mesh, either by choosing a
subset of element or nodes. In the case of nodes, if any node in an element is
chosen, then that element will be removed.
Elements are removed as triangles unless option Edit/mesh/Treat as rectangles
(see below) has been activated, in which case they are removed as rectangles.
Fit in .OVR Fits the current rectangular mesh into an irregular boundary as defined
in the .OVR file. The file must contain four sections (representing the four
sides of the domain) entered in counter-clockwise order.
Area numbers from .GEN Reads a .GEN file and resets the element area number of
each element in the current mesh. If the element centroid falls within an area
defined by the .GEN file, then it is assigned that area number.
If an element does not lie in any area, it is assigned an element area number
of -999 (i.e. a missing value).
Elements are treated as triangles unless the option Edit/mesh/Treat as rectangles (see below) has been activated, in which case they are treated as rectangles.
No vertical exaggeration Forces the mesh to be drawn to scale (i.e. with no vertical
exaggeration). If the mesh is already being drawn to scale, then this option
appears as Allow vertical exaggeration. If you choose to allow vertical exaggeration, then the mesh can be rescaled and redrawn using the option Reset grid
defaults described below.
Treat as rectangles Certain meshes are constructed of pairs of triangles which form
rectangles, and are produced by the grid generation options Generate/Rectangular,
Generate/Wedge, Generate/Layered and File/Import/GMS Mesh .2DM, if the
GMS mesh is composed of rectangualr elements.
33

34

CHAPTER 6. EDITING GRID DATA


This option causes the mesh to be re-drawn, with each pair of triangular
elements being treated and shown as a single rectangular element. It also
changes the behaviour of the following instructions:
File/Export/GMS mesh .2DM Mesh written to file as rectangular elements.
File/Export/Tecplot Mesh written to file as rectangular elements.
Edit/Mesh/Trim/Element(chosen) Both triangular elements must be chosen to
eliminate rectangular elements.
Edit/Mesh/Trim/Node(chosen) Any rectangular element with a single node
chosen is eliminated.
Edit/Mesh/Area numbers from .GEN Centroids are computed for rectangular
elements.
Edit/Element/Info Element numbers and node lists are shown for rectangles.
Edit/Element/Pick/Within .OVR Centroids are computed for rectangular elements.
Edit/Element/Pick/Within .GEN Centroids are computed for rectangular elements.
Edit/Node/Xras/Pond NPROP Node connection data are computed for rectangles.
Plot/Flags/Element numbers This Tool menu option shows the rectangular element number.
If the mesh is being treated as rectangles, then the option is displayed as Treat
as triangles, and can then be used to switch back to treating the mesh as being
composed of triangular elements, in which case the options listed above will
behave in the normal manner.

Reset grid defaults Causes the default plotting parameters to be recalculated and
the mesh to be redrawn. This is useful if you have modified the way the
mesh is being shown in an unintended fashion of if you decide to allow vertical
exaggeration and want to regenerate the default plotting parameters.

6.2

Nodes and related data

The Edit/Node menu can be used to perform a variety of operations on nodes and
node-related data such as location or property value. The menu options are described below:
Info After choosing a node with the mouse or by entering a node number, a window
appears which contains information specific to that node, such as the X and
Y coordinate and current property value.

6.2. NODES AND RELATED DATA

35

If you use the keyboard and enter a node number which is greater than the
number of nodes in the 2D mesh, GRID BUILDER assumes that the number
represents a 3D node number, and that the 3D mesh was constructed of a
number of 2D meshes stacked vertically. In this case, we can use the modulo
operation (i.e. the remainder of division of one number by another) to determine an equivalent 2D node number from the 3D number. This is useful for
debugging mesh-related problems if the 3D node number is given.
Move node Move individual nodes by pointing and clicking with the mouse.
Optimize Reduce the grid bandwidth by renumbering the grid in the optimal way.
The bandwidth is determined by the largest difference between any two nodes
on any given element in the grid. During grid generation and refinement,
no attempt is made to keep the bandwidth to a minimum. Therefore, this
procedure should be invoked on a newly generated or refined grid, prior to
saving it to disk. Whether you need to do this depends on the type of matrix
solver used by the finite-element model which will use the grid data. Most
conventional direct solvers construct an array whose size is equal to the number
of unknowns times the bandwidth. Therefore the memory required to solve a
given problem is a direct function of the bandwidth. Because the node numbers
are shuffled during this procedure, it should be executed before you generate
nodal property values or determine node numbers which are significant to your
finite-element program (i.e. boundary nodes, pumping nodes etc.).
Relax Evenly distribute all nodes in the grid by moving each node to the centroid
of the nodes to which it is connected. Nodes lying on a boundary (outer or
inner) are never moved. In some cases, particularly around sharp corners on an
interior boundary, this operation may result in a corrupt grid (elements may
overlap). Also, smoothing of a rectangular or wedge grid may give undesirable
results. Therefore, you are strongly advised to save any grid information prior
to smoothing, unless you are sure that the results will be satisfactory.

6.2.1

Modifying nodal property values

For each node in the mesh, there is an associated numeric value, which we will
refer to as a nodal property value. These values could represent variables such as
hydraulic head, aquifer thickness or hydraulic conductivity. The options which are
used to manipulate the property values are delineated by the two lines in the menu,
and are described below:
Pick Presents a submenu which allows you to modify the chosen subset of nodes.
There are a variety of options for defining, modifying, saving and retrieving
the subset. When you enter the submenu, the system will be re-plotted, with
the chosen subset of nodes coloured yellow, and the unchosen nodes coloured
grey. By default, all of the nodes in the grid will be chosen initially. Once the

36

CHAPTER 6. EDITING GRID DATA


subset is defined correctly, you can return to the Edit Node menu and modify
the nodal property values for the chosen nodes. Some of the options which
follow work only with the selected subset.

Assign Assign a new property value to the chosen subset of nodes. You will be
prompted to enter the value in an I/O box.
Krige Presents a submenu which allows you to use the method of universal Krigeing
to interpolate nodal property values from the current set of field data for the
chosen subset of nodes. The options in the submenu are described below:
Field data Presents a submenu which allows you to modify the current set
of field data and the semivariogram which will be used in the Krigeing
procedure. By default, a linear semivariogram with unit slope is used
unless a different one is defined by the user. Detailed information about
field data and semivariograms is given in Section 6.6. The two menus are
identical and this one is duplicated for convenience.
Go Presents an I/O box which allows you to define some Krigeing parameters
and then start the procedure.
Result Presents an I/O box which allows you to change the contouring parameters which are being used to display the results of the Krigeing
procedure. Note that these are the same values which are used in the
Edit/Node/Contour option (i.e. the nodal property values.
Error Presents an I/O box which allows you to change the contouring parameters which are being used to display the standard error of the estimates
from the Krigeing procedure.
Drift Presents an I/O box which allows you to change the contouring parameters which are being used to display the first-, second- or third-order
drift (if calculated) from the Krigeing procedure.
Keep error/drift By default, error and drift calculations are not saved to disk
and there no options in this menu to do so. This option allows you to
overwrite the current nodal property data with either the error or drift
values. You can then exit this menu and save them to a file in the
normal fashion. NOTE: The results will no longer be available unless
you regenerate them by krigeing.
Transform Presents a submenu which allows you to transform the nodal property
values of the chosen subset of nodes in various ways. If necessary, you will be
prompted to enter a constant or pick a file to perform the transformation.
Get nprop Get a new set of nodal property values from a file. Produces a menu of
available nodal property names to choose from.
Save nprop Save the current nodal property values in a file. The property name,
current contour and colour fill information is stored along with the nodal
property values.

6.2. NODES AND RELATED DATA

37

Contour Produces an I/O box which allows you to contour (simple or colour filled)
the current nodal property values.
Fill Produces an I/O box which allows you to colour fill groups of nodes which have
the same property value. For example, hydraulic conductivity is often defined
by layer in a cross-sectional model. Thus we have a few discrete values, one
for each layer. The region associated with each node is determined as the area
bounded by the node, the element centroid and the midpoints of the element
sides which meet at the node.
Name Produces an I/O box which allows you to edit, position, size, orient and toggle
(ie. on or off) the Nodal property name.

6.2.2

Other considerations

The option Edit/Node/Xtras leads to a submenu which contains some procedures


which were added for our own specific reasons but may be of more general use.
They are described below:
Draw flownet from 2 NPROP files Produces I/O boxes which allow you to choose two
nodal property files and define two independent sets of contouring parameters.
The results are displayed simultaneously, with the first file contoured with solid
lines, and the second file contoured with dotted lines. If you choose appropriate
head and stream function data files, the resulting plot will be a ground water
flow net.
Save node connection info to CONNECT.LST Writes a list of nodal connection data
to a file called CONNECT.LST. The file contains a single line for each node, which
consists of the node number and a list of all nodes to which it is connected.
Nodes are connected if they occur in the same element.
NPROP to GMS scalar .SCL Writes a GMS compatible ascii scalar data file containing the current set of nodal property values. The file name is made up of the
current prefix, the string .nprop_to_gms_scalar., the current nodal property
name and the extension .SCL.
Pressure head from NPROP - Y coordinate Converts the current nodal property values to pressure head by subtracting the y-coordinate value at each node. This
is only meaningful if the grid is a cross-section and the current nodal property
value is hydraulic head.
List NPROP if node chosen Writes an ascii file containing a list of node number and
property value for the set of currently chosen nodes to the file prefix.nchnprop list.npname where prefix is the current grid prefix and npname is the
current nodal property descriptor. This could be used for example, to choose
the nodes along a section of the outer boundary corresponding to the water

38

CHAPTER 6. EDITING GRID DATA


table, and write the list of node numbers and hydraulic head values to a file,
which could then be read in as a boundary condition for another model. The
file name is made up of the current prefix and the extension .OUT.

Import GMS scalar as NPROP Reads GMS formatted scalar data from a file whose
name is made up of the current prefix and the extension .SCL and overwrites
the current nodal property data.
Import raw ascii NPROP Reads data from a file whose name is raw_ascii_nprop.dat
and overwrites the current nodal property data.
Relax chosen nodes only This is like the Edit/Node/Relax option but only applied to
the current set of chosen nodes.
Overlay to TECPLOT from NPROP Prompts for the name of an overlay file and then
interpolates a z coordinate for each xy-coordinate pair from the current nodal
property function. The output is written in TECPLOT format to the file
oname.tec geometry.dat where the first part of the file name is the descriptive portion of the overlay file.
Boundaries to TECPLOT from NPROP Interpolates a z coordinate for each xy-coordinate
pair of all current mesh outer and area boundaries from the nodal property
function. The output is written in TECPLOT format to the file prefix.bnd.tec geometry.dat where the first part of the file name is the current grid
prefix.
Nprop vs npoints at a node This option is useful for determining the optimum number of data points to be used in the krigeing procedure. Before executing it,
you should read in a set of field data, krige the nodal property values and plot
the standard error of estimates. When you then choose this option, you will be
presented with the Krigeing parameters I/O box. You can set the minimum
and maximum numbers of data points to be used in the krigeing procedure to
span a range of values to be tested. For example, if you had several hundred
data points, you might specify a minimum of 5 and a maximum of 100 points
to test. When you exit the I/O box, you can click the mouse in a few regions
with large error. For each mouse click, GRID BUILDER will search for the
nearest node and then interpolate a value using first 5 nearest data points,
then 10, then 15 etc. up to 100. Each interpolated value is written to a file
krig.npoints.dat in Tecplot format, along with the number of data points
used to generate it and the standard error of estimate. You may find that
20 points for example, is the optimum number of data points to use in the
krigeing procedure, and that increasing it does not significantly change the
interpolated value or reduce the standard error of estimate.
Nprop to TECPLOT file .tec.dat This is the same option as File/Export/Tecplot.
Set origin at xmin,ymin BEWARE!!! This option translates the grid in the xy plane
so that the minimum x and y coordinates become zero.

6.3. ELEMENTS AND RELATED DATA

39

List XYZ if node chosen Writes an ascii file containing a list of node number and
xyz-coordinates for the set of currently chosen nodes to the file prefix.nchxyz list where the first part of the file name is the current grid prefix.
Relax NPROP surface This option can be used to smooth the current nodal property
function. For each node, it calculates the average nodal property value of all
connected nodes and then sets the current nodal property to that value.
Pond NPROP This option is used to generate a guess of initial head values for a
surface water flow problem. Before using this option you must read a set of
nodal properties (i.e. surface elevations), and choose the nodes which are to
provide outlets for surface water flow (e.g. the outer boundary). It determines
a drain elevation for each sub-basin in the watershed. If the nodal property
of a node in a sub-basin is less than the sub-basin drain elevation, then the
nodal property is set equal to the drain elevation.
Element node connections are computed for triangles unless the option Edit/Mesh/Treat
as rectangles (see Section ??) has been chosen, in which case they are computed
for rectangles.

6.3

Elements and related data

Much of the Edit/Element menu options are very similar to those described above
for nodes, and only some notable exceptions will be mentioned here.
There is no Edit/Element/Move option.
Edit/Element/Info After choosing an element with the mouse or by entering
an element number, a window appears which contains information specific to
that element, such as the incidence and X, Y coordinates of the corner nodes,
the current property value and the area number that the element falls in.
Element information is written for triangles unless the option Edit/Mesh/Treat
as rectangles (see Section ??) has been chosen, in which case they are written
for rectangles.
If you use the keyboard and enter an element number which is greater than the
number of elements in the 2D mesh, GRID BUILDER assumes that the number represents a 3D element number, and that the 3D mesh was constructed
of a number of 2D meshes stacked vertically. In this case, we can use the
modulo operation (i.e. the remainder of division of one number by another)
to determine an equivalent 2D element number from the 3D number. This is
useful for debugging mesh-related problems if the 3D element number is given.
The Edit/Element/Pick option is used to choose a subset of elements. This subset affects the Refine option, described below, as well as the element property
values.

40

CHAPTER 6. EDITING GRID DATA


When interpolating elemental property values using Krigeing, the element
centroid is used as the point at which the value is interpolated.
When contouring element data, because the contouring routine works with
nodal data only, such a set is generated by averaging the element property
values of all elements of which the node is part.
In the Edit/Element/Fill option, the entire element is filled with the appropriate
colour.
The following items are unique to the Edit/Element menu:

Refine Subdivide the chosen subset of elements. The refinement process will be
plotted on the screen as it executes. Each chosen element will be subdivided
into four elements, and the elements touching the boundary of the chosen
region will be subdivided into two elements.
Make sure you have enough array space available before you do the refinement.
For each chosen element, there will be four elements after the refinement procedure is completed. You can check the current number of elements using the
Tool menu option Info.
Avoid doing successive refinements of the same area, as this results in rapidly
increasing numbers of nodal connections for the nodes around the boundary of
the chosen area. The maximum number of nodal connections for a given node
is currently 15. If you want to do successive refinements of a given region, you
should either decrease or increase the size of the area to be refined at each
step.
Vectors Presents a menu which allows you to manipulate element vector information.
Each vector is composed of an X and Y components which can then be plotted
with arrows that indicate direction and magnitude. The menu options are
described below:
Info
Edit Produces an I/O box which allows you to modify the appearance of the
plotted vectors.
Legend Produces an I/O box which allows you to modify the appearance of
the reference vector.
Get vectors Get a new set of element vector values from a file. Produces a
menu of available element vector names to choose from.
Save vectors Save the current element vector values in a file. The vector name,
and current plotting information is stored along with the nodal property
values.

6.4. SEGMENTS AND RELATED DATA

6.3.1

41

Other considerations

The option Edit/Element/Xtras leads to a submenu which contains some procedures


which were added for our own specific reasons but may be of more general use. They
are described below:
NPROP EPROP Creates a set of element property values by averaging the current nodal property values for each node in the element.
Calculate gradient from nprop Creates a set of element property values by computing the gradient of the current nodal property. The element side with the
maximum gradient is used.
Write chosen elements as quads Assuming the mesh is constructed such that triangles 1,2 form a rectangle then 3,4 etc., this option writes the current set of
chosen elements to a file in Grid Builder format (i.e. .echos.). The file name
is generated from the current prefix, the extension .np_ech_as_quads. and
the current chosen element descriptor.
Element area number EPROP Creates a set of element property values from the
current element area number set.
EPROP Element area number Creates a set of element area numbers from the
current element property values. Element property value should be integers
(i.e. no fractional component).
Import raw ascii EPROP Reads data from a file whose name is raw_ascii_eprop.dat
and overwrites the current elemental property data.
Max angle EPROP For each triangular element, the interior angle at each corner
is computed and the maximum angle is saved as the element property value.

6.4

Segments and related data

The Edit/Segment menu was developed specifically for use with the HTS1 finiteelement program (Ph.D thesis of VanDerKwaak, 1998) and has not been used or
tested extensively. If you require further information about this option please contact the author.

6.5

Boundary condition data

GRID BUILDER allows you to assign boundary conditions to any nodes in the
current mesh. A finite-element model can use such information, but it is up to you
to ensure that it does so in a meaningful way.

42

CHAPTER 6. EDITING GRID DATA

There are three types of conditions which can be assigned which are referred to
as 1st- , 2nd- and 3rd-type. When you enter the Edit Boundary submenu, a special
plot will be presented which shows the current set of boundary data. Nodes are
colour-coded according to the following convention:
COLOUR
Blue
Grey
Red
Green

TYPE
First-type, value can be shown
Second-type, zero-valued, value not shown
Second-type, non-zero valued, value can be shown
Third type, value can be shown

The options in the Edit Boundary menu are described below:


1st-type Choose a subset of nodes and assign a 1st-type value to them. The value
could, for example, represent a constant head node in a finite-element model.
2nd-type Choose a subset of nodes and assign a 2nd-type value to them. These
values can be assigned directly to each chosen node or they can be multiplied
by the contributing length (for boundary nodes) or area (for internal nodes)
of the adjoining elements. Furthermore, when computing the contributing
length, you can consider only the X components (i.e. this could represent
recharge due to rainfall, which is measured with respect to a horizontal plane
only) and ignore the contributions from elements beyond the start or end of
the boundary node segment, which is often preferred at corners.
3rd-type Choose a subset of nodes and assign a 3rd-type value to them. The value
could, for example, represent the combined fluid flux and concentration of
contaminant in the fluid entering the system at a node. GRID BUILDER
does not attribute any particular significance to the values you enter here.
That depends on how they are treated by the finite-element model in which
they are being used.
Clear Choose a subset of nodes and return them to the default state (2nd-type, zero
valued).
Info Get information about the current boundary condition at a node picked with
the mouse. Particularly useful if the node is time-varying as this shows the
values which will be generated.
Get conditions Get a new set of boundary condition values from a file. Produces a
menu of available boundary condition names to choose from.
Save conditions Save the current boundary condition data in a file.
Plot parameters Produces an I/O box which allows you to control node plot size,
boundary node value size and format and whether to plot boundary values.
Export conditions This file can be used by a finite-element model to assign these
nodes the appropriate boundary type and value. This file consists of a title

6.5. BOUNDARY CONDITION DATA

43

line, a line containing the number of first-type nodes and a list of first-type
node numbers and values (one per line). Two additional sections provide
similar data for the second- and third-type boundary nodes.

6.5.1

Other considerations

The option Edit Boundary/Xtras leads to a submenu which contains some procedures
which were added for our own specific reasons but may be of more general use. They
are described below:
Head=elev For all chosen nodes in the mesh this option makes them 1st-type nodes
and assigns the elevation (Y-coordinate) as the boundary condition value.
The most obvious use for this is to choose boundary nodes along the top
surface of the grid, which has been configured to represent the water table,
and then set their hydraulic head to be equal to the elevation. It was designed
to be used with the FLOW2D 2D groundwater flow model, but could be useful
for other similar models.
Head=func For all chosen nodes in the mesh this option makes them 1st-type nodes
and assigns the current nodal property value as the boundary condition value.
Sfunc .SFC The option Edit Boundary/Sfunc can be used to generate a set of secondtype stream function values along segments of the boundary which are currently specified as first-type head values.
You may recall that the second-type stream function along such a boundary
is defined in terms of the specified head as:
Fi =

i1 i+1
2

where Fi is the stream function second-type boundary value at node i, is


the potential (head) function and i 1 and i + 1 are the nodes on either side
of i.
For every first-type node which has two first-type neighbours, this value is
calculated, and the node number and the values are written to the file with
the extension .SFC. This file can be incorporated into a finite-element data set
at a later time.
Ltg3 Loops around the outer boundary of a grid and searches for elements which
have both boundary nodes assigned a 3rd-type boundary condition. For each
such element, a record is written to an ascii file called LTG3.DAT containing
the element number, incidences of the two nodes forming the boundary segment, the magnitude and sign of the velocity vector component normal to the
boundary and its 3rd-type boundary condition value.

44

CHAPTER 6. EDITING GRID DATA


The current set of element velocity vectors are used when calculating the
normal component, and it is recommended (although not necessary) that you
read the set of velocity vectors produced by a related flow solution before you
choose this option.
It was designed to be produce input for the LTGPLAN quasi-3D groundwater
transport model using flow velocities from the 2D groundwater flow model
FLOW2D, but could be useful for other similar models.

Flux leaving This routine requires that a set of velocity vectors from a flow solution
are loaded. When executed it computes the flux leaving the domain at all
element edges that have 3rd-type nodes at each corner and writes the results
to the file prefix.flux leaving.bcname.vecname

6.6

Field data

A set of field data consists of a list of X-, Y-coordinate pairs, each with an associated
value. These coordinates need not coincide with node locations and can even fall
outside the mesh. They are primarily used as input for the Edit/Node/Krige and
Edit/Element/Krige routines which are used to generate node and element property
values for the mesh. The Edit/Field data submenu allows you to manipulate different
sets of field data. This menu is also accessible from within the Edit/Node/Krige and
Edit/Element/Krige submenus. The menu options are described below:
Add Allows you to add a field data point at a location chosen with the mouse.
Remove Allows you to remove a field data point using the mouse.
Edit Allows you to edit a field data point value using the mouse.
Clear Clears the existing field data values and sets the number of points back to
zero.
Get field data Get a new set of field data values from a file. Produces a menu of
available field data names to choose from. You will be asked whether you want
to clear the existing data first (if there is any) If you dont, the two data sets
will be merged.
Save field data Save the current field data values in a file. The field data name and
semivariogram information is stored along with the field data values. You will
be asked if you want to create a new file, the alternative being to overwrite
an existing file. If the current number of saved field data sets is equal to
MAXPROP, you must overwrite an existing file.
Name An I/O box allows you to change the field data name and the appearance of
the field data values.

6.6. FIELD DATA

45

Variogram Leads to a submenu which allows you to modify the semivariogram for
this set of field data, which is used when krigeing values for nodes or element
centroids. When you enter this menu, the screen is re-drawn and a plot of the
variogram of the current field data and the current best-fit semivariogram is
shown. It is not my objective to give a rigorous description of semivariogram
analysis. For this the reader is referred to Davis, [1986], David () or Olea ().
The Variogram menu options are described below:
Type Produces a menu which allows you to change the type of function which
is used to generate the best-fit semivariogram. The menu options correspond to the available function types and are described below:
Linear Defines a linear semivariogram which can be described by the
equation:
h = h for h < a
h = 2 for h a
where is the slope, h is the lag distance, a is the range and 2 is
the variance.
Spherical Defines a spherical semivariogram which can be described by
the equation:
h3
h = 2 ( 3h
2a 2a )
where h is the lag distance, a is the range and 2 is the variance.
Exponential Defines an exponential semivariogram which can be described
by the equation:
h = 2 (1 exph/a )
where h is the lag distance, a is the range and 2 is the variance.
Gaussian Defines a gaussian semivariogram which can be described by
the equation:
2
h = 2 (1 exp(h/a) )
where h is the lag distance, a is the range and 2 is the variance.
X-corr Defines a cross-correlated exponential exponential semivariogram,
which can be described by the equation:

s21
s22
(~s) = 2 1 exp
+

21 22

!1/2

where 1 , s1 and 2 , s2 are the X and Y correlation lengths and lag


distances respectively and 2 is the variance.
Bins Produces an I/O box which lets you change the number of bins the
field data is divided into when constructing the semivariance plot. Too
many bins may cause the semivariogram to be noisy, since some bins
may contain too few data. Too few bins may result in a loss of significant
detail in the semivariance plot.

46

CHAPTER 6. EDITING GRID DATA


Residual Plot the semivariances of the residual of the field data. The residual
is a measure of how well the best-fit semivariogram matches the semivariance of the original data. The menu option label will be changed
from Residual to Original, and the residuals will be used to construct the
semivariance plot until the Original menu option is chosen, at which time
the original data will be used to construct the semivariance plot.

6.7

Overlay data

Overlay data consists of lists of x-, y-coordinate pairs, and are stored in files whose
names are formed from a descriptor and the extension .ovr. The coordinates need
not coincide with node locations and can even fall outside the mesh. The format
of a .ovr file is the same as the .dig file discussed in section 2.4.1.3. The main
difference between these files is that the order of the coordinate lists is not important
in the overlay file.
Overlays can be used for reference when defining grid boundaries, choosing nodes
and elements etc. All overlay files present in the current directory will be loaded
automatically by GRID BUILDER. The appearance of the overlays can be adjusted
using the menu option Edit/Overlays which leads to a submenu with the following
options:
Flag Individual overlays can be flagged so that they are plotted on the screen.
Colour This option allows you to set the colour of each overlay.
Enable Enable(disable) the plotting of overlay data on the screen.
Overlay from contours Writes the current line contours as overlay data to the file
whose name is generated from the current nodal property name and the extension .ovr
Show all All overlays are flagged so that they are plotted on the screen.
Info Click the mouse on an active overlay and it will be highlighted and a window
will show the overlay number and file name. For the chosen overlay, each list
of x-, y-coordinate pairs will be labelled with a tag number corresponding to
its position in the overlay file, starting with zero for the first list, 1 for the
second list etc. The Tool menu option Refresh can be used to remove the tag
numbers from the display.
Tag ovr file Click the mouse on an active overlay and it will be highlighted and a
window will show the overlay number and file name. A file with the same
name as the overlay file, but with the prefix tagged will be created. It is
identical to the original file, except a third column is written which contains
the tag numbers described above in the Info option.

6.8. RASTER DATA

47

These last two options are useful if you are working with large overlay files
containing many separate list of node coordinates. You can display the list numbers
with Info, then create the tagged file and find individual lists using the tag numbers.

6.8

Raster data

Raster data consists of a set of values that are laid out of a rectangular grid with
uniform spacing in x and y which are stored in files whose names are formed from
a descriptor and the extension .asc. The coordinates need not coincide with node
locations and can even fall outside the mesh.
The .asc file must consist of header information containing a set of keywords,
followed by cell values in row-major order. The file format is based on the ArcGIS
ascii file conventions and must consist of the following:
NCOLS xxx
NROWS xxx
XLLCORNER xxx
YLLCORNER xxx
CELLSIZE xxx
NODATA_VALUE xxx
row 1
row 2
.
.
.
row n
where NCOLS and NROWS are the number of rows and columns in the raster respectively, XLLCORNER and YLLCORNER are the x and y coordinates of the lower left corner
of the raster, CELLSIZE is the size of each raster cell, NODATA_VALUE is the value in
the ASCII file representing cells whose true value is unknown and xxx is a number.
Row 1 of the data is at the top of the grid, row 2 is just under row 1, and so on.
For example:
ncols 480
nrows 450
xllcorner 378923
yllcorner 4072345
cellsize 30
nodata_value -32768
43 2 45 7 3 56 2 5 23 65 34 6 32 54 57 34 2 2 54 6
35 45 65 34 2 6 78 4 2 6 89 3 2 7 45 23 5 8 4 1 62

...

48

CHAPTER 6. EDITING GRID DATA

Cell values should be delimited by spaces. No carriage returns are necessary at


the end of each row in the grid. The number of columns in the header is used to
determine when a new row begins. The number of cell values must be equal to the
number of rows times the number of columns.
Raster files can be used for assigning node or element property values to the
current 2D mesh. For example, you could generate a set nodal property values
representing the ground surface elevation by using DEM (Digital Elevation Model)
data to define the raster. This procedure involves a search to find which raster cell
a node falls in followed by a bilinear interpolation to compute the value at the node
from the four DEM values for the cell. This procedure is much faster than krigeing
from scattered field data. In cases where successive 2D meshes are generated it
can be advantageous to first krige the field data to a rectangular grid and store
the results in a raster file, and then interpolate from that to the most recent 2D
finite-element mesh as required.
All raster files present in the current directory will be detected automatically
by GRID BUILDER. The Edit/raster option leads to a submenu with the following
options:
Read raster .ASC Loads the chosen raster data into memory.
Read raster .E00 This option supports the older Arcview interchange format and
loads the chosen raster data into memory. Only files with the extension E00
are considered.
Create raster by Krigeing field data Before executing this option the current directory should contain a field data file which will be used in the krigeing procedure and also a raster or raster header file which will be used as a template
for constructing the new raster file. You will first be prompted to load the
raster and field data files if necessary and then modify the krigeing parameters as desired. A value will be interpolated for each grid point in the raster,
which can take a long time depending on the size and spacing parameters of
the raster. The file name used to store this information is generated from the
current field data name and the extension .asc (e.g. Aquifer 1 top.asc).
This file can be loaded using Edit/Read raster .asc and used, for example, to
interpolate a nodal property values for a 2D mesh.
Relax raster Each value in the raster is adjusted by assigning it the value of the
average of its 9 neighbours (inclusive). Figure 6.1 shows the effect of applying
raster relaxation 10 times to a raster of surface elevation.
Trim raster to grid The minimum and maximum grid extents are used to trim the
raster. A new file is created using the original raster file name with the prefix
trimmed_. Consider doing this if the raster covers an area much larger than
the grid and it takes a significant amount of time to read or consumes a lot of
memory and disk space.

6.8. RASTER DATA

Figure 6.1: Effect of Relax raster option: (a) original (b) 10 times relaxation

49

50

CHAPTER 6. EDITING GRID DATA

Save raster Saves the raster data in a file.


Kill raster Removes the current raster data from memory.
NPROP from raster
Chosen NPROP from raster
EPROP from raster
Chosen EPROP from raster These 4 menu items interpolate a property value for each
node (or element) by searching for the raster cell containing the node (or
element centroid) and then either:
1. doing a bilinear interpolation based on the four raster cell values.
2. assigning the raster value which is closest to the node. This can be useful
if the raster contains discrete valued data such as soil type.
The instructions starting with Chosen... only interpolate values for the
chosen subset of nodes or elements.
Overlay to TECPLOT from raster Interpolates a z value for each coordinate pair in
an overlay by searching for the raster cell containing the point and doing a
bilinear interpolation based on the four raster cell values. The file name used to
store this information is generated from the current prefix, the string .overlay
as tecplot geometry, the current overlay name and then the extension .dat
(e.g. mygrid.overlay as tecplot geometry.rivers.dat). This file can be
imported into TECPLOT to show, for example, rivers on a relief map of the
topographic surface.
Field data to TECPLOT from raster Interpolates a new z value for each coordinate
pair in a field data file by searching for the raster cell containing the point
and doing a bilinear interpolation based on the four raster cell values. The
file name used to store this information is generated from the current prefix, the string .field data as tecplot geometry, the current field data
name and then the extension .dat (e.g. mygrid.field data as tecplot
geometry.borehole locations.dat). This file can be imported into TECPLOT to show, for example, borehole locations on a relief map of the topographic surface.
Show raster Plots the raster grid on the screen. The Tool menu option Refresh can
be used to remove the raster from the display.

6.9

Hydrographs

The Edit/Hydrograph menu options were developed specifically for use with the InHm
finite-element program (Ph.D thesis of VanDerKwaak, 1998) and have not been used
or tested extensively. If you require further information about this option please
contact the author.

6.10. WELLS

6.10

51

Wells

A well data file consists of a target element size on the first line, followed by lists of
x-, y-coordinate pairs, which represent well locations. These data are stored in files
whose names are formed from a descriptor and the extension .wel. The coordinates
need not coincide with node locations.
Well data can be used to position nodes in the finite-element mesh and refine
the mesh around the well. All well files present in the current directory will be
detected automatically by GRID BUILDER. The Edit/Wells option which leads to
a submenu with the following options:
Show potential well locations Nodes which might become wells are shown with a
filled blue circle and a yellow line to the potential node location. If two lines
are shown this means that two wells are competing for the same node. You
may want to refine the mesh near the competing wells to the point that they
each choose a unique node before using the Make wells option.
Make wells For the x and y coordinates of each well in the chosen file, the nearest
node in the 2D mesh is found. This node is then moved to the location of the
well and flagged as a well node and the mesh is relaxed. The grid around the
node is then refined successively until the elements around the well are smaller
than the target element size given in the first line of the well file.
Note that nodes flagged as wells are not moved during grid relaxation and
mesh deformation may result if the grid is relaxed after the wells have been
added.

52

CHAPTER 6. EDITING GRID DATA

Chapter 7

GRID BUILDER
Demonstration
The demonstration consists of a list of step-by-step instructions which guide you
through the creation and manipulation of a set of finite-element grid data. It covers
many of the most common procedures you will need to know to use GRID BUILDER.
As you read through the demo, you should run GRID BUILDER and execute the
bulleted instructions.
For the purpose of this discussion, we will assume that GRID BUILDER has
been installed in the default directory called C:\Program Files\gridbldr, and that
you will run GRID BUILDER from the Command Prompt. If you are not in the
directory C:\Program Files\gridbldr\demo then issue the DOS command:
cd c:\program_files\gridbldr\demo
During the demo, portions of the GRID BUILDER window may become blank if
you use another windows program and then return to GRID BUILDER. To refresh
the screen just do the following:
Press
menu.

F7

or click the mouse outside the regular menu to activate the Tool

Execute Refresh to replot the screen contents.

7.1

Starting GRID BUILDER

To start GRID BUILDER, issue the command:


gb
53

54

CHAPTER 7. GRID BUILDER DEMONSTRATION


You should see the title screen.
Press any key (e.g.

7.2

Enter

). You should see the Main menu.

Importing grid boundary data

When you start working on a new finite-element problem, the first step is to define
the grid boundary information. The example below reads the information from a
file which was created with a digitizer.
Execute Generate/Irregular/Import/Digitized .DIG. Since, in this case, the menu
items all start with unique letters, you can either type the sequence GIID or
giid or point and click on each menu item with the mouse to do so. You
should see a menu with a single file entry, bnds.dig, at the top and directory
information at the bottom.
Press Enter , point and click with the mouse, or type b (i.e. the first letter
of the file name, which does not have to be upper case) to read this file. As
GRID BUILDER reads the file it draws the outer boundary and some internal
boundaries. The screen should now resemble Figure 7.1, with the exception
that the Gen edit menu will be visible.
Execute Fix interactive to check for potential problems with boundary segments
which are very short. You should now see the Fix submenu appear, and the
nodes on the ends of the shortest line segment will be coloured yellow and blue.
In this case, you can only see the yellow node, which is located (approximately)
at the X-, Y-coordinates 11000, 3400.
Execute Zoom to see the region around the segment at a larger scale.
Execute Info to see some information about the segment, including the distance
separating the two nodes, in this case 8.45 metres.
Press any key to remove the dialogue window.
If the separation distance is insignificant compared to the overall size of the
domain, we can take the average without losing any significant geometric information. Execute Average to create a node halfway between the blue node
and the yellow node, at the same time removing the blue and yellow nodes.
You will be returned to the normal scale, the boundaries will be adjusted and
re-drawn, and the next shortest line segment will be highlighted.
Execute Zoom to see the region around the next segment at a larger scale. It
looks as if the blue node was created when the cutting segment was dragged
across the existing boundary, so the yellow node was probably created at a
legitimate break in the first cutting segment.

7.2. IMPORTING GRID BOUNDARY DATA

55

Figure 7.1: Initial grid boundaries


Execute Yellow to keep the yellow node and remove the blue node.
Execute Zoom to see the region around the next segment at a larger scale.
Execute Blue to keep the blue node and remove the yellow node.
Execute Info to check the separation distance between the highlighted nodes,
in this case 127.67 metres. This is a legitimate boundary segment (ie. it defines
a break in the boundary).
Press any key to remove the dialogue window.
Press Esc to exit the Fix interactive submenu without making any more
changes and return to the Gen edit submenu. Remember that you can also
exit regular menus by clicking the mouse outside the menu.
Execute Do to generate the grid. You should see the following prompt:
Save changes to grid generation file?

Yes/No

Since we modified the original boundaries, its a good idea to save them before
continuing. Type Y or Enter to pick a yes response. You will see the I/O
box which allows you to change the current prefix.

56

CHAPTER 7. GRID BUILDER DEMONSTRATION

Figure 7.2: Initial generated grid


Press Enter to accept the current prefix bnds and exit the I/O box. You will
see the following prompt:
File exists...overwrite? Yes/No
Type Y or press Enter to pick a yes response to exit the I/O box and save
the boundary information to the file bnds.gen.
You should now see the domain being filled with triangles, and the screen
should eventually resemble Figure 7.2. You should see the following prompt:
Regenerate? Yes/No
Type Y or press Enter to pick a yes response. You will be returned to the
Gen Edit menu, and the elements will disappear.

7.3

Changing the mouse precision

You can alter the precision of the coordinates returned by the mouse. In this part
of the demonstration, a mouse precision of 100 units is sufficiently accurate.

7.4. MODIFYING GRID BOUNDARY DATA


Press
menu.

F7

57

or click the mouse outside the regular menu to activate the Tool

Execute Mouse. You should see the Precision x menu. This is a cycling menu in
which only one of several options is displayed at a time, in this case 0.00001.
Press

or

Spc

until the Precision x value is 100.0.

Press Enter to accept the values and exit the menu. You should now see the
Precision y menu.
Make the Precision y value 100.0.
Press Enter to accept the values and exit the menu. You should now see the
Tool menu.
Press
menu.

7.4

Esc

or click the mouse outside the menu to return to the Gen Edit

Modifying grid boundary data

Once the boundary data is defined, you can alter it in the Gen Edit menu. In this
section of the demonstration, we make a few simple changes and then regenerate
the mesh to see the effects.
Execute Parameters/Hole, and a window will appear at the top left-hand corner of the screen which contains the X-, Y-coordinates of the current mouse
position.
Press F1 and a help screen will appear which explains what the mouse buttons do in the current situation.
Press

Esc

to exit the help screen.

Move the mouse to the X-, Y-coordinate 2400, 4500 and click the left mouse
button. The boundary of the area in which you clicked the mouse should now
be hatched. This represents an area which will not be filled with triangles (i.e.
a hole).
Click the right mouse button to exit the Hole option.
By default, all areas of the grid have uniform grid generation parameter values.
You can see the defaults using the Info option, and change them for a single area or
multiple areas.

58

CHAPTER 7. GRID BUILDER DEMONSTRATION


Execute Info and click the mouse inside an area and a dialogue box shows the
grid generation parameters for that area. Currently, the target element length
is 271.48 m.
Press a key to exit the dialogue box and click the right mouse button to retrn
the the Parameters menu.
Execute Multiple areas and a new menu will appear which allows you to modify
the current set of chosen areas.
Execute Off and Flip to activate all areas. If an area is active, the area number
is plotted in yellow.
Press Esc to exit the menu and an I/O box will appear which allows you to
change the grid generation parameters for the chosen areas.
Press F3 to delete text from the cursor to the beginning of the line. This
applies to any I/O box field.
Make the Target element length 500.
Press

Enter

Press

Esc

or click the mouse on the OK button to exit the I/O box.


to return to the Gen edit menu.

You can position nodes precisely if desired.


Execute Move node, and move the mouse to 6000, 5400.
Click the left mouse button. A yellow rubber-band line now connects the
mouse position and the node closest to 6000, 5400.
Move the mouse to 6700, 5400 and click the left mouse button. The yellow
line becomes fixed, showing the new position of the node.
Move the mouse to 6600, 3800 and click the left mouse button.
Click the right mouse button and an I/O box appears which allows you to
enter the new coordinates from the keyboard.
Click the mouse anywhere in the X-coordinate input field to position the cursor. Although you can move through the fields in the I/O box using the ,
, Tab and SHIFT- Tab keys and move within a field using and
keys, it is often quicker to use the mouse.
Make the X-coordinate 6811.
Make the Y coordinate 3794.
Press Enter to exit the I/O box. The yellow line shows the new position of
the node.

7.5. CHANGING THE CURRENT DIRECTORY AND PREFIX

59

Figure 7.3: Modified grid boundaries


Click the right mouse button to exit the Move node option. The screen should
now resemble Figure 7.3.

7.5

Changing the current directory and prefix

You can easily save the current mesh data to any existing directory on the current
drive. To change drives, you must first do so as described in section 5.7.
Execute Save .GEN. You will see the I/O box which allows you to change the
current prefix.
Click the mouse on the Change directory button and you will see a menu which
allows you to navigate through the directories on the current drive.
Click the mouse on the Mydata option and the current directory will be
changed.
Click the mouse on the . option to exit the menu and return to the dialogue
box.
Change the current prefix from bnds to mygrid.

60

CHAPTER 7. GRID BUILDER DEMONSTRATION

Figure 7.4: Modified generated grid


Press

Enter

to exit the I/O box and save the boundary information.

Execute Do and the grid will again be filled with elements. When the grid is
complete, you should see the following prompt:
Regenerate? Yes/No

Type

or press

Enter

to pick a no response.

You should see the following prompt:


Save changes to grid?

Type

or press

Enter

Yes/No

to pick a no response.

You will be returned to the Main menu. The screen should look like Figure 7.4.

7.6. GRID CHECKS AND CONDITIONING

7.6

61

Grid checks and conditioning

Before proceeding it is a good idea to perform grid relaxation and also to carry out
a few checks of grid topology. These operations can be found in the Check menu. It
can be seen from figure 7.4 that there are a few skinny elements in the mesh. Grid
relaxation can reduce this to a large extent.
Execute Relax grid and you will see a marked improvement in the mesh (i.e.
skinny elements are now more equilateral).
Execute Closest nodes and the two closest nodes will be highlighted with blue
and yellow circles, and a menu appears which allows you to zoom in on the
segment, find out how far apart the nodes are, skip to the next closest pair
or relax the node pair. In this case the two closest nodes are an acceptable
distance apart. Press Esc to exit the procedure.
Execute Zero-area elements. A dialogue box informs you whether or not any
bad elements were found. Press Enter to exit the dialogue box.
Press

7.7

Esc

to return to the Edit menu.

Grid refinement

Often you will want to refine a portion of the grid. To do so, you must first choose
a subset of elements.
Execute Edit/Element/Pick and the screen will be redrawn with the chosen
elements flagged with a yellow circle.
Execute Off to clear the chosen elements.
Execute Circle and move the mouse to 2400,4500.
Click the left mouse button to anchor the circle centre
Move the mouse to 4500, 4500. A rubber circle should follow the mouse.
Click the left mouse button to anchor the circle and elements within the circle
will be chosen.
Click the right mouse button to exit the Circle procedure.
Press

Esc

to return to the Element menu.

Execute Refine to refine (subdivide) the currently chosen set of elements. A


warning is issued about backing up grid data before refining. Press any key
to continue.

62

CHAPTER 7. GRID BUILDER DEMONSTRATION


You will see the following prompt:
Refine anyway? Yes/No

Type Y or press Enter to pick a yes response, and the results of the as
the refinement process will be plotted on-screen as it progresses.
A warning is issued that data files associated with the grid are no longer
compatible. Press any key to continue.
Press Esc to return to the Element menu. The screen is not automatically
redrawn.
Press
menu.

F7

or click the mouse outside the regular menu to activate the Tool

Execute Refresh to replot the screen contents.

7.8

Modifying the default plot

This section illustrates some modifications that could be made using the Tool menu
option Plot, to customize the position and characteristics of the default plot as it
appears on the screen and plotted output.
Execute Plot/Move mesh.
Move the mouse into any element, then drag the element to a new position by
depressing the left mouse button while moving the mouse. A ghosted image
of the element follows the mouse and a rubber line connects the centroid of
the ghosted element to its original location. Position the element as desired
and release the mouse button to fix the grid in the new position. The screen
will be redrawn.
Click the right mouse button to return to Plot edit menu.
Execute Our name. An I/O box appears which allows you to modify the
attributes which control the position and appearance of the company name.
Press F4 to delete text from the cursor to the end of the field. This applies
to any I/O box field. Since the cursor was positioned at the start of the field,
this clears the old name Groundwater Simulations Group.
Make the company name My Company.
Point and click the left mouse button on the digit 6 in the Company name size
field to position the cursor.

7.8. MODIFYING THE DEFAULT PLOT

63

Make text size 0.9.


Click the left mouse button on the Move Company name button. A rubber
line drawn from the start of the name to the current mouse position shows the
potential new location of the name.
Click the left mouse button repeatedly to anchor and re-anchor the Company
name in a new location.
Click the right mouse button to return to the I/O box.
Press

Enter

to exit the I/O box.

Execute X-axis and make the Starting value 0.


Make the Ending value 12000.
Make the Tic label increment 2000.
Change the label from X-axis label to Distance(m).
Click the left mouse button on the Move All button. A rubber line drawn from
the midpoint of the axis to the current mouse position shows the potential
new location of the axis. Note that movement of the X-axis is restricted to
the vertical direction.
Move the mouse and click the left mouse button repeatedly to anchor and
re-anchor the axis in a new location.
Click the right mouse button to return to the I/O box.
Press

Enter

to exit the I/O box.

Execute Y-axis and make the Starting value 0.


Make the Ending value 9000.
Make the Tic label increment 1000.
Change the label from Y-axis label to Distance(m).
Click the left mouse button on the Move All button. A rubber line drawn from
the midpoint of the axis to the current mouse position shows the potential
new location of the axis. Note that movement of the Y-axis is restricted to
the horizontal direction.
Move the mouse and click the left mouse button repeatedly to anchor and
re-anchor the axis in a new location.
Click the right mouse button to return to the I/O box.

64

CHAPTER 7. GRID BUILDER DEMONSTRATION

Figure 7.5: Modified default plot


Click the left mouse button on the Move Label button. A rubber line drawn
from the midpoint of the label to the current mouse position shows the potential new location of the label. Note that movement of the label is restricted
to the horizontal direction.
Move the mouse and click the left mouse button repeatedly to anchor and
re-anchor the label in a new location.
Click the right mouse button to return to the I/O box.
Press

Enter

to exit the I/O box.

Execute Flags. A menu will appear which shows which entities are currently
being plotted.
Click the left mouse button on the Elements option to toggle the plot flag (i.e.
dont plot the elements). Note that you can also position the highlight with
the cursor keys and toggle the plot flag by pressing the F2 key.
Press Enter to exit the Flags menu. The screen will be re-drawn and should
resemble Figure 7.5.

7.9. QUITTING GRID BUILDER

7.9

65

Quitting GRID BUILDER

You can exit GRID BUILDER at any time. Before you do so you will be prompted
to save any changes to the grid data set.
Press

until you are back to the Main menu.

Esc

Execute Quit to exit the program. You should see the following prompt:
Are you sure you want to quit? Yes/No
Type Y or use
prompt:

Enter

to pick a yes response. You should see the following

Save changes to grid? Yes/No


Type Y or press Enter to pick a yes response. You will see the I/O box
which allows you to enter the file prefix, in this case mygrid.
Press

Enter

to use the current prefix. You will see the following prompt:
File exists...overwrite? Yes/No

Type

to pick a yes response. The grid data will be saved to disk.

You should now be back in DOS, in the directory C:\Program Files\gridbldr\demo.

7.10

Restarting GRID BUILDER with existing grid data

If the grid data for your particular problem was saved correctly, it is a simple matter
to retrieve it and continue working with it.
From the Command Prompt, issue the following command:
cd mydata
Start GRID BUILDER. You should see the title screen.
Press any key (e.g.

Enter

). You should see the Main menu.

Execute File/Get .GRD. You should see a list of files, in this case it will contain
only one item, mygrid.grd.
Press

Enter

to read this data. The screen should now resemble Figure 7.5.

66

CHAPTER 7. GRID BUILDER DEMONSTRATION

7.11

Assigning element property values

You can assign element property values for a subset of elements manually or by
using Kriging. Here, we will assign values to two portions of the mesh. These could
represent for example, aquifer hydraulic conductivity.
Execute Edit/Element/Pick and the screen will be redrawn with the chosen
elements indicated as filled, yellow triangles.
Execute Off to clear the chosen elements.
Execute Area and move the mouse into the upper righthand area at about
8800, 4800.
Click the left mouse button to choose the elements in this area.
Move the mouse to the lower righthand area at about 8800, 1800.
Click the left mouse button to choose the elements in this area. Note that
the effect of toggling elements is cumulative. This applies to most of the Pick
menu options.
Click the right mouse button to exit the Area procedure.
Press

Esc

to return to the Element menu.

Execute Assign and enter the value 1.e-4 in the I/O box.
Press

Enter

to exit the I/O box.

Execute Pick/Flip to toggle all the elements.


Press

Esc

to return to the Element menu.

Execute Assign and enter the value 1.e-5 in the I/O box.
Press

7.12

Enter

to exit the I/O box.

Examining property values using fills

When element or node properties are assigned as we did in the last section, the most
useful way to examine them is by using colour fills.
Execute Fill. You will get an I/O box which reports the number of discrete
values found, in this case 2, as well as some parameters which affect the colour
fill plot.

7.12. EXAMINING PROPERTY VALUES USING FILLS

67

Press Enter to accept the current defaults and a menu will appear which
contains a list of discrete values sorted in descending order of frequency of
occurence. Values which will be colour filled are marked with asterisks.
Press Enter to accept the current configuration. The screen will be re-drawn.
The 2 colours used to fill the elements denote which property value they were
assigned. The legend to the right of the grid shows which value is associated
with each colour. Currently they are both labelled 0.
Execute Fill to activate the I/O box again.
Click the left mouse button in the Fill bar label format field, which is a
pop-up menu consisting of available format options.
Press F2 or click the mouse on the dropdown arrow at the right end of the
field to pop-up the menu of choices.
Click the left mouse button on (1PE20.1). Note that you could also cycle the
menu using the cursor keys.
Press Enter twice to first exit the I/O box and then the fill value menu and
re-draw the plot. You should now see meaningful fill legend labels, but the
legend itself is too large and the name is poorly placed.
Execute Fill to activate the I/O box again.
Click the left mouse button in the Size fill bar field. A rubber box drawn
around the fill bar legend shows the potential new size of the legend.
Move the mouse and click the left mouse button repeatedly to anchor and
re-anchor the legend at its new size.
Click the right mouse button to return to the I/O box.
Click the left mouse button in the Move fill bar field. A rubber line drawn
from the centre of the fill bar legend to the current mouse position shows the
potential new location of the legend.
Move the mouse and click the left mouse button repeatedly to anchor and
re-anchor the legend in a new location.
Click the right mouse button to return to the I/O box.
Press Enter twice to first exit the I/O box and then the fill value menu and
re-draw the plot.
Execute Name and change Element property to Hydraulic conductivity.
Make the Property name angle value 0.0.

68

CHAPTER 7. GRID BUILDER DEMONSTRATION

Figure 7.6: Element property values shown using Fill


Click the left mouse button on the Move property name button. A rubber line
drawn from the centre of the name to the current mouse position shows the
potential new location of the name.
Move the mouse and click the left mouse button repeatedly to anchor and
re-anchor the name in a new location, above the fill bar legend.
Click the right mouse button to return to the I/O box.
Press Enter to exit the I/O box. The screen will be re-drawn and should
resemble Figure 7.6.
Execute Save eprop. You should see the I/O box which allows you to enter
the property name, which is written in the file with the property values and
is also used to create a meaningful file name.
Press Enter to accept the default Hydraulic conductivity and exit the I/O
box. The current element property values will be saved to the file mygrid.eprops.hydraulic conductivity.

7.13. GENERATING HARDCOPY

7.13

69

Generating hardcopy

Press
menu.

or click the mouse outside the regular menu to activate the Tool

F7

Execute Hardcopy/Adjust and you will see the I/O box which allows you to
modify the hardcopy driver option.
Press

F2

to pop-up the menu of available drivers.

Choose Normal Postscript.


Press

Enter

to exit the I/O box.

Execute File and the output will be written to a file called pic1.ps and plotted
on the screen simultaneously.

7.14

Defining field data

Field data consists of a set of points for which we have a location (X, Y coordinate)
and a value. These may be, but are not necessarily coincident with node locations.
They can be used to generate a set of node or element property values.
Press

Esc

three times to return to the Edit menu.

Execute Field data/Get field data. You should see a menu consisting of all
filenames in the current directory which have the extension .fld. In this case
there is one item, elevation.
Press Enter to read this data. The screen will be redrawn with the the field
data points shown with small crosses and elevations.
Press

7.15

Esc

to return to the Edit menu.

Generating node property values using kriging

Given a set of field data, we can use them as input to a kriging routine to generate
the node or element property values. In this demonstration, we will generate a set
of nodal property values.
Execute Node/Pick and the screen will be redrawn with the chosen nodes
coloured yellow. In this case all nodes are currently chosen.
Press

Esc

to return to the Node menu.

70

CHAPTER 7. GRID BUILDER DEMONSTRATION


Execute Krige/Go to start the Krigeing procedure. You will see an I/O box
which allows you to modify the Krigeing parameters.
Press Enter to accept the default data (including a linear semivariogram with
unit slope) and exit the I/O box. As each node property value is generated,
a countdown is shown in a message window along bottom of the screen, with
the final output being the time it took to complete the kriging procedure.
Press any key to close the message window.
Execute Result to contour the results. You will see an I/O box which allows
you to modify the contouring parameters.
Click the left mouse button on the Default contours button to generate more
meaningful contouring values.
Press

Enter

to exit the I/O box and contour the kriged nodal function.

Execute Error to contour the standard error of estimates. You will see an I/O
box which allows you to modify the contouring parameters.
Press Enter to accept the default contouring parameters, exit the I/O box
and contour the standard error of estimates.

7.16

Examining property values using contouring

Kriging normally produces a node or element property value function which is continuously variable. In this case contouring is more appropriate for examining the
values than the simple colour fill used earlier.
Press

Esc

to return to the Node menu.

Execute Contour. You will get an I/O box which reports the range of the
generated values and allows you to modify the contouring parameters.
Make the Contouring minimum value 0.
Make the Contouring maximum value 110.
Make the Contouring increment value 10.
Make the Plot colour fills? toggle Yes.
Make the number of contour labels 11.
Press Enter to return to the Node menu. The plot will be redrawn with the
node values represented by colour filled contours. A legend also appears which
shows the range associated with each colour.

7.16. EXAMINING PROPERTY VALUES USING CONTOURING

71

Execute Contour to re-activate the I/O box.


Click the left or right mouse button on the Colour bar size button. A rubber
box drawn around the fill bar legend shows the potential new size of the legend.
Move the mouse and click the left mouse button repeatedly to anchor and
re-anchor the legend at its new size. Make the legend shorter and narrower.
Click the right mouse button to return to the I/O box.
Click the left or right mouse button on the Move colour bar button. A rubber
line drawn from the centre of the colour bar legend to the current mouse
position shows the potential new location of the legend.
Move the mouse and click the left mouse button repeatedly to anchor and
re-anchor the legend in a new location. Move the legend down and to the
right.
Click the right mouse button to return to the I/O box.
Click the mouse on the Colour Bar Tic label format field and make it
(F20.0).
Click on the Move tic labels button. A rubber line drawn from the centre
of the colour bar labels to the current mouse position shows the potential new
location of the labels.
Move the mouse and click the left mouse button repeatedly to anchor and
re-anchor the labels in a new location. Move them to the left, closer to the
colour bar.
Click the right mouse button to return to the I/O box.
Press

Enter

to exit the I/O box.

Execute Name and change Node property to Elevation.


Click on the Move property name button. A rubber line drawn from the
centre of the name to the current mouse position shows the potential new
location of the name.
Move the mouse and click the left mouse button repeatedly to anchor and
re-anchor the name in a new location. Move it to the left of the colour bar.
Click the right mouse button to return to the I/O box.
Press

Enter

Press
menu.

F7

to exit the I/O box.


or click the mouse outside the regular menu to activate the Tool

Execute Plot/Flags.

72

CHAPTER 7. GRID BUILDER DEMONSTRATION

Figure 7.7: Node property values shown using colour contours


Click the left mouse button on the Field data markers and Field data values
options to toggle the plot flags (i.e. dont plot the field data values).
Press

Enter

to exit the Flags menu.

Execute Palette/Greyscale to switch to a monochrome palette.


Press Esc three times to return to the Node menu. The screen should now
resemble Figure 7.7.
Execute Save nprop. You should see the I/O box which allows you to enter
the property name, which is written in the file with the property values and
used to identify the contents at a later time.
Press Enter to accept the default Elevation, exit the I/O box and write the
nodal property data to the file mygrid.nprop.elevation.

7.17

Assigning boundary conditions

This section shows how to define a simple set of hydraulic head boundary condition
data for our problem. It is assumed that the right side is a river whose elevation

7.17. ASSIGNING BOUNDARY CONDITIONS

73

varies from 90 m at the bottom to 95 m at the top. The hole inside the grid is
assumed to be a pond with an elevation of 130 m.
Press

Esc

to return to the Edit menu.

Execute Boundary and the screen will be redrawn showing the current boundary conditions. By default they are all 2nd-type with value zero and shown as
filled grey circles.
Execute 1st-type/Segment and move the mouse to the lower right hand node
at about 12200, 1000.
Click the left mouse button to define the start of the boundary segment.
Move the mouse to the upper right hand node at about 12300, 7100 and click
the left mouse button to define the end of the segment. One possible set of
chosen nodes will be highlighted and you should see the prompt:
Correct nodes? Yes/No

Type

or press

Enter

to pick a yes response.

You should see the prompt:


Spatially distribute how? Uniform/Variable

Choose Variable as the distribution option. An I/O box will appear which
allows you to define the start value.
Make the Current value (i.e. start value) 90.
Press Enter to exit the I/O box. An I/O box will appear which allows you
to define the end value.
Make the Current value (ie. end value) 95.
Press Enter to exit the I/O box. The values will be interpolated and plotted along the chosen boundary segment. The nodes will be coloured blue to
indicate a first-type boundary condition.
Execute Plot parameters to activate the boundary condition plot parameters
I/O box.
Make the Plot boundary values? toggle Yes.
Press Enter to exit the I/O box. The plot will be redrawn with head values
plotted beside the 1st-type nodes.

74

CHAPTER 7. GRID BUILDER DEMONSTRATION


Press
menu.

F7

or click the mouse outside the regular menu to activate the Tool

Execute Zoom +/- and move the mouse to the middle of the lake, at about
2300, 4500.
Click the left mouse button and release it. The mesh is redrawn at about twice
its original size and with the lake in the centre of the screen. Click the mouse
once more in the middle of the lake to zoom in a bit more.
Click the right mouse to exit the Zoom +/- procedure and then press
return to the Boundary menu.

Esc

to

Execute 1st-type/Segment and move the mouse to 2200, 5100.


Click the left mouse button to define the start of the boundary segment, and
watch closely which node is selected. Although you were pointing at the node
at the top of the hole, the node to the left was chosen. This is because the
mouse precision is still set to 100, and the node closest to 2200, 5100 is the
one that was picked.
Press the right mouse button to abort the Segment procedure.
Press
menu.

F7

or click the mouse outside the regular menu to activate the Tool

Execute Mouse.
Make the mouse precision 10.0 in X and Y.
Press

Esc

to return to the Boundary menu.

Execute 1st-type/Segment and move the mouse to 2250, 5180.


Click the left mouse button to define the start of the boundary segment.
Move the mouse to 2130, 5150 and click the left mouse button to define the
end of the segment. One possible set of chosen nodes will be highlighted and
you should see the prompt:
Correct nodes? Yes/No

Type N or press Enter to pick a no response. A second possible set of


chosen nodes will be highlighted and you should again see the prompt:
Correct nodes? Yes/No

Type

or press

Enter

to pick a yes response.

7.17. ASSIGNING BOUNDARY CONDITIONS

75

You should see the prompt:


Spatially distribute how? Uniform/Variable

Choose Uniform as the distribution option. An I/O box will appear which
allows you to define the value.
Make the Current value 130.
Press Enter to exit the I/O box. The values will be assigned and plotted along
the chosen boundary segment. The nodes will be coloured blue to indicate a
first-type boundary condition.
Press
menu.

F7

or click the mouse outside the regular menu to activate the Tool

Execute Restore and the plot will be redrawn at full scale.


Press

Esc

to return to the Boundary menu.

Execute Save conditions and you will see the I/O box which allows you to enter
the current prefix.
Change the name from Boundary conditions to Flow.
Press Enter to exit the I/O box and save the boundary data to the file
mygrid.bc.flow.
You may want to produce an ascii file containing the current node numbers and
boundary condition values. Such a file could be used by a third-party finite
element program to define boundary conditions. Execute Export conditions
and you will see the I/O box which allows you to enter the exported boundary
condition name.
Press Enter to accept the current name, exit the I/O box and save the boundary data to the file called mygrid.bc exported.flow.
Press

Esc

twice to return to the Main menu.

Execute Quit to exit the program. You should see the following prompt:
Are you sure you want to quit? Yes/No

Type

or use

Enter

to pick a yes response.

76

CHAPTER 7. GRID BUILDER DEMONSTRATION

7.18

Importing results from a finite-element program

Before you can import data written by a finite-element program, the files should be
named according to the conventions used by GRID BUILDER. In this case, we have
supplied the files mygrid.nprop.flow2d head solution and mygrid.evec.flow2d
velocity vectors in the mydata directory. The first file contains a set of nodal
head data calculated by a 2-D aquifer simulation program using, as input, the grid
and flow boundary conditions produced earlier on in the demonstration. The second
file contains a set of element velocity vector data calculated by the same program.
Before you start this section you should make sure the current directory in the
command prompt window is:
c:\program_files\gridbldr\demos\mydata
Start GRID BUILDER. You should see the title screen.
Press any key (e.g.

Enter

). You should see the Main menu.

Execute File/Get. You should see a list of files, in this case it will contain only
one item, mygrid.grd.
Press

Enter

to read this data.

Execute Edit/Node/Get nprop. You should see the following menu of nodal
property names:
Elevation
flow2d head solution
Press

or

to highlight the option flow2d head solution.

Press Enter to read this set of data. A dialogue box informs you that default
contouring information has been generated for the data. Press Enter to continue. The screen will be redrawn and the heads will be displayed with simple
contours.
Execute Contour.
Make the Contouring minimum value 90.
Make the Contouring maximum value 200.
Make the Contouring increment value 5.
Change the Plot colour fills? toggle to Yes.
Make the Number of contour lables value 11.

7.18. IMPORTING RESULTS FROM A FINITE-ELEMENT PROGRAM

77

Make the Colour bar tic label format value (F20.0).


Press

Enter

to return to the Node menu.

Changes to the way the data are displayed, including krigeing parameters, can
be appended to the data file so that it appears the same way the next time
it is loaded. To do so execute Save nprop and you will see the I/O box which
allows you to define the property name. Press Enter to accept the name
flow2d head solution. You will see the following prompt:
File exists...overwrite? Yes/No

Type Y or press Enter to pick a yes response. The nodal property file
mygrid.nprop.flow2d head solution will be overwritten.
Press

Esc

to return to the Edit menu.

Execute Element/Vectors/Get vectors. You should see a menu with one item,
flow2d velocity vectors.
Press Enter to read this data. A dialogue box informs you that default vector plot parameter values have been generated for the data. Press Enter to
continue.
An I/O box appears which allows you to modify the velocity vector plot parameters. Press Enter to accept the default plot parameters. The screen will be
re-drawn with the velocity vectors, some of which have very large arrowheads.
Execute Edit to re-activate the I/O box.
Make the Arrowhead size factor value 0.2.
Press

Enter

to exit the I/O box.

Execute Legend. You should see an I/O box which allows you to modify the
reference vector.
Make the Reference vector value value 1.0.
Make the Reference vector format (F20.0).
Press

Enter

press

Esc

to exit the I/O box.


and you should see the prompt:
Save changes to element vector file? Yes/No

78

CHAPTER 7. GRID BUILDER DEMONSTRATION

Figure 7.8: Imported heads and velocity vectors


Type Y or press Enter to pick a yes response. You will see the I/O box which
allows you to define the vector name. Press Enter to accept the name flow2d
velocity vectors and exit the I/O box and then Type Y to overwrite the
file mygrid.evec.flow2d velocity vectors.
Press

Esc

to return to the Edit menu.

Execute Node.
Press

F7

or click the mouse outside a regular menu to activate the Tool menu.

Execute Refresh to update the screen image. The screen should now resemble
Figure 7.8.
Press

Esc

3 times to return to the Main menu.

Execute Quit to exit the program. You should see the following prompt:
Are you sure you want to quit? Yes/No

Type

or use

Enter

to pick a yes response.

7.19. IMPORTING OLD GRID DATA

7.19

79

Importing old grid data

We have supplied the file c:\program files\gridbldr\demos\agrid.imp. This


file contains an old set of grid data.
To return to the directory c:\program files\gridbldr\demos issue the DOS
command:
cd ..
Start GRID BUILDER. You should see the title screen.
Press any key (e.g.

Enter

). You should see the Main menu.

Execute File/Lists .IMP. You should see a list of files, in this case it will contain
only one item, agrid.imp.
Press Enter to read this data. You should see a window in which the results
of the import procedure are reported, and the prompt:
Does list include node numbers? Yes/No
Type

or use

Enter

to pick a yes response. You should see the prompt:

Does list include element numbers? Yes/No


Type

or use

Enter

to pick a yes response. You should see the prompt:

Read element area numbers? Yes/No


Type

or use

Enter

to pick a no response. You should see the prompt:

Plan view? Yes/No


Type

or use

Enter

to pick a yes response.

A message window reports the results of the import procedure. Press Enter
to close the message window. After the outer boundary is constructed, the
screen should resemble Figure 7.9.
Press

Esc

to return to the Main menu.

Execute Edit/Node/Relax. The screen will be redrawn once the procedure is


done and should now resemble Figure 7.10.
Press

Esc

twice to return to the Main menu.

Execute Quit to exit the program. You should see the following prompt:

80

CHAPTER 7. GRID BUILDER DEMONSTRATION

Figure 7.9: Original grid data

7.19. IMPORTING OLD GRID DATA

Figure 7.10: Relaxed grid data

81

82

CHAPTER 7. GRID BUILDER DEMONSTRATION


Are you sure you want to quit? Yes/No

Type Y or use
prompt:

Enter

to pick a yes response. You should see the following

Save changes to grid? Yes/No

Type

or press

Enter

to pick a no response.

This ends the GRID BUILDER demonstration.

Chapter 8

References
Davis, J.C., Statistics and data analysis in geology, 2nd edition, John Wiley and
sons, New York, 1986.
Pinder, G.F., and W.G. Gray, Finite element simulation in surface and subsurface
hydrology, Academic Press, New York, 1977
Huyakorn, P.S., and G.F. Pinder, Computational methods in subsurface flow, Academic Press, New York, 1983.

83

84

CHAPTER 8. REFERENCES

Appendix A

Importing DXF formatted


boundary data
A utility program called DXF2GB can be used to extract boundary geometry from
a file which has been saved in DXF format. To date, this utility has been used
successfully with DXF files created by ArcGIS and CorelDraw. The steps involved
using Coreldraw are:
1. scan a scaled image of the domain and import it into CorelDraw. It is important that the image be scaled accurately in the x and y directions. Vertical
exaggeration is allowed.
2. Define grid outer and inner boundaries using the freehand tool. Vertices defined in CorelDraw will become nodes in GRID BUILDER.
3. Arrange boundaries in Object Manager so that they are in the reverse order
to that required by the .DIG file. E.g. outer boundary first, inner boundary
which connects to outer boundary, inner boundary which connects to outer
boundary and first inner boundary etc. See Figure A.1.
4. Select all the grid boundaries
5. File Export as DXF format, selected only and name e.g. cs.dxf
6. Run DXF2GB on the file cs.dxf to create cs.ovr. The coordinates in this file
will be in inches so they must be scaled properly into user coordinates (e.g.
metres).
7. If the domain is a cross-section, edit the file cs.ovr and change the second line
from .true. to .false.
8. Run GRID BUILDER and choose Generate/Irregular/Import/Overlay .OVR.
9. Define a roughly rectangular outer boundary which contains the overlay as
dscribed in Section 2.4.1.4.
85

86

APPENDIX A. IMPORTING DXF FORMATTED BOUNDARY DATA

10. Choose Do to generate the mesh, No to Save grid generation data? prompt,
No to the Regenerate? prompt.accept it.
11. Choose Edit/Overlays/Enable and Edit/Overlays/Colour to show the overlays
for reference in the next steps.
12. Press F7 or click the left mouse button outside the regular menu to activate
the Tool menu. Choose Mouse and set the mouse precision to the finest possible
e.g. 0.00001 for both x and y.
13. Determine the coordinates in inches, of two points on the overlay, at the extreme ends (lower left and upper right) of the cross-section for which true
coordinates are known.
14. Create a file called cs.scl (in this case) which contains the following data:
-4.24947 -1.30418 0.0 ! lower left x, y, z in inches
0.0
125.2
0.0 ! lower left x, y, z in true coordinates
10.57883
3.44682 0.0 ! upper right x, y, z in inches
752.78
186.3
0.0 ! upper right x, y, z in true coordinates
.false. .false. false. ! log scaling in x, y, z

15. Run DXF2GB again. If present, the file cs.scl causes DXF2GB to scale the
coordinates accordingly. Copy the scaled cs.ovr to cs.dig.
16. Run GRID BUILDER and choose Generate/Import/Irregular/Auto-fix Digitized
.DIG and load cs.dig.
17. Choose Fix and remove short segments as necessary and save as a .GEN file.

87

Figure A.1: Defining boundaries in CorelDraw

Das könnte Ihnen auch gefallen