FISH is a scripting language embedded within UDEC that allows you to create new model variables, customized functionality and interact with the model. FISH was developed in response to requests from users who wanted to do things with Itasca software that were either difficult or impossible to do with existing program structures. Rather than incorporate many new and specialized features into the standard software, an embedded language was provided so that users could write their own functions. For example, FISH functions can be written to:

  • Prescribed unusual property distributions within the model;
  • Calculate, plot and print user-defined variables;
  • Implement custom model geometries and joint generators;
  • Simulate numerical tests of servo-control material strength testing (e.g., UCS, triaxial, shear);
  • Specify unusual boundary conditions (variations in time and space); and
  • Automate parametric and sensitivity studies.

FISH functions can be simply defined anywhere in a UDEC data file. For example, the function abc will execute a simple mathematical expression when called.

define abc

abc = 22 * 3 + 5


Functions may invoke other functions, which may invoke others, and so on. The order in which functions are defined does not matter, as long as they are all defined before they are called. A compiled form of every FISH function in UDEC’s memory space and the current values of associated variables are all stored as part of a UDEC save file. FISH variables can be called directly, embedded symbolically into UDEC commands and called at any stage of the calculation cycle.

The FISH scripting language incorporates:

  • Integer, floating and string variable types;
  • Data arrays;
  • Pre-defined UDEC model variables (block, contact, boundary, gridpoint, zone, structural elements, etc.);
  • Customizable user-variables;
  • Intrinsic math, trigonometric, table and logic functions (clock, cos, sqrt, urand, pi, max, etc.);
  • Conditional statements (if, else, case);
  • Control loops;
  • Input and output statements and text boxes;
  • ASCII and binary data file import, export and parsing functions;
  • Data exchange between two or more Itasca software running simultaneously;
  • Embedded commands; and
  • Embedded user-comments.

FISH functions can be as simple as the previous example, more advanced as shown below or they can be made up of combinations of hundreds of other FISH functions comprising thousands of lines of code. Although the latter can be quite complicated, it can be remarkably powerful, providing users tremendous flexibility and control in their modeling. This example automatically places cable structural elements into a model from a center point along an arc.

FISH Editor Pane

FISH functions can be (1) manually entered into the record, (2) written using a third-party text editor and called, imported or pasted into the record or (3) written and edited using the built-in FISH editor pane. A FISH function created with the latter can be executed directly from the FISH editor.

The editor is divided into three tabbed views. A new FISH function can be written, or an existing function can be opened, in the FISH editor view. Input parameters for the function are specified in the Parameters view. Reference information and a bitmap image to describe the function can be entered via the Information view. The FISH function can either be executed as a CALL file in the UDEC model or the contents of the function can be echoed directly in the Console and Record panes, interrupted, or saved. Should an error occur during execution, an error message will be shown in the Console output area to help identify the cause of the error. Corrections can then be made directly in the Editor text area, and the function executed again. Once you are satisfied that the function is working properly, you can include the function in the UDEC project record tree by pressing OK at the bottom of the FISH editor pane. The function then will be executed and incorporated in the current branch of the project tree and the FISH editor will be deactivated.

Latest News
  • ARMA 2022 Student Design Competition Congratulations to the winners of the American Rock Mechanics Association's (ARMA) 2022 Student Design Competition....
    Read More
  • International Slope Stability 2022 Itasca is proud to be a Diamond sponsor of Slope Stability 2022 (October 17-21 |...
    Read More
  • Software Benchmark Tests To help with your hardware configuration decisions, Itasca has created an online benchmark speed test...
    Read More

Upcoming Events
27 Mar
FLAC3D In-Person Introductory Course
Live in-person introductory training course. This 3-day course provides general feature training addressing basic concepts and recommen... Read More
30 Mar
Griddle In-Person Introductory Course
Live in-person introductory training course. This course provides an overview of the capabilities and features of Rhino3D CAD software ... Read More
3 Apr
FLAC2D In-Person Introductory Course
Live in-person introductory training course. This 3-day course provides a general overview of FLAC2D and covers many basic concepts and... Read More