You are on page 1of 8

FISH in FLAC 3D Contents - 1

TABLE OF CONTENTS

1 FISH BEGINNER’S GUIDE


1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 - 1
1.2 Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 - 2

2 FISH REFERENCE
2.1 Introduction and Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1
2.2 FISH Language Rules, Variables and Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
2.2.1 Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
2.2.2 Reserved Names for Functions and Variables . . . . . . . . . . . . . . . . . . . . . . . 2-3
2.2.3 Scope of Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-9
2.2.4 Functions: Structure, Evaluation and Calling Scheme . . . . . . . . . . . . . . . 2-9
2.2.5 Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 11
2.2.6 Arithmetic: Expressions and Type Conversions . . . . . . . . . . . . . . . . . . . . . 2 - 13
2.2.7 Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 13
2.2.8 Redefining FISH Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 15
2.3 FISH Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 16
2.3.1 Specification Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 16
2.3.2 Control Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 18
2.3.3 FLAC 3D Command Execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 21
2.4 Linkages to FLAC 3D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 22
2.4.1 Modified FLAC 3D Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 22
2.4.2 Execution of FISH Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 23
2.4.3 FISHCALL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 27
2.5 Pre-defined Variables, Functions and Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 33
2.5.1 FLAC 3D-Specific Scalar Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 33
2.5.1.1 Use of Variable fos f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 35
2.5.2 General Scalar Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 37
2.5.3 FLAC 3D -Specific Model Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 38
2.5.3.1 Gridpoint Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 39
2.5.3.2 Zone Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 41
2.5.3.3 Determining Failure States of Zones . . . . . . . . . . . . . . . . . . . . . . . 2 - 47
2.5.3.4 Saving State Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 50
2.5.3.5 Strain and Rotation Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 52
2.5.3.6 Interface Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 55
2.5.4 Intrinsic Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 58

FLAC 3D Version 3.0


Contents - 2 FISH in FLAC 3D

2.5.5 Special Functions — Tables, Memory Access and Arrays . . . . . . . . . . . . 2 - 60


2.5.5.1 Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 61
2.5.5.2 Special Functions to Access Memory Directly . . . . . . . . . . . . . . 2 - 63
2.6 Structural Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 66
2.6.1 General Support Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 68
2.6.2 SEL Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 69
2.6.2.1 Beam Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 71
2.6.2.2 Cable Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 73
2.6.2.3 Pile Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 76
2.6.2.4 Shell Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 81
2.6.2.5 Geogrid Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 83
2.6.2.6 Liner Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 86
2.6.2.7 Stress-Recovery Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 89
2.6.3 Node Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 91
2.6.4 Link Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 94
2.7 FISH Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 98
2.7.1 FISH Plotting Routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 98
2.7.2 FISH I/O Routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 102
2.8 Socket I/O Routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 106
2.8.1 Example of Coupling between FLAC 3D and PFC 3D . . . . . . . . . . . . . . . . . 2 - 108
2.9 Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 115

3 LIBRARY OF FISH FUNCTIONS

FLAC 3D Version 3.0


FISH in FLAC 3D Contents - 3

