FreeFem++ model element

FreeFem++ defines a script that can be run on a external FreeFem++ program

The element encapsulates access to FreeFem++ either installed in your computer or running on a server.

Usage

To add a FreeFem++ element to your model, drag the icon element to the list of your model elements and edit the desired script. The script can make use of the following predefined method:

The element implements the following basic methods:

For more information, consult the EJS Javadoc documentation for objects in the org.colos.freefem package. It is also convenient that you add the following import statement to your simulation Imports field: org.colos.freefem.*.

No further customization is required if the server URL, username, and password were provided in the element's editor.

Alternatively, you can choose to control directly the connection. In this case, you can use the following methods.

Example of use

ScriptOutput output = freeFem.runScript(); // runs the script in the editor
if (output!=null) {
  _println ("Script was successful and its output contains: "+ output.getPlotCount()+" PLOT commands");
}