This sample app shows how to integrate PLAXIS into a VIKTOR application. In this application the following tutorial is used as an example: PLAXIS 2D Tutorial 08: Construction of a road embankment. This sample app is built on PLAXIS v21.
An example interaction with the sample app is shown below.
Since a worker is needed for this application, some work is required to install the application properly.
- A worker should be installed according to the VIKTOR docs: PLAXIS generic worker docs This worker should be on the same machine as where PLAXIS is installed.
- PLAXIS uses some Python interpreter, which can be the default one PLAXIS provides, or another one which you can
define yourself in PLAXIS itself by navigating through the menu:
Expert -> Python -> Configure Python Interpreter -> Use the follwing Python interpreter
Here you can navigate to your preferred Python environment, and then clickInstall required components...
. As the PLAXIS-Python script provided by this sample application works with munch and numpy, install these packages on the selected Python environment. - Once this is configured, install the sample application. In the file
app/lib/plaxis.py
, the following two variables should be edited:PLAXIS_PATH
: Set the correct path to yourPlaxis2DXInput.exe
PASSWORD
: Set the password that is definedExpert -> Configure remote scripting server
- Finally, check the worker status in the integration status menu. The Generic worker should state that all instances are available.
The application has two main objects: Material and Embankment. You can set up various materials in the Material editor. The Embankment is setup in the Embankment editor.
An example of the material editor is shown below. To keep things as simple as possible, only the options are implemented that are shown in the tutorial. This can easily be extended to fit your own needs!
The embankment is parametrized in three sections:
- Embankment itself: a width of the top part of the embankment (16 metres in the tutorial), the width of the slope (12 metres in the tutorial) and height (4 metres in the tutorial). Furthermore a material for the embankment needs to be specified
- Soil below the embankment: the semi-width of the soil (60 m in the tutorial), and the soil layers. One can add a row for each layer, and specify a thickness and a material for each layer
- Drains: Enable/disable the drains, and if they are enabled, specify the spacing and depth of the drains
On the right-hand-side you can view what the embankment looks like in the Embankment 2D
view, and analyse the model in
the PLAXIS analysis
view.
PLAXIS-specific code can be found in app/functions/plaxis.py
. This is the file that is sent to the generic VIKTOR
worker. You can use this file without VIKTOR, yet then you need to specify your own input.json
and material.json
files. Furthermore, you have to specify your own output visualisation if wished.
embankment_folder: has embankments as its children
└─ embankment: defines the input for PLAXIS and retrieves the output from PLAXIS
material_folder: has materials as its children
└─ material: can be used as a data-set for PLAXIS material inputs