学习中心

Course:

Getting Started with Building Simulation Apps

Modifying Command Sequences and Creating Methods to Customize App Operation


When developing a simulation app using the Application Builder in COMSOL Multiphysics, it is likely to include buttons to perform various actions in your app. You can customize the actions that are triggered by any button in your simulation app through modifying the command sequences and creating Java methods using theMethod Editor. Examples include a button that updates the graphical display to show the geometry (such as when a user has changed dimensions of the design) or a button that computes the model then plays a sound to alert that the computation has finished. Learn how to make such further customizations here.

Tutorial: Command Sequences and Methods

Thesimplified thermal microactuator tutorial modelis used for the model example, which a simulation app was developed forpreviously. Here, the simulation app is customized by making changes to theComputebutton so that upon the computation finishing both a sound is played as well as a plot of the stress and deformation is displayed by default. This involves adding to a linear sequence of commands. For more flexibility the command sequence can be converted into a java method and then continue to be edited by writing code. Making changes to the app using theMethod Editoris shown. Topics covered in the tutorial video include the following:

  • Overview of command sequences
    • ChooseCommands to Runsection
    • Modifying the command sequence
  • Converting a command sequence into a method
  • Overview of theMethod Editor
    • Writing code in theMethod Editor
    • Using Ctrl+Space for code completion in theMethod Editor
  • Referencing features from the model tree in methods
    • Enabling tags to display in the Model Builder window

Further Learning


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

Baidu
map