TABLES
Table 1.1 Commands that directly refer to FISH names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4
Table 2.1 List of words in FLAC 3D and FISH that may conflict with chosen names . . . . 2-4
Table 2.2 String manipulation characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 15
Table 2.3 Assigned fishcall IDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 28
Table 2.4 Failure state . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 47
Table 2.5 Type designators of FISH functions and parameters . . . . . . . . . . . . . . . . . . . . . . . 2 - 66
Table 2.6 General support functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 68
Table 2.7 SEL support functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 69
Table 2.8 SEL property functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 70
Table 2.9 Beam property functions (1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 71
Table 2.10 Beam property functions (2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 71
Table 2.11 Beam response functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 72
Table 2.12 Cable property functions (1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 73
Table 2.13 Cable property functions (2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 74
Table 2.14 Cable property functions (3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 74
Table 2.15 Cable response functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 75
Table 2.16 Pile property functions (1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 76
Table 2.17 Pile property functions (2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 77
Table 2.18 Pile property functions (3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 78
Table 2.19 Pile property functions (rockbolt) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 79
Table 2.20 Pile response functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 80
Table 2.21 Shell property functions (1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 81
Table 2.22 Shell property functions (2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 82
Table 2.23 Shell response function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 83
Table 2.24 Geogrid property functions (1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 83
Table 2.25 Geogrid property functions (2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 84
Table 2.26 Geogrid property functions (3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 84
Table 2.27 Geogrid response function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 85
Table 2.28 Liner property functions (1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 86
Table 2.29 Liner property functions (2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 87
Table 2.30 Liner property functions (3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 87
Table 2.31 Liner response function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 88
Table 2.32 Stress-recovery functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 89
Table 2.33 Node support functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 91
Table 2.34 Node property functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 92
Table 2.35 Node response functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 93
Table 2.36 Link support functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 94
Table 2.37 Link property functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 95

FLAC 3D Version 3.0


Contents - 4 FISH in FLAC 3D

Table 2.38 Link response functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 96

FLAC 3D Version 3.0


FISH in FLAC 3D Contents - 5

FIGURES
Figure 2.1 Plot of log of incremental displacement against friction angle . . . . . . . . . . . . . 2 - 26
Figure 2.2 Sign convention for forces and moments at the ends of a beamSEL or pileSEL
(ends 1 and 2 correspond with order in nodal-connectivity list, and all
quantities are drawn acting in their positive sense) . . . . . . . . . . . . . . . . . . . . 2 - 73
Figure 2.3 Pressure contours and fluid flow vectors — FLAC 3D . . . . . . . . . . . . . . . . . . . . . 2 - 109
Figure 2.4 Initial velocity vectors, due to imposed pressure gradient
— PFC 3D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 110

FLAC 3D Version 3.0


Contents - 6 FISH in FLAC 3D

EXAMPLES
Example 1.1 Defining a FISH function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2
Example 1.2 Using a variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3
Example 1.3 SETting variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3
Example 1.4 Test your understanding of function and variable names . . . . . . . . . . . . . . . . 1-4
Example 1.5 Capturing the history of a FISH variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4
Example 1.6 FISH functions to calculate bulk and shear moduli . . . . . . . . . . . . . . . . . . . . . 1-6
Example 1.7 Using symbolic variables in FLAC 3D input . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-7
Example 1.8 Controlled loop in FISH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-8
Example 1.9 Applying a nonlinear initial distribution of moduli . . . . . . . . . . . . . . . . . . . . . 1-8
Example 1.10 Splitting lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-9
Example 1.11 Variable types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 - 10
Example 1.12 Action of the IF ELSE ENDIF construct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 - 11
Example 1.13 Automated placing of cable elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 - 11
Example 1.14 Sequence of excavation and cable placement . . . . . . . . . . . . . . . . . . . . . . . . . . 1 - 12
Example 2.1 Using the FISH identifier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3
Example 2.2 Initializing and printing FISH arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-8
Example 2.3 Construction of a function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-9
Example 2.4 A recursive function call . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 10
Example 2.5 Removing recursion from the function shown in Example 2.4 . . . . . . . . . . . 2 - 10
Example 2.6 Evaluation of variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 11
Example 2.7 Control of interactive input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 14
Example 2.8 Usage of the CASE construct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 18
Example 2.9 FISH function with generic mesh-handling capability . . . . . . . . . . . . . . . . . . 2 - 24
Example 2.10 Using string variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 25
Example 2.11 Controlling a FLAC 3D run . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 25
Example 2.12 Listing of “FISHCALL.FIS” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 29
Example 2.13 Illustration of fishcall use . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 29
Example 2.14 Example use of fishcall 14 and fishcall 15 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 31
Example 2.15 Example use of fos f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 35
Example 2.16 “Result.out” file, after execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 37
Example 2.17 “FAILURESTATES.FIS” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 48
Example 2.18 Determining failure states of zones . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 49
Example 2.19 Use of save and restore functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 50
Example 2.20 Strain calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 53
Example 2.21 Insertion sort of 20 random numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 64
Example 2.22 Scanning through the linked list of nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 67
Example 2.23 Using the FISH plotting extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 100
Example 2.24 Using the FISH I/O functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 104

FLAC 3D Version 3.0


FISH in FLAC 3D Contents - 7

Example 2.25 Server log file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 107


Example 2.26 Client log file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 108
Example 2.27 “FF.DAT” — initialization of FLAC 3D data . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 111
Example 2.28 “FFR.DAT” — FLAC 3Dfile to pass data to PFC 3D . . . . . . . . . . . . . . . . . . . . . . 2 - 111
Example 2.29 “PF.DAT” — initialization of PFC 3Ddata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 112
Example 2.30 “PFR.DAT” — PFC 3Dfile to receive data from FLAC 3D . . . . . . . . . . . . . . . . 2 - 113

FLAC 3D Version 3.0


Contents - 8 FISH in FLAC 3D

FLAC 3D Version 3.0

You might also like