4
8/20/2019 F2D401 http://slidepdf.com/reader/full/f2d401 1/4 PROGRAM GUIDE  4-1 4 PROGRAM GUIDE 4.1 Linked-List Sizes and Offsets As mentioned in Section 2.5.7,  FISH  programs have access to some of  FLAC ’s linked-list data structures. The global pointers to these data structures are provided as  FISH  scalar variables. The sizes of the various data blocks and the offsets of items within the blocks are contained in a series of files supplied with  FLAC . These files have the extension “.FIN” (for Fish  INclude file); they provide symbolic names for sizes and offsets and current numerical values (which may change in future versions of  FLAC ).* The “.FIN” files serve two purposes: first, they document the meanings of the various data items; second, the files may be  CALLed from a data file – they automatically execute and define appropriate symbols. The symbols are all preceded by the $ sign,sothattheyare invisible to the casual user who gives a  PRINT fish command. The  FISH  programmer may simply use numbers for offsets (as done in the example of Section 2.5.7), or the programmer may use the symbols provided in the “.FIN” files. It is better to specify offsets in symbolic form because the resulting  FISH  program will work correctly with future versions of  FLAC , in which offsets and block sizes may be different. (Every effort will be made by Itasca to retain the same symbolic names in future versions of  FLAC .) The following list provides the names of  FISH  scalar pointers and file names for each type of data structure. Table 4.1 Global pointers and include file names Global pointer File name Data structure app pnt app.fin lists of  APPLY data att pnt att.fin lists of  ATTACHed points ieb pnt ieb.fin data associated with  IEB int pnt int.fin interface list data str pnt str.fin structural data trac pnt trk.fin data associated with  TRACK logic udm pnt udm.fin user-defined model data By calling “.FIN” files, some memory overhead is incurred, since all the offsets for a particular data structure are stored in memory; typical additional memory requirement is between 500 and 1000 words per file. * The “.FIN” files are contained in the “\FISH\4-ProgramGuide” directory. FLAC Version 7.0

F2D401

Embed Size (px)

Citation preview

Page 1: F2D401

8/20/2019 F2D401

http://slidepdf.com/reader/full/f2d401 1/4

PROGRAM GUIDE   4 - 1

4 PROGRAM GUIDE

4.1 Linked-List Sizes and Offsets

As mentioned in Section 2.5.7,   FISH   programs have access to some of   FLAC ’s linked-list datastructures. The global pointers to these data structures are provided as  FISH  scalar variables. Thesizes of the various data blocks and the offsets of items within the blocks are contained in a seriesof files supplied with   FLAC . These files have the extension “.FIN” (for Fish  INclude file); theyprovide symbolic names for sizes and offsets and current numerical values (which may change infuture versions of  FLAC ).* The “.FIN” files serve two purposes: first, they document the meaningsof the various data items; second, the files may be   CALLed from a data file – they automaticallyexecute and define appropriate symbols. The symbols are all preceded by the $ sign, so that they areinvisible to the casual user who gives a  PRINT fish command. The  FISH  programmer may simplyuse numbers for offsets (as done in the example of  Section 2.5.7), or the programmer may use thesymbols provided in the “.FIN” files. It is better to specify offsets in symbolic form because the

resulting   FISH  program will work correctly with future versions of   FLAC , in which offsets andblock sizes may be different. (Every effort will be made by Itasca to retain the same symbolicnames in future versions of  FLAC .)

The following list provides the names of  FISH  scalar pointers and file names for each type of datastructure.

Table 4.1 Global pointers and include file names

Global pointer File name Data structure

app pnt app.fin lists of   APPLY dataatt pnt att.fin lists of   ATTACHed points

ieb pnt ieb.fin data associated with IEB

int pnt int.fin interface list data

str pnt str.fin structural data

trac pnt trk.fin data associated with TRACK logic

udm pnt udm.fin user-defined model data

By calling “.FIN” files, some memory overhead is incurred, since all the offsets for a particular datastructure are stored in memory; typical additional memory requirement is between 500 and 1000

words per file.

* The “.FIN” files are contained in the “\FISH\4-ProgramGuide” directory.

FLAC Version 7.0

Page 2: F2D401

8/20/2019 F2D401

http://slidepdf.com/reader/full/f2d401 2/4

 4 - 2 FISH  in FLAC 

4.2 Example “.FIN” File

The form of data in a “.FIN” file is illustrated in the following example, which lists the contents of “INT.FIN.”

 Example 4.1 Interface structure file – “INT.FIN” 

def $int fin

;Interface parameters: include-file for FISH program 

;--------------------

;Global pointer to list of control blocks: INT PNT

;Block sizes

;-----------

$nwinco = 16 ;Control block (one for each interface)

$nwindi = 21 ;Interface node block

;Control block

;-------------

; 0 Link to next control block

