You can start working with a form and get access to the Form ribbon toolbar in the following ways:
• To create a new form, click the New Form button (). Then use the wizard in the New Form window that opens.
1 In the New Form window you can create a new form with the some 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 (default: Form 1 for the first form) and its name in the Form name field (default: form1 for the first form). 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.
2 Click the Inputs/outputs tab to add input fields where users can type in values of parameters used as inputs and numerical data displays where you can present numerical results. 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 Model Data Access. Depending on the property, the input becomes a label and a text field, a check box, or a 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. Double-click the selected input or output, or click the Add Selectedbutton to add the input field or data display to the form and the list under Selected. Double-click, or click the Remove Selected
button, to remove an item from the Selected list.
3 Click the Graphics tab to add any of the following Graphics windows (plots) to the form:
-
-
- Under Results, add any of the available plot groups.Double-click, or click the Add Selectedbutton, to add the graphics to the form and the list under Selected. Double-click, or click the Remove Selected
button, to remove an item from the Selected list.
4 Click the Buttons tab 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.
-
- 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.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 these additional buttons for file-related operations:
-
-
- Add a Save Application on Server button () to save the application on the server with the current name.
- Add a 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.
-
- Add a Save File As button () to make it possible to choose and download a file to the client application.
- Under GUI Commands>Graphics Commands you can add these additional buttons for graphics-related properties and operations:
- Add a Zoom Extents button () to make it possible to zoom in to the extents of the plotted object or geometry.
- Add a 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.
-
-
- Under GUI Commands>Model Commands you can add these buttons for model-related operations:
-
- Double-click, or click the Add Selectedbutton, 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.
5 Click OK to exit the wizard and generate the form’s components that you have defined.