fish callback command

Syntax

fish callback keyword

Add/remove functions to be executed in response to callback events.

Note

The whilestepping expression inside a FISH function automatically inserts the FISH function into the cycle sequence at f = -1.0.

The callback mechanism allows for the FISH function sf to be executed at a specific point in the cycle sequence during cycling — at point f in the sequence (if supplied) or when a specific callback event occurs (see the fish list callbacks command for a list of events).

Three types of events can trigger the execution of a FISH function: 1) model entity creation/deletion; 2) contact model events;[1] and 3) solve termination events. In cases 1) and 2), values may be returned to sf as arguments, provided that sf takes arguments.

In case 1), the first argument passed to sf is a pointer to the entity that has been created or deleted. In case 2), the arguments depend on the contact model implementation. [CS: removing the following until it is true] and are detailed in :flag:nomenclature

If the remove keyword is given, then the first instance of sf is removed. [CS: removing the following until it is true] See the :flag:tuto_callbacks for examples of callback usage.

add sf keyword

Adds a FISH function to be called. When the function is called depends on the following keywords:

f <keyword>

The FISH function will be called every step at the location in the cycle sequence given by f. The following keywords are available to reduce the frequency of the callback.

interval i

If specified, then the function will only be called every i steps.

process keyword

If specified, then the function will only be called if the process indicated is active during that particular cycle.

creep

The callback will only execute if the creep and mechanical process is active.

dynamic

The callback will only execute if the dynamic and mechanical process is active.

fluid

The callback will only execute if the fluid process is active.

mechanical

The callback will only execute if the mechanical process is active.

thermal

The callback will only execute if the thermal process is active.

event s

The FISH function will be called in response to the event named s.

remove sf <keyword>

Removes a FISH function callback. If no further keywords are specified, the function will be removed wherever it is found.

f

The first callback found at location f in the cycle is removed. If the function has been entered multiple times only one entry will be removed.

event s

The first callback found associated with the event s is removed. If the function has been entered multiple times only one entry will be removed.


Footnotes

Footnotes

[1]Contact model events are only pertinent in PFC.