Quantcast
Channel: PLAXIS - Knowledge Base - Tips and Tricks
Viewing all articles
Browse latest Browse all 25

Run multiple calculations easily

$
0
0
Application:

With the combination of the startup command line parameters to launch PLAXIS and the commands runner in PLAXIS 2D and PLAXIS 3D, it is relatively easy to make a setup in order to run multiple calculations unattended.

PLAXIS 2D

Since PLAXIS 2D AE, the program also the command line and the commands runner.
To run a serie of commands (stored in a command log file) after loading a PLAXIS 2D project (extension *.p2dx), the format of the command line for the Windows Console is:

"[PLAXIS 2D installation folder]\Plaxis2DXInput.exe""[full path to Plaxis file]""--run=[path to command file]"

Example:

"C:\Program Files (x86)\Plaxis\Plaxis 2D\Plaxis2DxInput.exe""D:\Projects\Project1A.p2dx""--run=D:\Projects\calculateprojects.log"

PLAXIS 3D

In order to launch a command file after loading a PLAXIS 3D project, the format of the command line is similar:

"[PLAXIS 3D installation folder]\Plaxis3DInput.exe""[full path to Plaxis file]""--run=[path to command file]"

Example:

"C:\Program Files (x86)\Plaxis\Plaxis 3D\Plaxis3DInput.exe""D:\Projects\Project1A.p3d""--run=D:\Projects\calculateprojects.p3dlog"

Setting up multiple calculations

If you want to calculate multiple projects directly after each other, the simplest way to do this, is to use such a commands log file and use a Batch-file (.bat) to run several calculations.

Commands log file

The commands log file will contain all the commands that will be run after loading the model. In this case, we will create this file ‘calculateprojects.log’, an ASCII file you can make with e.g. Notepad. It will contain the following instructions:

  1. go to the staged construction mode
  2. calculate all phases, not taking into account its state
  3. save the file once the calculation is done
  4. and close Plaxis, so we can run the next calculation

The commands that we need to store in this command log file ‘calculateprojects.log’ are:

gotostagescalculateTruesave__kill

Note: if one of the commands in this do not work (e.g. when there is no mesh defined, the calculation cannot start and the program shows an error message), then the entire process is halted.

Executing multiple calculations

In order to launch an application, we can take advantage of the Windows shell. For this we will use a BAT-file (you can edit this with any text editor, like Notepad). Make sure to give the file the extension .BAT

The content of this file to run four PLAXIS 2D calculations on these files stored in the folder D:\Projects is:

set Plaxis="C:\Program Files (x86)\Plaxis\Plaxis 2D\Plaxis2DxInput.exe"

%Plaxis% "D:\Projects\Project1A.p2dx""--run=D:\Projects\calculateprojects.log"
%Plaxis% "D:\Projects\Project1B.p2dx""--run=D:\Projects\calculateprojects.log"
%Plaxis% "D:\Projects\Project1C.p2dx""--run=D:\Projects\calculateprojects.log"
%Plaxis% "D:\Projects\Project1D.p2dx""--run=D:\Projects\calculateprojects.log"PAUSE

Now we can just double click on the BAT-file to run all these calculations.

For a demonstration, please see our animation: Using a batch file to run commands


Note, this is a VIP feature: a licence with the VIP add-on is required to run the commands runner


Viewing all articles
Browse latest Browse all 25

Trending Articles