学习中心

Course:

How to Navigate the COMSOL Multiphysics®User Interface

Utilizing Keyboard Shortcuts


Once you have learned and memorized the following keyboard shortcuts for frequently used commands and actions, they can help increase your productivity, replacing the need to use the mouse to access the corresponding functionality.

Navigating the Model Builder Tree

You can move up and down through the nodes in the Model Builder tree that represent the model in the Model Builder window by using the up and down arrow keys. In addition, you can use the following key combinations to navigate the model tree:

  • The right arrow key expands a node to show its subnodes
  • The left arrow key collapses a node to hide its subnodes
  • The / or + key on the keyboard number pad collapses and expands a branch in the model tree or application tree
  • Alt+left arrow key (Ctrl+left arrow key on macOS) moves to the previously selected node in the Model Builder
  • Alt+right arrow key (Ctrl+right arrow key on macOS) moves to the next selected node in the Model Builder

You can also use theCollapse AllandExpand Allbuttons on theModel Builderwindow toolbar. The following images show the same model tree fully collapsed and fully expanded (the fully expanded image does not show the entire expanded tree).

The model tree collapsed and expanded.
The same model tree fully collapsed (left) and fully expanded (right).

Useful Keyboard Shortcuts for COMSOL Multiphysics®

There are many keyboard shortcuts available when using COMSOL Multiphysics®. You are probably familiar with some of them from other software programs, such as Ctrl+S forSave; Ctrl+A forSelect All; Ctrl+C and Ctrl+V forCopyandPaste, respectively; and the Del key forDelete.

Note: On macOS, Command+S, Command+A, and so on replace the commands using the Ctrl key on the Windows®and Linux®operating systems.

The following table includes some of the most useful keyboard shortcuts:

Keyboard Shortcut Description
Ctrl+O Open a COMSOL file, such as an MPH-file (.mph)
Ctrl+F8 Test application; launch application for testing
Ctrl+D Clear the selection of all domains, boundaries, edges, or points in the Model Builder; clear all selections in form editor windows
Ctrl+F Open theFindtool for finding a search string in a model or application method and searching for specific strings in settings, descriptions, tags, and labels for nodes in the Model Builder and Application Builder trees
Ctrl+Z Undo the last operation
Ctrl+Y Redo the last undone operation
Ctrl+Space Opens the autofill drop down for variables. You can see an example of this in theFind and Autocompletesection of a previous article in this course.
Ctrl+Mouse Scroll Wheel Zoom in and out in theGraphicswindow
Hold Alt On Windows®, you can hold Alt and type ASCII numbers into text fields with the number pad
F1 Open theHelpwindow to display context help and access the user documentation
F2 Rename the selected node, file, or folder
F7 Build the selected node in the geometry and mesh branches; compute the selected study step; compute to the selected node in the solver sequence; or plot a time-dependent, eigenfrequency, or eigenvalue solution; in Windows®, step into the method editor’s debugging tool in the Application Builder
F8 Build the geometry or mesh, compute the entire solver sequence, update results data, update the plot, or run the model method in a method call

F1, F2, and so on are function keys, typically located above the standard alphanumeric keypad on your keyboard.

Keyboard Shortcuts for the Application Builder

When you create methods in the Application Builder, you work with the code for the methods in aMethod Editorwindow. In this environment, the following keyboard shortcuts can be especially useful:

Keyboard Shortcut Description
F8 Check the syntax in the method; problems appear in anError and Warningswindow.
F11 Go to the model node.
For example, if you highlight“pg4" in model.result("pg4").run();, the correspondingPlot Groupnode is highlighted in theEditor Toolswindow. In that window, click theEdit Nodebutton to move to the corresponding node in the Model Builder window (to edit its settings, for example).
Ctrl+1 Create local variable declarations, which can simplify the code.
For example, the codemodel.result("pg4").run();is then transformed to the following two lines:
ResultFeature pg4 =
model.result("pg4"); pg4.run;
,
where you can use the locally declared variablepg4throughout the method.
Ctrl+K Create a shortcut to an object or menu; similar to Ctrl+1 but useful when you want to refer to an object, such as a plot group, by the same variable (shortcut) name in multiple methods.
For example, when you press Ctrl+K when highlighting “pg4” inmodel.result("pg4").run();, aUse Shortcutdialog box appears where you can provide a name for the shortcut and, as an option, update all methods. The shortcutpg4, representingResults/result/pg4, then appears underList of Shortcutsin theSettingswindow for theDeclarations>Shortcutsnode and can be used throughout all methods in the application to simplify the code.
Ctrl+R Record code; start recording the corresponding code for all subsequent modeling steps. The COMSOL Desktop®windows get a red frame to indicate that recording is in progress. Press Ctrl+R again to stop the recording. The recorded code is inserted in the active method used for the recording.

Using these keyboard shortcuts can help you to develop and debug methods for your simulation applications faster.

Key Takeaways

Here, we have just scratched the surface of how you can use keyboard shortcuts to become more productive during your COMSOL Multiphysics®modeling sessions. Explore these keyboard shortcuts to see if they, once memorized, make some tasks faster and easier to perform.

There are many additional keyboard shortcuts and mouse shortcuts. TheAppendix B — Keyboard and Mouse Shortcutssection in theIntroduction to COMSOL Multiphysicsdocumentation lists all available shortcuts. In theCOMSOL Multiphysics Reference Manual, you will find additional information about how to customize your modeling environment.


请提交与此页面相关的反馈,或点击此处联系技术支持

Baidu
map