GiD - The personal pre and post processor

EXECUTING AN EXTERNAL PROGRAM

Once all the problem type files are finished (.cnd, .mat, .prb, .sim, .bas files), you can run the solver. You may wish to run it directly from inside GiD.


To do so, it is necessary to create the file problem_type_name.bat in the Problem Type directory. This must be a shell script that can contain any type of information and that will be different for every operating system. When you select the Calculate option in GiD Preprocess this shell script is executed (see CALCULATE from Reference Manual).


Because the .bat file will be different depending on the operating system, it is possible to create two files: one for Windows and another for Unix/Linux. The Windows file has to be called: problem_type_name.win.bat; the Unix/Linux file has to be called: problem_type_name.unix.bat.


If GiD finds a .win.bat or .unix.bat file, the file problem_type_name.bat will be ignored.


If a .bat file exists in the problem type directory when choosing Start in the calculations window, GiD will automatically write the analysis file inside the example directory assigning the name project_name.dat to this file (if there are more files, the names project_name-1.dat ... are used). Next, this shell script will be executed.

GiD will assign these arguments to this script:

  • 1st argument: name of the current project (e.g. project_name)
  • 2nd argument: path of the current project (e.g C:\temp\project_name.gid)
  • 3rd argument: path of the problem type selected (e.g. C:\Program Files\GiD\GiD 16.1.3d\problemtypes\problem_type_name.gid)
  • 4th argument: path of gid exe  (e.g. C:\Program Files\GiD\GiD 16.1.3d\gid.exe)


Among other utilities, this script can move or rename files and execute the process until it finishes.


Note 1: This file must have the executable flag set (see the UNIX command chmod +x) in UNIX systems.
Note 2: GiD sets as the current directory the model directory (example: c:\examples\test1.gid) just before executing the .bat file. Therefore, the lines (cd $directory) are not necessary in the scripts.
Note 3: In UNIX platforms check you have installed the shell you are using in the .unix.bat script, there are more than one possibilities: bash, csh, tcsh, ...
The first line of the script specify the shell to be used, for example
#!/bin/sh
or
#!/bin/bash


In Windows platforms, the command.exe provided by GiD is used instead the standard cmd.exe or command.com to evaluate the bat file

COPYRIGHT © 2022 · GID · CIMNE