Application Builder Updates

For users of the Application Builder, COMSOL Multiphysics® version 6.1 provides functionality for creating apps with resizable subwindows, the ability to display all Selection types in the Graphics form object, and support for creating apps in multiple languages. Read more about these updates below.

Resizable Subwindows

You can now create apps with resizable and detachable subwindows. This new functionality is available in a set of new templates, accessible from the New Form Wizard or inside the Main Window Editor. The new layout tool for subwindows makes it easy, for example, to make space for a plot by simply dragging the divider with the mouse to adjust the space.


The Main Window Editor for subwindows is similar to grid mode in the Form Editor. The Lithium Battery Pack Designer app is used to show how to change the size of subwindows by dragging the divider. There is also an option to make forms in subwindows closable, as shown where the Help window has been closed.


Subwindows also have the ability to be moved around while an app is running. This lets users adapt the layout to their personal preference. A built-in Reset Window Layout command can be used to quickly restore the original layout. The ability to move subwindows around is available in Windows®, macOS, and Linux® and when using COMSOL® Client, but is not supported when running apps in a web browser.


The Organ Pipe Design app with three subwindows is used to show how to rearrange forms (while the app is running) to display all plots at the same time. To temporarily focus on a specific form, you can double-click the tab in order to maximize it, as shown with the Pipe Resonance Frequencies form.

You can view the new subwindow features in these existing applications:

Display All Selection Types

In Graphics form objects, you can now use all types of selections as sources, including selections generated by geometry or mesh sequences. Selections that are not of the Explicit type are shown in read-only mode.

The Application Builder UI showing the Settings window with the Extrude node highlighted and a Graphics window overlapped.
An Extrude operation selected in a Graphics form object, shown with an electric motor model in the Graphics window.

Localization

You can now easily create apps in multiple languages using the new functionality for localization. To create language files for an app, you supply resource files that map the text used in the Application Builder to translated versions in the languages of your choice. The app user's language preference will then be automatically applied when running the app. Alternatively, the user can include a specific language setting in the app itself. In the Application Builder, all the text that is defined by the app author can be automatically translated this way, including, for example, titles, labels, and tooltips, as well as input to built-in methods like alert or error. It is also possible to translate custom strings from method code by using the new translate method. This can be useful if you want to translate, for example, plot titles, reports, or other settings from the Model Builder. You can see an example of this feature in the Tubular Reactor with Nonisothermal Cooling Jacket application.

Arrays in Form Objects

It is now possible to select individual components in a vector as the source in many form objects. In addition, input fields support double array sources.

Error Indicators

The Form Editor and Main Window Editor can now display error indicators, which are useful when identifying problems such as missing sources in apps. This is particularly important when working with apps that have many forms and form objects. Forms containing form objects with errors now display an error indicator in the Application Builder tree.

The Application Builder UI showing the tree, Form Editor window with input fields, and the Settings window.
Error indicators shown in the water treatment basin app, where one parameter has been removed.

Form Editor

There are several improvements in the Form Editor:

  • In Windows®, the web browser and video form objects support a Chromium-based web browser control, in addition to Internet Explorer.
  • You can convert between local and global forms, either through copy-paste or drag-and-drop.
  • The Image form object has an option to stretch the image to fit the available space in its cell in grid mode. This avoids having to resize the image in an image editing software.
  • An On focus gained event lets you run methods when the corresponding form object becomes focused by the app user.
  • The Application theme and Image export theme settings can be changed from a running app, giving the app user the ability to switch between the light and dark themes. In Windows®, this takes effect immediately, while in macOS, Linux®, and a web browser, the app must be saved and restarted for the change to take effect. It is no longer necessary to open the app in the Application Builder in any of these cases, as was the only option in previous versions.
  • Entries in the File Library, Images Library, and Sounds Library can now be replaced, making them easier to update.
  • A Vertically scrollable setting can be used for forms displayed in subwindows, tabbed form collections, and dialog boxes. When cleared, the form will never include a vertical scrollbar. Instead, the scrollbar will appear on the form objects inside the form, when applicable. This is particularly useful for large tables, as it lets the app user scroll inside the table, keeping the header and toolbar visible while still letting the table fill the available space. This also enables better performance.
  • Inputs and outputs are separate in the New Form Wizard in order to make it possible to create more tailored forms. In previous versions, this separation into inputs and outputs was already available in the Editor Tools window.

The Application Builder UI showing the tree, the Form Editor window with two images, and the Settings window.
Image form object with stretch disabled (left) and enabled (right).

Method Editor

There are several improvements and new utility methods in the Method Editor:

  • Copy as code to clipboard supports multiselect.
  • The Run option in the Application Builder, used to run a specific method, has a keyboard shortcut, F8.
  • The default toString methods that convert doubles to strings now use the number of significant digits rather than the number of decimals. toString(double value, String template) can still be used to achieve the decimal behavior. For example, toString(double value, "%.2f") can be used for two decimals.
  • declaration methods can be used to retrieve the list of declarations, either global or local, to a specific form.
  • getType is available for retrieving the type of declarations.
  • The saveApplicationAs and saveApplicationOnServerAs methods return a boolean value. If the return value is false, the app user canceled the operation and the application was not saved. In addition, there is an optional boolean argument to control whether the app user should be prompted with a confirmation dialog box before saving.


Linux is a registered trademark of Linus Torvalds in the U.S. and other countries. macOS is a trademark of Apple Inc., registered in the U.S. and other countries. Microsoft and Windows are trademarks of the Microsoft group of companies.