$kicext = 1 ;Spare extension (can be used by FISH)

$kicapt = 2 ;Pointer to list of "A-side" nodes

$kicbpt = 3 ;Pointer to list of "B-side" nodes

$kicatp = 4 ;Type of A-side contact: 0 = grid; 1 = beam.

$kicbtp = 5 ;Type of B-side contact: 0 = grid; 1 = beam.

$kicfri = 6 ;Friction angle in degrees

$kiccoh = 7 ;Cohesion (stress units)

$kicbon = 8 ;Tensile strength$kicglu = 9 ;1 i f glued; 0 if n ot

$kicid = 10 ;ID number

$kicks = 11 ;Shear stiffness (stress/disp)

$kickn = 12 ;Normal stiffness

$kictph = 13 ;Tan(friction angle)

$kicdil = 14 ;Tan(dilation angle)

$kicxxx = 15 ; Unused

;Node block

;----------

; 0 Link to next node block

$kidext = 1 ;Spare extension (can be used by FISH); ----- grid connection ----- ----- beam connection ----

$kidi = 2 ;I index of associated g.p. ID of structural node

$kidj = 3 ;J index of associated g.p. = 0 for beam connection

$kidadd = 4 ;Address of g.p. Address of structural node

$kidfn = 5 ;Normal force

$kidfs = 6 ;Shear force

FLAC Version 7.0

Page 3: F2D401

8/20/2019 F2D401

http://slidepdf.com/reader/full/f2d401 3/4

PROGRAM GUIDE   4 - 3

$kidun = 7 ;Unit normal vector (2 words)

; = 8 "

$kidslf = 9 ;1 if slipping; 0 if not

$kidseg = 10 ;Pointer to nearest opposing node block

$kidrlk = 11 ;Reverse node pointer ("down" if material is to right)$kidbfl = 12 ;Bond flag: 1 if tension bond unbroken; 0 if broken

$kidrat = 13 ;Ratio of contact position:

; = 1.0 ... exactly at position of opposing node

; < 0.0 ... to left of opposing node (material below)

; > 0.0 ... to right " " " "

$kidlen = 14 ;Effective length of contact

$kidsxx = 15 ;Initial xx-stress

$kidsxy = 16 ;Initial xy-stress

$kidsyy = 17 ;Initial yy-stress

$kidx = 18 ;X coordinate; for plotting purposes only - updated

; infrequently

$kidy = 19 ;Y coordinate - ditto -$kidass = 20 ;Accumulated shear slip (used for dilation)

$kidasd = 21 ;Accumulated relative shear displacement (marker only)

$kidand = 22 ;Accumulated relative normal displacement (marker only)

end

$int fin

In order to illustrate the way this file is used, the example of  Section 2.5.7 is repeated, but withsymbolic names substituted for offsets given previously as integers. The program operation isidentical.

 Example 4.2 Accessing FLAC’s data structure via a “.FIN” file

set log

set echo off

call int.fin

set echo on

g 10 11

 m e

prop dens 2000 sh 1e8 bu 2e8

 m n j=6

ini x add 2.5 y add -0.9 j=7,12

int 4 aside from 1,6 to 11,6 bside from 1,7 to 11,7

int 4 kn 5 e8 k s 2.5e8 f ric 1 0

set grav 10,5 large

fix x y j=1

step 1

def make list

ip = int pnt

FLAC Version 7.0

Page 4: F2D401

8/20/2019 F2D401

http://slidepdf.com/reader/full/f2d401 4/4

 4 - 4 FISH  in FLAC 

loop while ip # 0

imem(ip+$kicext) = get mem(3) ;get storage buffer

ip = imem(ip)

end loop

end make list

def save data

 while stepping

ip = int pnt

loop while ip # 0 ;scan interfaces

ii = imem(ip+$kicext)

loop nside (1,2) ;scan 2 sides

caseof nside

case 1

ispt = imem(ip+$kicapt)

case 2

ispt = imem(ip+$kicbpt)endcase

loop while ispt # 0 ;scan nodes on one side

if abs(fmem(ispt+$kidfn)) > fmem(ii) then

fmem(ii) = abs(fmem(ispt+$kidfn))

imem(ii+1) = ispt

imem(ii+2) = step

end if

ispt = imem(ispt)

end loop

end loop

ip = imem(ip)

end loop

end

def sho data

ip = int pnt

loop while ip # 0

ii = imem(ip+1)

s1 = ’ max-Fn = ’+string(fmem(ii))+’, ’

ig = imem(imem(ii+1)+2)

jg = imem(imem(ii+1)+3)

s2 = ’ g.p.(’+string(ig)+’,’+string(jg)+’)’

s3 = ’ at step ’+string(imem(ii+2))

?? = out(s1+s2+s3)

ip = imem(ip)

end loop

end

step 500

sho data

FLAC Version 7.0