The Calculation manager tool has been introduced for running multiple PLAXIS 2D and/or PLAXIS 3D projects unattended. An overview of the tool is provided here.
When using the Calculation manager tool, it is possible to include one pre-processing and/or one post-processing Python script. The pre-processing python script will be executed before running each project listed in the Calculation Manager’s window, while the post-processing will be executed after running each project, but before saving it.
The structure of the post-processing script should be the following:
# Import any modules, functions that might be needed for your script
# BOILERPLATE PLAXIS #
from plxscripting.easy import *
# END BOILERPLATE
# function for post-processing should have the following signature
def run_postcalc(project, s_i, g_i):
:param s_i: server object of Plaxis application in Input
:param g_i: global object of current open Plaxis model in Input
:param project: (str) full project path + name
# type your code here to perform any actions
# e.g.: open Output program and establish connection to the server
output_port = g_i.view(g_i.CurrentPhase)
s_o, g_o = new_server('localhost', output_port, password=s_i.connection._password)
# close Output program
The pre-processing script should have a similar structure. Although having the same arguments, the name of the function of the pre-processing script should be:
def run_precalc(project, s_i, g_i):
Note that the pre-processing script will be invoked after opening a given project from staged construction mode. The script should leave the project in staged construction mode. To ensure this, the selected mode of Staged construction should be called at the end of the script:
The pre-processing script should be named “multicalc_precalc.py”, while the post-processing script should be named “multicalc_postcalc.py”. In both cases, the Python scripts should be placed inside the folder termed “MultiCalc” included in the “Tools” subfolder of the PLAXIS installation folder, located by default in:
C:\Program Files\Bentley\Geotechnical\PLAXIS 2D CONNECT Edition V20\tools\MultiCalc
Note: administrator rights are needed to add or create files in this folder.
A video illustrating the use of this feature can be found below. In this video, the Calculation Manager is launched from PLAXIS 2D and two different projects are selected for calculation. A post-processing Python script is used to get the maximum total displacement obtained for the last phase of each project and the coordinates of the node at which it occurs.
Particularly during the time that the pre- and/or post-script is being developed, it is advised to run the Calculation Manager tool using the Command Prompt for outputting. With such a purpose, the following steps can be taken:
1) Open either PLAXIS 2D or PLAXIS 3D;
2) Select option Python > Command prompt from Expert menu;
3) Start remote scripting server section;
3) Execute runner.pyw, located in the MultiCalc distribution by typing: “python tools\MultiCalc\runner.pyw”.
The calculation manager will open. Any action performed in Calculation manager (e.g. adding a project to the list) will be reported in the Command Prompt window. Furthermore, as illustrated below, any print statement included in the script will be displayed in the Command Prompt window, which may be help understanding where a given script may fail.
Figure 1. Using Command Prompt for outputting information while running a script.