Working with a Form and Using the Form Wizard
You can start working with a form and access the Form ribbon toolbar in the following ways:
If the Link with Editor button () in the Application Builder window’s toolbar is selected: Click a Form node in the application tree.
Double-click a Form node, or right-click it in the application tree and select Edit ().
To create a new global form or layout, click the New Form button (). Then, use the wizard in the window that opens.
The wizard takes you through the following steps.
Select Template
The first step when creating a new global form or layout is to select from the following form templates on the Select Template page:
Blank form () — An empty form without any content (the default).
Basic () — A template with a ribbon at the top, a form collection with sections to the left, and a graphics object.
Subwindows ()—  A template with a ribbon at the top, detachable subwindows below with sections to the left, and a single graphics object.
Single form () —  Create a new single form by adding inputs, outputs, buttons, and graphics.
Ribbon, tabs, and graphics () —  A template with a ribbon at the top, a form collection with tabs to the left, and a graphics object, using a subwindow layout.
Toolbar, sections, and graphics () —  A template with a toolbar at the top, a form collection with sections to the left, and a graphics object.
Button, section, and graphics () —  A template with a subform with buttons at the top, a form collection with sections to the left, and a graphics object.
Compact layout for tablets () — A basic template for designing apps to be used on tablets or laptops with small screens. The template consists of a top menu with large buttons, inputs and outputs to the left, and a graphics object.
Advanced compact layout for tablets () — A template for designing apps to be used on small screens such as tablets or laptops. The template consists of a top menu with four large buttons and horizontal lines. The active top menu item is highlighted with bold text in blue, and the horizontal line below the button is highlighted in blue and has an increased thickness. A click on a button in the top menu activates two card stacks. The first card stack contains a toolbar with items to plot in the graphics object at the bottom while the second card stack can be used to add inputs, settings, and results.
Compact layout for smartphones () — A basic template for designing apps to be used on small screens such as smartphones. The template consists of a top menu with two toolbars, a form collection with tabs, and a graphics object at the bottom.
Advanced compact layout for smartphones () — A template for designing apps to be used on small screens such as smartphones. The template consists of a top menu with four buttons that become highlighted when clicked. A click on a button in the top menu buttons activates two card stacks. The first card stack contains a toolbar with items to plot in the graphics object at the bottom while the second card stack can be used to add inputs, settings, and results.
If you do not want to display the built-in form templates, in the Preferences dialog box, on the Forms page under Application Builder, clear the Show COMSOL layout templates in the Form Wizard check box.
You can also define your own form templates. See Creating User-Defined Form Templates.
When you have chosen a form template, click the Content button to move to the Select Content page, or click Done to exit the wizard and generate the form’s components that you have defined. Click Cancel to exit the form wizard.
Select Content
On this page, you create a new form with basic form objects (components). For all added form objects, the Preview section to the right displays what the form will look like. You can change the label for the form in the Form title field and its name in the Form name field. Select the Labels on top check box to put the labels for input fields and data display objects above the input or display instead of to the left of it. You can make additional adjustments and modifications in the form later.
Under these settings, a number of tabs appear for defining buttons, inputs, outputs, and results, depending on the selected template. For example, click the Inputs tab to add input fields where users can type in values of parameters used as inputs (and other form objects of a read/write type). Click the Outputs tab to create data displays for presenting numerical results, for example (and other form objects of read-only type). Under Available, you can select applicable variables defined for the application under Declarations, any parameter in the model under Global Definitions, and any variable in the model under Component>Definitions to define an input field. You can also add other model properties using Data Access. Depending on the property, the input becomes a label and a text field, check box, or combo box. The default labels are the descriptions defined for the parameters and variables. If possible, the wizard creates an input field with the setting Append unit to number. You can also choose any evaluated value in the model under Results>Derived Values to display as numerical data and Table and Evaluation Group nodes (with tabulated data from derived values). Press Enter, double-click the selected input or output, or click the Add Selected button to add the input field or data display to the form and the list under Selected. Press Enter, double-click, or click the Remove Selected button to remove an item from the Selected list. On the Inputs, Outputs, and Results tabs, for example, you can also add, edit, and remove forms.
Click the Buttons tab or any other tab for buttons to add buttons to the form. By default, the added buttons are large buttons. You can add buttons for the following actions that the user can perform in the application for the Model branch:
Under Component, add Plot Geometry to add a button for updating a plot of the geometry or Plot Mesh to add a button for updating a plot of the mesh.
Under Component, add Plot Mesh to add a button for updating a plot of the mesh.
Add Compute Study to add a button for computing the study (running a simulation as defined by that study and presenting a default plot of the solution).
Under Results, add plot buttons for plotting each plot group defined in the model (Plot Stress, for example, for a Stress plot group that plots stresses in a solid mechanics model). Such a button sends the plot to a graphics window in the application. You can also add buttons for exporting data for nodes under Export.
Under Forms, add a Show form1 button (), for example, to create a button to show any of the existing forms in the application.
Under GUI Commands>File Commands you can add the following buttons for file-related operations:
-
Save Application button (), to save the application with the current name.
-
Save Application As button (), to save the application (with extension .mph) with a new name.
-
Save Application on Server button (), to save the application on the server with the current name.
-
Save Application on Server As button (), to save the application (with extension .mph) on the server with a new name.
If the application is run on COMSOL Server, the Save Application on Server and Save Application on Server As commands save the current application as a new application in the COMSOL Server Application Library.
-
Open File button (), to open a file in an application.
-
Save File As button (), to make it possible to choose and download a file to the client application.
-
Exit Application button (), to exit from the application.
Under GUI Commands>Graphics Commands, you can add these additional buttons for graphics-related properties and operations:
-
Zoom Extents button () to make it possible to zoom in to the extents of the plotted object or geometry.
-
Zoom to Selection button () to make it possible to zoom in to the extents of the plotted object or geometry.
-
Reset Current View button (), to make it possible to reset the current view in the graphics window to the view that you get when starting the application.
-
Scene Light button (), to add scene light to a graphics window.
-
Environment Reflections button (), to add the appearance of a reflective surface using a texture image.
-
S how Skybox button (), to add a skybox, providing an illusion of distant surroundings.
-
Rotate Environment button (), to be able to rotate the graphics environment.
-
Transparency button (), to make 3D graphics objects transparent.
-
Orthographic Projection button (), to switch to an orthographic projection.
-
Print button (), to print the contents of a graphics object.
-
Select All button (), to select all objects in the graphics window.
-
Clear Selection button (), to clear the selection for all objects in the graphics window.
-
Show Selection Colors button (), to show selection colors for all objects in the graphics window.
-
Show Material Color and Texture button (), to show color and texture for the materials used for all objects in the graphics window.
For all graphics commands, add the name of the Graphics object that you want to apply the command to as an argument.
Under GUI Commands>Main Window Commands, you can add a Reset Window Layout button () to add a button for resetting the app window’s layout, which is useful for an app with resizable subwindows.
Under GUI Commands>Model Commands, you can add these buttons for model-related operations:
-
Clear All Solutions button (), to clear all solutions in an application.
-
Clear All Built Meshes button (), to clear all built meshes in an application.
Double-click or click the Add Selected button to add the button to the form and the list under Selected. Double-click or click the Remove Selected button to remove an item from the Selected list.
Finally, click Done to exit the wizard and generate the form’s components that you have defined. Click Template to move back to the Select Template page. Click Cancel to exit the Form wizard.