2021.11

8.2 Adding Command Panels to the GUI

Users are able to create new command panels using https://www.qt.io/download, then add those panels to the navigation XML. The finished panels will be displayed along with the standard Cubit panels and will launch python scripts when the user clicks ’Apply’ or ’Preview’. This tutorial will show the reader how to add a command panel that creates a "Brick with Hole".

8.2.1 Create a directory to store command panels

Figure 486:

8.2.2 Create a directory for the new command panel

Figure 487:

8.2.3 Navigation Marker

Figure 488:

  • Save the XML file

    • Restart Cubit for the changes to take effect

  • The Brick with Hole panel will now appear in the button hierarchy but the panel will have no contents because we have not yet created a panel.ui file.

Figure 489:

8.2.4 Create Panel UI

Figure 490:

  • In Cubit, right-click on the panel where it says "No panel contents to display" and choose "Reset Data".

  • The new custom panel should now appear.

  • Tip: The panel.ui file is reloaded when "Reset Data" is executed. This allows you to modify the ui layout without restarting Cubit.

Figure 491:

8.2.5 Panel UI Widgets
8.2.5.1 Pick Widget
8.2.5.2 Pick Types

Geometry

  • Body

  • Volume

  • Surface

  • Curve

  • Vertex

  • Group

Exodus Containers

  • Nodeset

  • Sideset

  • Block

Mesh

  • Hex

  • Tet

  • Pyramid

  • Wedge

  • Quad

  • Tri

  • Edge

  • Node

  • BoundaryLayer

FEA Boundary Conditions

  • Acceleration

  • Velocity

  • Force

  • Pressure

  • Heatflux

  • Displacement

  • Temperature

  • Convection

  • ContactRegion

  • ContactPair

CFD Boundary Conditions

  • Axis

  • ExhaustFan

  • Fan

  • InletVent

  • InletMassflow

  • InletPressure

  • InletVelocity

  • IntakeFan

  • Interface

  • Interior

  • Outflow

  • OutletVent

  • OutletPressure

  • FarfieldPressure

  • Periodic

  • PeriodicShadow

  • PorousJump

  • Radiator

  • Symmetry

  • Wall

8.2.6 Apply Script

Figure 492:

  • Save apply.py, then in Cubit, set values for the brick size and cylinder radius in the panel and click "Apply" to create a brick with a hole in it.

Figure 493:

8.2.7 UserPanel Functions
8.2.8 Preview Script