0% found this document useful (0 votes)
24 views12 pages

Fish Flac

CODIGO FISH

Uploaded by

Charles Ruiz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views12 pages

Fish Flac

CODIGO FISH

Uploaded by

Charles Ruiz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

FISH - The programming language

of FLAC
FISH (1)

FISH is a compiler. Functions are entered via a data file and


are translated into a list of instructions stored in the memory
space of the code.

Variable names and values are available for monitoring and


changing at any time.
FISH (2)
Common ways to use FISH:

1. Special-purpose operations; e.g., grid generation, profile of


material properties, automation of input commands, plot or
print user-defined variables.

2. Use as a HISTORY variable.

3. Automatic execution during stepping; e.g., use as a servo-control for


numerical test (with WHILE_STEPPING command).

4. Drive a data file; e.g., change parameters while calculation


progresses (using COMMAND statements).

5. Use as a constitutive model function; e.g., apply a user-written


constitutive model.
FISH Variables, Functions and Operations

FISH handles definitions of:

• User-defined variables or function names.


• Pre -defined scalar variables.
• Grid variables (e.g., stresses, properties).
• Intrinsic functions.
• Tables, general memory access.

Some remarks
FISH is case-insensitive. All characters after a semi-colon (;) are ignored.
If parameters are to be passed to functions, then they must be set beforehand
by using the SET command.
If a number is expected in FLAC, it can be substituted by FISH symbols.
As soon as a variable is mentioned in a valid FISH program line, it is
globally recognized both in FLAC commands and FISH code.
FISH Control Statements (1)

DEF <name>
To define a FISH function ...
END

Conditional statements
CASE_OF expr IF expr 1 test expr 2
··· ···
CASE n ELSE
··· ···
END_CASE END_IF

‘Looping’ statements

LOOP var (expr1, expr2) LOOP WHILE expr1 test expr 2


··· ···
END_LOOP END_LOOP
FISH Control Statements (2)

Sectioning statements

SECTION
···
END_SECTION

COMMAND
···
END_COMMAND

EXIT
EXIT SECTION
FISH Specification Statements

WHILESTEPPING (execution of the function at every FLAC step)


WHILE_STEPPING

CONSTITUTIVEMODEL (the function is taken to be a new constitutive model)


CONSTITUTIVE_MODEL

INT (change the type of the associated variable)


FLOAT
STRING

ARRAY var(n1, n2) (definition of an array)


FISH Functions

Mathematical functions Message functions


atan atan2 cos in out
exp tan ln
log sin sqrt Random generator
abs max min grand urand
sgn
Logical operators
Type conversion and not or
float int string
type Others
fc_arg get_mem lose_mem
Tables
xtable ytable table

Memory Access
imem fmem
FISH Editor

The FISH Editor allows you to create and edit text files that contain FISH functions.

FISH functions defined in this way can be executed using the UTILITY/FishLib tool
if they are stored within the /flac/gui/fishlib directory. You can also run FISH
functions directly using the Run/Execute menu item from the FISH Editor.
To automate the execution of FISH functions, special comment lines are included in
the file. There are four types of input field:

1. Name: This is the name of the primary FISH function to run.


(A file can have more than one FISH function.)

2. Diagram: This is the name of an optional file name of an image (GIF/JPG)


that shows what the FISH function does.

3. Input: This contains the input values for the function.

4. Note: This contains notes and comments that describe the FISH function.
FISH Input Parameter Data

The Input/Define parameters menu item brings up a dialog that allows input
parameters to be defined. These will have values requested when the FISH
function is run either through the FISH Library (using the UTILITY/FishLib tool),
or executed here.

The input parameters for FISH functions are entered as a comment string of the
form:

;Input: name/type/value/description

in which

1. Name - FISH variable name.

2. Type - int/float/string corresponding to data type:


integer, floating-point or string.

3. Value - Default value for parameter.

4. Description - Helpful string describing what the parameter is.


FISH Notes

The Input/Define notes menu item brings up a text area where comments
can be saved.

Here you can describe the FISH function and these comments will be shown when
you try to execute the function from either the FISH Editor or the FISH Library
(using the UTILITY/FishLib tool).

These lines are added to a FISH file as comments prefixed by [Note:]


FISH Library

The directory flac/gui/fishlib/ contains files with FISH functions accessed from the
UTILITY/FishLib tool.

These FISH functions have special comment lines included to allow the GIIC to identify
input parameters, notes and diagrams.

The directory structure inside flac/gui/fishlib/ is mirrored in this tool as a tree structure.

You might also like