Skip to content

Graphical User Interface

Danilo Cavalcanti edited this page Mar 30, 2026 · 1 revision

GUI Tutorial

The example below uses the mechanical (M) workflow and follows the same slope-stability setup used in examples/M/example_m_slope_stability.m.

Before You Start

  1. Open MATLAB in the repository root.
  2. Open gui/mainApp.mlapp and click Run.

Step 1. Create the Model

The GUI process begins with the model creation, where the user selects the type of physics to be modeled.

Main PorousLab GUI window used to create a model

Step 2. Choose How the Mesh Will Be Added

After defining the desired physics, the user is prompted to generate or import the mesh.

The mesh step offers two routes:

  1. Rectangular domain with structured mesh
  2. Import

For this slope-stability tutorial, choose Import and then click Import mesh.



We offer an auxiliary process to generate a structured mesh by setting the domain's dimensions and number of subdivisions, which is useful for simple rectangular problems.



Step 3. Boundary conditions

After generating or importing the mesh, the physics window appears, providing a clear step-by-step interface for applying the necessary simulation settings. Each tab corresponds to a task that must be completed in sequence, reflecting the standard workflow followed when writing code manually.

Once the mesh and physics are defined, the user proceeds to set the boundary conditions for the model. The GUI provides an easy way to apply prescribed displacements (Dirichlet boundary conditions) and loads (Neumann boundary conditions). Users can specify the location and type of boundary conditions and apply them directly to the model. For the slope-stability example, apply the supports in this order:

  1. Set Ux = 0 and Uy = 0, choose border, select bottom, and click Apply.
  2. Keep Ux = 0, leave Uy unchecked, select left, and click Apply.
  3. Repeat the same Ux = 0 condition for the right border.
  4. In the Neumann BCs tab, turn Body forces to Yes to include gravity.

This reproduces the standard setup of a fixed base with horizontal restraint on the two vertical boundaries.

Bottom boundary fully fixed in the Dirichlet BC tab
First, fix both Ux and Uy along the bottom border.
Left boundary with horizontal displacement fixed
Next, fix only Ux on the left border.
Right boundary with horizontal displacement fixed
Repeat the same horizontal restraint on the right border.
Neumann BC tab showing body forces enabled
In the Neumann BCs tab, turn Body forces to Yes to include gravity.

Step 4. Define the Material

Additionally, the material properties can be modified in the same window, where users can select a material model (e.g., Linear Elastic) and set the property values.

Open the Porous media tab and select Drucker-Prager as the material model. Then edit the table values and click Update material.

The values shown in the screenshots are:

  1. Young modulus = 20000 kPa
  2. Poisson ratio = 0.4900
  3. Density = 2 g/cm3
  4. Cohesion = 50 kPa
  5. Friction angle = 20 degree
  6. Dilation angle = 20 degree

Porous media tab with Drucker-Prager material properties

Step 5. Configure and Run the Analysis

Move to the Analysis tab and switch the analysis type to Quasi-static. Then choose the solution method and update the parameters before running.

The example shown here uses:

  1. Method = Cylindrical Arc Length
  2. Initial increment = 0.1
  3. Maximum increment = 0.5
  4. Maximum load ratio = 10
  5. Maximum number of steps = 70
  6. Maximum number of iterations = 20
  7. Target number of iterations = 9

Click Update analysis first, then click Run. The text area on the right is useful for checking convergence while the computation is running.

Analysis tab showing the quasi-static settings and run log

Step 6. Inspect the Results and Export the Model

After the analysis finishes, open the Post-Process tab. From there, you can:

  1. Select a field such as Ux, Uy, S1, E1, or PEMAG.
  2. Adjust the colorbar limits.
  3. Plot a profile if you want values along a segment.
  4. Click Export model to save the MATLAB model object.

The screenshot below shows the PEMAG field with manual colorbar limits from 0 to 1.

Post-processing tab showing the PEMAG contour plot

Clone this wiki locally