Application Builder Updates

For users of the Application Builder, COMSOL Multiphysics® version 5.4 brings custom Settings windows and dialog boxes in the Model Builder, command line arguments, and form editor updates. Read about all of the Application Builder updates in detail below.

Custom Settings Windows and Dialog Boxes

Application Builder forms can now be used in the Model Builder, by creating a Settings Form or showing them as dialog boxes. This allows you to create your own Settings windows or dialog boxes in the Model Builder that can perform complex operations on your model, using your own custom-made user interface. You can create multiple instances of your forms as Settings Forms in the same model, allowing you to use independent settings for each node. This is possible thanks to new functionality to create methods and declarations local to forms, in addition to the existing global versions. These can also be used for apps to make the app more structured and easier to maintain.

To use this functionality, go to the Application Builder and select Show in Model Builder in the checkbox in the form's Settings window. Then, the forms are accessible in the Developer tab of the Model Builder.

A demonstration of using the Settings Form in the COMSOL Multiphysics Model Builder.

A Settings Form in the Model Builder (the form can be seen in the next image). Settings Forms and dialog boxes are added from the new Forms section of the Developer ribbon tab.

A Settings Form in the Model Builder (the form can be seen in the next image). Settings Forms and dialog boxes are added from the new Forms section of the Developer ribbon tab.
A demonstration of creating a settings form using the solve_form.

The solve_form used to create the settings form in the previous image, which uses form declarations as the source for its form objects, seen in the Application Builder tree on the left.

The solve_form used to create the settings form in the previous image, which uses form declarations as the source for its form objects, seen in the Application Builder tree on the left.

Command Line Arguments

Let users of your app supply command line arguments as inputs when launching the app. Command line arguments are automatically written to the declarations you reference inside the Application Builder, and can be used to, for example, supply input data or configuration settings. This can be used for compiled applications, but also when launching the app together with COMSOL Multiphysics® or COMSOL Server™. To call a compiled app you write, for example:

myapp.exe -appargnames freq -appargvalues 400
for an app that has an input argument freq that takes a numeric value 400 (a double, in this case).

The corresponding command using COMSOL Multiphysics® would be:
comsol.exe -run myapp.mph -appargnames freq -appargvalues 400

With COMSOL Server™, you simply provide the arguments directly in the URL: http://<host:port>/app/myapp_mph?appargnames=freq&appargvalues=400

An example of setting up an input argument with the Application Builder. Setup of an input argument for the target frequency.
Setup of an input argument for the target frequency.
An example of supplying a command line argument for an app. The target frequency supplied as input to a compiled version of the app.
The target frequency supplied as input to a compiled version of the app.

Form Editor Updates

There are a number of improvements to various form objects. Material colors, as well as the new selection colors (see COMSOL Desktop®), can be displayed in the graphics form object. For buttons, there is a new "Flat" style as well as support for setting the background color (not supported on the Linux® operating system and macOS). There is also an option to center the application on your screen at startup.

You can see these updates in the following apps:

An example of a simulation app with flat buttons. The Tuning Fork app using flat buttons.
The Tuning Fork app using flat buttons.