FISH Scripting in PFC

FISH is an embedded scripting language that enables the user to interact with and manipulate PFC models, defining new variables and functions as needed. These functions may be used to extend PFC's usefulness or add user-defined features. For example, new variables may be plotted or printed, special particle generators may be implemented, virtual servo controls may be applied to perform a numerical lab test, unusual distributions of properties may be specified and parametric studies may be automated.

FISH was developed in response to users who wanted to do things with Itasca software that were either difficult or impossible with existing program structures. Rather than incorporate many new and specialized features into PFC, FISH was provided so that users could write functions to perform custom analyzes. FISH functions may range from a few lines of code to a multitude of complex data files containing hundreds of lines of code.

FISH programs are simply embedded in a normal PFC data file: lines following the word "define" are processed as a FISH function; the function terminates when the word "end" is encountered. Functions may invoke other functions, which may invoke others, and so on. The order in which functions are defined does not matter, so long as they are all defined before they are used (e.g., invoked by a PFC command). Since the compiled form of a FISH function is stored in PFC's memory space, the "save" command saves the function and the current values of associated variables.

In the following simple example, a FISH function uses the loop structure to execute the loop body while the test condition is true; otherwise, control passes to the next line after the endloop statement.

define sum_even(n)
local s = 0
local i = 0
loop while i <= n
s += i
i +=2
endloop
sum_even = s
end
[s2 = sum_even(10)]
list @s2

With n=10, the end result of the sum is 30.

A much more advanced example of FISH scripting, particles float down a channel with a given velocity and fall into a mixing drum with rotating paddles. FISH scripting is used to apply additional forces (vertical buoyancy), based on an imaginary water level, to each particle to better simulate the system.


Últimas noticias
  • Itasca has announced the release of FLAC2D v9 Itasca has announced the release of FLAC2D v9, revolutionizing the way we analyze and predict...
    Leer mas
  • Primer Anuncio 6º Simposio Itasca sobre Modelado Numérico Aplicado se llevará a cabo del 3 al 6...
    Leer mas
  • 6th Itasca Symposium on Applied Numerical Modeling The next Itasca Symposium will take place June 3 - 6, 2024, in Toronto, Canada....
    Leer mas

Próximos Eventos
18 abr.
Python in Itasca Software
... Leer mas
29 may.
Getting Started with FLAC2D/FLAC3D
Objectives of the training: •Understand the FLAC2D/ FLAC3D numerical approach and the types ofproblems it can solve•Know how to manipul... Leer mas
5 jun.
IMAT IMMERSIVE TRAINING
ITASCA is launching IMAT (Itasca's Mining Analysis Toolbox) our groundbreaking software tailored exclusively for underground and open p... Leer mas