Automatic refinement using a bounding box


Application PLAXIS 2D
PLAXIS 3D
Version PLAXIS 2D 2024.2 and later
PLAXIS 3D 2024.2 and later
Date created 07 April 2025
Date modified 07 April 2025
Original author Stefanos Papavasileiou - 
Technical Support Group
Keywords PLAXIS, automation, Python, scripting, py, cookbook, mesh, coarseness, refine

Introduction

In PLAXIS the density of the generated finite element mesh plays an important role in the numerical analysis of your geotechnical projects. Often, multiple iterations are required to find the optimal configuration of global and local refinements. 
Selecting an area to apply the local refinements is typically an effective way to achieve this.

Python solution

This Python scripts provides the workflow of creating a bounding box which will be used to apply local refinements (.CoarsenessFactor). The bounding box can be specified either by directly providing coordinates or by drawing the necessary geometry in the PLAXIS canvas.
The tool will automatically identify the objects that fall within the bounding box and apply the factor you provide. You can continue refining the model using the tool or undo your last action.

Assumptions

Instructions

  1. Download the zipped file containing the Python script
  2. Extract the zipped file in a local directory
    Or
  3. Extract the zipped file in a local directory and copy the automatic_refinement_user_input_box_plaxis_2D.py or automatic_refinement_user_input_box_plaxis_3D.py file to:
    • [PLAXIS 2D installation directory]\pytools\input
      Or
    • [PLAXIS 3D installation directory]\pytools\input
  4. In PLAXIS 2D or PLAXIS 3D Input, open the project containing the geometry
  5. In the Expert menu:
    • go to Expert > Python > Editor..., open the automatic_refinement_user_input_box_plaxis_2D.py or automatic_refinement_user_input_box_plaxis_3D.py file and run it (F5) Or
    • go to Expert > Run Python script > Open... browse for automatic_refinement_user_input_box_plaxis_2D.py or automatic_refinement_user_input_box_plaxis_3D.py file

Version

This script has been tested with PLAXIS 2D and 3D 2024.2 and Python 3.12.3.

Downloads

See also