2 Grid Generation: 2.1 General Comments
2 Grid Generation: 2.1 General Comments
2 Grid Generation: 2.1 General Comments
2 GRID GENERATION
Unlike many modeling programs based on the finite element method, FLAC organizes its zones (or
“elements”) in a row-and-column fashion, like a crossword puzzle. We refer to a particular zone
by a pair of numbers (its row and column numbers) rather than by an arbitrary ID number, as in
finite element programs. Although the numbering scheme resembles that of a crossword puzzle,
the physical shape of a FLAC grid need not be rectangular: the rows and columns can be distorted
so that the boundary fits some given shape; holes can be made in the grid; and separate grids can be
stuck together to create more complicated bodies. Furthermore, the zones can vary in size across
a grid. This section describes the various ways FLAC grids can be made to fit the physical shapes
that are to be modeled.
When fairly simple shapes are to be modeled, FLAC ’s grid scheme is very easy to use and interpret.
For one thing, printed output (such as a list of zone stresses) is arranged on the page in a way that
corresponds closely with positions in physical space. In contrast, finite element output is arranged
arbitrarily. The advantages tend to vanish, however, as the objects to be modeled become more
complicated. Some degree of skill is needed to set up complex grids.
With any numerical method, the accuracy of the results depends on the grid used to represent
the physical system. In general, finer meshes (more zones per unit length) lead to more accurate
results. Furthermore, the aspect ratio (ratio of height to width of a zone) also affects accuracy.
When creating grids with FLAC, remember that the greatest accuracy is obtained for a model with
equal, square zones. If the model must contain different zone sizes, then a gradual variation in
size should be used for maximum accuracy; this factor is important enough that a special option is
provided in the GENERATE command whereby zone sizes can be arranged to increase or decrease
by a constant ratio along any grid line. As a general rule, the aspect ratio of a zone should be kept
as close to unity as possible: anything above 5:1 is potentially inaccurate. Section 3.2 in the User’s
Guide provides some guidelines for choosing zone sizes and shapes, and some justification for the
rules just given. The purpose of this section is to show the reader what tools are available for grid
generation, and how to use them effectively.
The discussion and examples provided in this section use the command-line approach to data input
to FLAC. You are encouraged to work through the examples in this section to become familiar with
the principles used for grid generation in FLAC.*
* The data files in this section are all created in a text editor. The files are stored in the directory
“ITASCA\FLAC700\Datafiles\Theory\2-Grid” with the extension “.DAT.” A project file is also
provided for each example. In order to run an example and compare the results to plots in this
section, open a project file in the GIIC by clicking on the File / Open Project menu item and
selecting the project file name (with extension “.PRJ”). Click on the Project Options icon at the top
of the Project Tree Record, select Rebuild unsaved states, and the example data file will be run, and
plots created.
Creation of grids, especially for complex model shapes, is greatly assisted by the graphical interface
(the GIIC – see Section 2.2.1 in the User’s Guide and the FLAC-GIIC Reference volume). All
the operations described in this section can be achieved via the GIIC. In addition, a grid library
is provided; it contains grid objects commonly used in geomechanics: dam, retaining wall, tunnel,
etc. The library objects are a useful starting point when constructing a model.
A “virtual-grid” generation mode is also provided in the GIIC to facilitate grid creation. See
Section 1.2.1 in the FLAC-GIIC Reference for a description of the virtual-grid mode of grid
generation.
shifts the whole grid by 10 units in the x-direction. Combinations of these operations can be entered
on a single line. For example, the input line
ini x mul 2, y mul 2, x add 10
will enlarge the existing grid by a factor of two, and then shift it ten units in the x-direction. Note
that negative multiplication factors should not be used on coordinates because the “sense” of the
grid will be reversed, causing negative zone areas. This will trigger an error message later on, when
a STEP command is given.
The INITIAL command can also be used to relocate individual gridpoints or all the gridpoints along
a row or column. For example, the nonuniform grid of Figure 2.1 can be produced with the data
file in Example 2.1:
The command
initial x=0.7 i=2
sets all x-coordinates on the vertical grid line i = 2 equal to 0.7 units. Similarly, the command
initial y=2.4 j=3
sets all y-coordinates on the horizontal grid line j = 3 equal to 2.4 units. Note that the MODEL
elastic command is not necessary for the process of changing coordinates, but it is given in order
to render the grid visible when it is plotted via a PLOT grid command. If no model is specified, a
“null” model, which plots as an empty space, is assumed.
An effect similar to that of Figure 2.1 can be obtained with less effort by using the ratio parameter
with the GENERATE command:
Figure 2.2 Nonuniform grid, using the ratio keyword with the GENERATE
command
In this grid, the widths of successive zones in the x-direction are increased by a factor of 1.2, and
the heights of successive zones in the y-direction are increased by a factor of 0.8 (i.e., decreased).
On the matter of syntax, the brackets enclosing the ratio keyword and its parameters are optional:
they are simply included for cosmetic reasons (see Section 1.1.1 in the Command Reference).
The GENERATE command has many more options than implied by the previous example. There are
two main forms of the command. The first form produces quadrilateral zoning, in which a region
between two i-lines and two j -lines is distorted into a quadrilateral shape. The general form is
gen x1,y1 x2,y2 x3,y3 x4,y4 <ratio ri rj> <range>
The four pairs of coordinates denote the four corners of the quadrilateral region of space taken in a
clockwise direction, starting with the gridpoint with the lowest i and j numbers in the range. Inter-
mediate points are distributed with even spacing along each i-line and j-line. If a non-rectangular
geometry is required, then the ratio keyword can be used in a manner similar to the one used in the
previous example. The commands in Example 2.3 produce the grid of Figure 2.3.
Note the use of the same parameter for the first corner, which stays in its original place (at the
origin). In this case, no range is given, which causes FLAC to apply the generation logic to all
gridpoints.
When range parameters are given to the GENERATE command, several different quadrilateral regions
can be created within the grid, as Example 2.4 illustrates (see Figure 2.4).
Figure 2.4 Two differently zoned regions produced by two GENERATE com-
mands
The region to the left of the slope is “excavated” by declaring the appropriate zones to be null.
Before moving on to the second form of the GENERATE command, note that almost any grid can
be constructed by moving individual gridpoints so that the grid conforms to the required external
and internal shapes. For example, the horseshoe-shaped tunnel of Figure 2.5 can be constructed by
moving appropriate gridpoints and deleting the interior zones using Example 2.5.
The procedure used in constructing the grid of Figure 2.5 is good for coarse grids, but several
difficulties arise when grids become finer. First, it is annoying to have to provide a large number
of INITIAL commands when the required shape is simple, like a circle or line. Second, deletion of
unwanted zones is tedious when the area to be removed does not lie between a contiguous block of
i-lines and j -lines. Finally, specification of pressure or stress on the created boundary is difficult
when the boundary does not lie along a single grid line, or has an irregular geometry. To help
overcome these problems, the GENERATE command can take several keywords (line, circle, arc and
table) which act like multiple INITIAL commands along their range of influence. They also cause all
of the affected gridpoints to be marked. This string of marks identifies the created boundary as a
single entity that can be addressed by a single command when removing zones, assigning properties
or applying stresses.
The keywords line, circle, arc and table specify lines or curves that may be closed or may have
endpoints. The gridpoints that are nearest to a given line or curve are relocated so that they lie on
the line or curve. Surface gridpoints are not affected, and marked gridpoints are also avoided in the
process of relocation. The general form of each keyword is as follows:
gen line x1,y1 x2,y2
gen circle xc,yc rad
gen arc xc,yc xs,ys theta
gen table n
where x1,y1 and x2,y2 are the starting and ending points of the line, xc,yc are the center coordinates
of the arc or circle, rad is the circle radius, xs,ys are the starting coordinates of the arc, and theta is
the counterclockwise angular span of the arc in degrees. The value n of the table keyword refers to
a table of (x,y)-coordinates that has been prepared using the TABLE command.
The horseshoe-shaped tunnel in Figure 2.6 is created by the sequence of commands in Example 2.6.
The tunnel is similar to that in Figure 2.5, but the grid is much finer.
Note that only the top of the tunnel is created with the arc keyword; the affected gridpoints are
marked, as explained above. In order to excavate the material in the tunnel with one command,
a contiguous series of marked gridpoints must exist all around the tunnel. To do this, the MARK
command is used three times. The region keyword then causes all zones within the region bounded
by marked gridpoints to be converted to null; to address the region, any zone within the region
can be mentioned (in this example, it was (6,6)). Although the region logic was used to change
the constitutive model, it can also be used to change the properties within the region or initialize
variables, such as stress – e.g.,
prop shear=1234.5, reg=7,7
ini sxx=-1e6 reg=8,8
These commands change the shear modulus and set the x-stress, respectively, within the region.
The keyword circle is used in a way similar to the way arc is used, in order to create an enclosed
circular region. Note that is possible to produce an ellipse by first stretching the grid, then creating
a circle, and finally returning the grid to its original shape. Figure 2.7 shows the result of giving
the commands in Example 2.7
The GENERATE line command relocates gridpoints that lie along the track of a single line with
given endpoints. At this stage, gridpoints will not, in general, attach themselves to the endpoints
of a line or an arc unless existing gridpoints lie very close to the given endpoints. For example, if
two lines are supposed to meet at a common point, a nearby gridpoint should be moved there first.
Figure 2.8(a) illustrates the effect of two lines with a common endpoint but lacking a corresponding
gridpoint. The data file is given in Example 2.8:
By moving gridpoint (4,6) to the common point with an INITIAL command, we get the intended grid
of Figure 2.8(b), as illustrated by Example 2.9:
The grid may be further “improved” by adding a GENERATE adjust command. Figure 2.8(c) shows
how the changes in the shape of adjacent zones are made less abrupt.
If a surface that consists of many connected line segments is needed, then the GENERATE table
command may be useful. For example, the grid of Figure 2.8(b) may be produced directly by the
sequence in Example 2.10:
Here we predefine the sequence of points by means of a table, and then invoke the same table
in the GENERATE command. Sometimes the GENERATE table command is not very clever at
relocating gridpoints near the joints in the line segments, so some manual help may be needed.
The GENERATE table command can be used almost like a boundary element specification, since
only a list of boundary points is needed. The grid of Figure 2.9 is produced from the data set in
Example 2.11; note that the last point is identical to the first point, in order to generate a closed
curve.
Figure 2.9 Using the table keyword with the GENERATE command
When generating internal boundaries with the line or table option, it is important to note that at
least two zone widths should lie between neighboring line segments. Otherwise, unpredictable
things happen. For example, the “excavated” region of Figure 2.9 is about five zones in width
– the generation process is well-behaved. If it is necessary to have very thin gaps between lines
of relocated gridpoints, then it is advisable to zone up this region by hand, and do the rest with
several applications of the GENERATE command. There are some geometries that just cannot be
constructed with an array of quadrilaterals when the required detail is fine enough. The question
to be asked is “Is the detail really necessary to the overall problem?”
The automatic generation scheme is not foolproof: there are some circumstances in which the
resulting grid is not what was intended. In general, the boundary generators should only be used
when many gridpoints lie along the desired boundary; the scheme is not appropriate for relocating
only two or three gridpoints at a time. In this case, the points should be moved individually by using
INITIAL x, y commands, as described previously. Even when most of the gridpoints on a surface are
satisfactorily relocated by the automatic generator, the two endpoints may have to be adjusted by
hand with the INITIAL command, especially if they lie on an outer boundary. This is the case in the
next section, which is concerned with accommodating interfaces in a grid.
Consider the case of a biaxial test sample that contains a steeply dipping joint (Figure 2.10(a)).
The joint is represented in FLAC by an INTERFACE, which requires two boundaries separated by
null zones. In general, the FLAC grid should be viewed as a series of discrete blocks bounded by
the required interfaces – each block is zoned separately and then moved to be in contact with the
others. See Section 3 for more details. In the example of Figure 2.10(a), the single joint creates
two blocks. These are generated as follows, beginning with the commands in Example 2.12, with
the resulting grid shown in Figure 2.10(b).
The two badly placed endpoints can be moved, with the commands in Example 2.13, to produce
the grid in Figure 2.10(c).
Finally, the top block is moved down to meet the bottom block, and the two blocks are “joined” by
an interface using the commands in Example 2.14 (see Figure 2.10(d)).
The adjust operation is then applied to the central part of the interface example; the ends are left
alone by MARKing the appropriate gridpoints, using the commands in Example 2.15. (Recall that
marked gridpoints are ignored by the GENERATE command.)
Figure 2.10(e) illustrates the result of this operation. When several interfaces are needed, the
following procedure should be used. First, determine the number and shape of discrete blocks that
are bounded by the set of joints. Second, allocate part of the FLAC grid to each of the blocks,
making sure that there is a buffer strip of at least one zone in width between blocks. Then, generate
the required geometry for each block separately. Finally, move the blocks together if this has not
already been done in the generation phase. This process is explained more fully in Section 3.3.
Quite complex shapes can be created by attaching several sub-grids together with the ATTACH
command. Before attempting to do this, make a plan of the way the sub-grids are to be extracted
from the initial grid provided by the GRID command. The procedure is like cutting rectangles of
paper from a large sheet and then arranging them together in a different way. Each sub-grid must not
share gridpoints with any other sub-grid (i.e., there must be a “buffer region” at least one zone wide
between neighboring sub-grids). Once the sub-grids have been mapped out, they can be deformed,
relocated and attached to other sub-grids.
A good use of the ATTACH logic is to provide a well-graded boundary region around a finely
zoned central region of interest. The input sequence in Example 2.16 produces the grid shown in
Figure 2.11.
In this case, a 40 × 80 strip of zones is wrapped around the central region by means of four
GENERATE commands. The “tail” of the strip is then attached to the “head.” The strip is also
attached to the central block at all points on the inner surface of the strip.
Two sub-grids may be attached together even if the number of gridpoints on the opposing boundary
paths are not equal. However, the number of segments on one side must be an integral multiple
of the number of segments on the other. The term “segment” here denotes the chord joining two
adjacent gridpoints on a boundary. For example, there may be 3 segments (4 gridpoints) on the
first side and 6 segments (7 gridpoints) on the second side. In this case, the first, third, fifth and
seventh gridpoints on the second side will be attached perfectly to their counterparts on the first
side. The remaining gridpoints on the second side are “slaved” to the two nearest perfectly attached
gridpoints on the same boundary, using linear weighting for forces and velocities. In the general
case, every Nth gridpoint is attached perfectly to its opposing counterpart, where N is the integral
ratio of segments between the two sides.
Two boundaries may be attached in this way even if the opposing gridpoints are not at the same
location, but a warning message will be issued for each pair that does not coincide. In this case,
the slaved gridpoints still function as described above, but the weighting factors will be derived
from the slave’s projection onto the chord joining the two nearest perfectly attached gridpoints.
Great care should be taken when setting up attached boundaries in which the gridpoint spacing
varies; always make a plot or printout to verify that the attachment has been made as intended. The
command PRINT attach lists both perfectly attached groups and slaved gridpoints. The PLOT attach
command only indicates perfectly attached gridpoints.
Example 2.17 illustrates the use of the ATTACH command when joining boundary paths with unequal
numbers of gridpoints. The example is unrealistic, but it serves to illustrate how a complicated series
of connections can be made. In particular, the attachment of the lower, right-hand sub-grid illustrates
that two or more ATTACH commands may be needed if the integral ratio varies along a boundary
path that is to be attached. In this case, part of the boundary has a two-to-one ratio and the remainder
has a three-to-one ratio. Thus, two ATTACH commands are needed, even though the two opposing
sub-grid boundaries are contiguous. After stepping, the results exhibit reasonable symmetry (see
Figure 2.12), which illustrates that coarse grids are adequate for regions that are remote from strain
concentrations.
LEGEND
X-displacement contours
-4.00E-04
-3.00E-04 1.250
-2.00E-04
-1.00E-04
0.00E+00
1.00E-04 0.750
2.00E-04
3.00E-04
4.00E-04 0.250
0 1E 1
Itasca Consulting Group, Inc.
Minneapolis, MN 55401
0.250 0.750 1.250 1.750 2.250 2.750 3.250 3.750
(*10^1)
The ability to match unequal grids gives the user more flexibility in creating graded meshes. It
is quite convenient to use a radially graded grid to provide the boundary conditions for a single
tunnel. However, it is difficult to extend this approach to multiple tunnels that interact with each
other. Example 2.18 creates a grid that is constructed such that each tunnel has its own fine grid
for good local accuracy, but the interactions and boundary conditions make use of the coarse grid.
Figure 2.13 shows the grid.
Example 2.18 Multiple tunnels with fine and coarse grids attached
grid 77 50
mod elas
prop dens 2000 she 5e8 bulk 1.5e9
mod null i=21 28 j=13,20 ; region 1
mod null i=16,23 j=27,34 ; region 2
mod null i=39,46 j=22,29 ; region 3
mod null i=1,60 j=46,50 ; ... not used
mod null i=61 ; carve out inserted blocks
mod null j=17 i=61,77
mod null j=34 i=61,77
; Now insert blocks ...
gen 20.0,12.0 20.0,20.0 28.0,20.0 28.0,12.0 i=62,78 j=1,17
gen 15.0,26.0 15.0,34.0 23.0,34.0 23.0,26.0 i=62,78 j=18,34
gen 38.0,21.0 38.0,29.0 46.0,29.0 46.0,21.0 i=62,78 j=35,51
attach as long from 21,13 to 29,13 bs long from 62,1 to 78,1
attach as from 21,13 to 29,13 bs from 62,1 to 78,1
attach as long from 16,27 to 24,27 bs long from 62,18 to 78,18
attach as from 16,27 to 24,27 bs from 62,18 to 78,18
attach as long from 39,22 to 47,22 bs long from 62,35 to 78,35
attach as from 39,22 to 47,22 bs from 62,35 to 78,35
gen circ 24.0 16.0 2.0
mod null reg 70,9
gen circ 19.0 30.0 2.0
mod null reg 70,26
gen circ 42.0 25.0 2.0
mod null reg 70,43
ini sxx=-1e6 syy=-3e6 szz=-2e6
fix x i=1
fix x i=61
fix y j=1 i=1,61
fix y j=46 i=1,61
solve
plo xdisp fill int 2.5e-4 grid hold
JOB TITLE : MULTIPLE TUNNELS WITH FINE AND COARSE GRIDS ATTACHED (*10^1)
LEGEND
4.500
11-Jan-11 16:05
step 1326
-3.333E+00 <x< 6.333E+01
-1.083E+01 <y< 5.583E+01 3.500
Grid plot
0 2E 1
2.500
1.500
0.500
-0.500
Figure 2.13 Multiple tunnels with fine and coarse grids attached
Using a biaxial initial stress field, the resulting x-displacement contours are shown in Figure 2.14.
For comparison, the same geometry was set up with a uniform grid, using the same mesh size as
the fine region of Figure 2.13 throughout. The results, shown in Figure 2.15, are very similar to
those of the Figure 2.13 grid, but the execution time is more than 4.5 times slower.
JOB TITLE : MULTIPLE TUNNELS WITH FINE AND COARSE GRIDS ATTACHED (*10^1)
LEGEND
4.500
11-Jan-11 16:05
step 1326
-3.333E+00 <x< 6.333E+01
-1.083E+01 <y< 5.583E+01 3.500
X-displacement contours
Contour interval= 2.50E-04
Minimum: -1.25E-03
2.500
Maximum: 1.25E-03
Grid plot
0 2E 1
1.500
0.500
-0.500
Figure 2.14 x-displacement contours for fine and coarse grids attached
LEGEND
4.500
11-Jan-11 16:05
step 2091
-3.333E+00 <x< 6.333E+01
-1.083E+01 <y< 5.583E+01 3.500
X-displacement contours
Contour interval= 2.50E-04
Minimum: -1.25E-03
2.500
Maximum: 1.25E-03
Grid plot
0 2E 1
1.500
0.500
-0.500
It is not meaningful to apply velocity boundary conditions or fix conditions to slaved gridpoints,
because such gridpoints are controlled by their nearest attached neighbors. However, forces may
be applied to slaved gridpoints.
If all zones surrounding an attached gridpoint (slaved or not) are set to the null model, the attach
condition will still persist, even though such gridpoints will not participate in calculations. However,
if real models are restored to the null zones, the previous attach conditions will be reactivated. There
is no way to “unattach” gridpoints.
Sometimes FLAC ’s built-in grid generators will not be able to produce a desired geometry. A
series of INITIAL commands can always be used to specify locations of individual gridpoints if all
else fails. This can be tedious if every x- and y-point must be specified individually, but it is often
possible to write a program that generates the grid automatically using the built-in programming
language FISH (see Section 2.4.2 in the FISH volume). For example, the data file in Example 2.19
includes a FISH program that produces a grid for a thick-walled cylinder.
The FISH program consists of a user-defined function called donut which, when invoked with the
appropriate settings, produces the grid shown in Figure 2.16. See Section 3 in the FISH volume
for other types of grid generation FISH functions.