PyRun

class PyRun

Runs Python statements from inside MOOSE.

proc

void (shared message field) This is a shared message to receive Process messages from the scheduler objects.The first entry in the shared msg is a MsgDest for the Process operation. It has a single argument, ProcInfo, which holds lots of information about current time, thread, dt and so on. The second entry is a MsgDest for the Reinit operation. It also uses ProcInfo.

setRunString()

(destination message field) Assigns field value.

getRunString()

(destination message field) Requests field value. The requesting Element must provide a handler for the returned value.

setInitString()

(destination message field) Assigns field value.

getInitString()

(destination message field) Requests field value. The requesting Element must provide a handler for the returned value.

setMode()

(destination message field) Assigns field value.

getMode()

(destination message field) Requests field value. The requesting Element must provide a handler for the returned value.

setInputVar()

(destination message field) Assigns field value.

getInputVar()

(destination message field) Requests field value. The requesting Element must provide a handler for the returned value.

setOutputVar()

(destination message field) Assigns field value.

getOutputVar()

(destination message field) Requests field value. The requesting Element must provide a handler for the returned value.

trigger()

(destination message field) Executes the current runString whenever a message arrives. It stores the incoming value in local variable named input_, which can be used in the runString (the underscore is added to avoid conflict with Python's builtin function input). If debug is True, it prints the input value.

run()

(destination message field) Runs a specified string. Does not modify existing run or init strings.

process()

(destination message field) Handles process call. Runs the current runString.

reinit()

(destination message field) Handles reinit call. Runs the current initString.

output

double (source message field) Sends out the value of local variable called output. Thus, you can have Python statements which compute some value and assign it to the variable called output (which is defined at reinit call). This will be sent out to any target connected to the output field.

runString

string (value field) String to be executed at each time step.

initString

string (value field) String to be executed at initialization (reinit).

mode

int (value field) Flag to indicate whether runString should be executed for both trigger and process, or one of them

inputVar

string (value field) Name of local variable in which input balue is to be stored. Default is input_ (to avoid conflict with Python's builtin function input).

outputVar

string (value field) Name of local variable for storing output. Default is output