This topic provides information about how to run the MIT in batch mode using the python script mit_batch.py. The sections include:
The MIT runs in batch mode using the python script, mit_batch.py. With this script, the MIT generates one output .gbs file and one output .spd file for one bushing. The .gbs file can be used for downstream simulation with MBD solvers or applications such as MATLAB, while the output .spd file provides information about the behavior of a model. For example, you can interactively load the output .spd file in the MIT, and then review the performance of your model against the same tests that were used to generate the input .spd file. For more information about .gbs and .spd files, see Using the Altair Bushing Model.
• | From <HW_INSTALLATION>/utility/scripts/plotting/mit/batch, invoke the script, mit_batch.py. |
• | If you wish to Fit or Analyze multiple bushings, you need to invoke mit_batch.py multiple times. You can do this conveniently using a .bat file for Windows, shell script for Linux, or python script for Windows or Linux. |
Note: If python is not installed on your system, then include the location of HyperWorks python in your path as follows: Windows set PATH <HW_INSTALLATION>/hw/python/python27/win64;%PATH% Linux setenv PATH <HW_INSTALLATION>/hw/python/python27/linux64:$PATH
|
Using shortcuts to invoke mit_batch.py helps minimize typing. You can create shortcuts as follows:
• | From <HW_INSTALLATION>/utility/scripts/plotting/mit/batch/, right-click mit_batch.py, and then select Send to > Desktop. |
A batch mode shortcut appears on your desktop. You can copy or move the shortcut as needed.
• | Using the ln -s command, create a symbolic link to <HW_INSTALLATION>/utility/scripts/plotting/mit/batch. |
• | Note that Windows style path names with “\” are allowed and blanks in paths are allowed inside of double quotes: “test directory\testName”. |
The batch mode process using mit_batch.py includes two principal modes of operation as described in the following table. Regardless of the mode of operation, the mit_batch.py includes a set of optional arguments to control the behavior of the MIT.
Mode |
Description |
option -i |
Invokes mit_batch.py with a list of input .spd files. |
option -d |
Invokes mit_batch.py with a directory containing a set of .spd files for a bushing. |
The following is a synopsis of the options in the batch mode process:
mit_batch.py |
-i <input_files_list> |
-o <output_directory> |
<options> |
mit_batch.py |
-d <input_directory> |
-o <output_directory> |
<options> |
The following are arguments you can use in batch mode:
Argument |
Description |
-i <input_files_list> |
Specifies a list of comma-separated .spd file names that are to be fitted. You can provide a maximum of six files as input. The directions to be fitted are obtained from the .spd files and must be unique. |
-d <input_directory> |
Specifies a path that contains the files that are to be fitted. The tool attempts to run all .spd files in this directory. The directory must contain a maximum of six .spd files, each of which contains a unique direction. The bushing directions to be fitted are obtained from the .spd files. The arguments -i and -d are mutually exclusive. |
-o <output_directory> |
Specifies a path where all outputs from the run are placed. <output_directory> is created if necessary. /staff/brown/rear-gear-box is an example of a valid output directory path. <output_directory> contains the following five files: Output .gbs file: <name>.gbs Batch .log file: <name>.batch.log .xml file: <name>.xml Fit .log files Subdirectory, 1_Cycle |
These options are available for you to use in batch mode:
Option |
Description |
-a |
Specifies that the MIT is to perform an Analyze operation. The Analyze operation performs a test on a virtual bushing and compares the results to the physical test results. The virtual bushing is specified as an input .gbs file. The physical test is specified in an input .spd file. When this option is not specified, the system tries to perform a Fit operation with the specified inputs. |
-e |
Specifies the directory name where the intermediate files that the MIT generates from a Fit or Analyze operation are stored. You can use these files to reload existing runs in a new MIT session. You should not change the contents of this directory. When this option is not used, all output files are created in the output folder. If <experiment-directory> already exists, then all the existing content is saved to a new folder. The archive folder name is determined at run time to be unique. The new content generated from the batch run is added to <experiment-directory>. |
-f <xml-file> |
Specifies the .xml file containing the options that are to be used for fitting. These options take precedence over the options in the default .xml file that is used by the MIT. |
-h |
Provides information about how to use mit_batch.py. Invoking mit_batch.py without parameters also provides Help, which is this content shown in plain text. |
-n |
Specifies the name of the output .gbs file, output .pdf file, batch .log file and .xml file. If not specified, <name> is the lowest level directory name in <output_directory>. |
-t <directory> |
This option is meant for use only when the –i argument is used. This option specifies a test directory where the .spd files reside. |
-x |
Does not execute the MIT, but generates an output directory that includes the .xml file of default options. |
The batch mode return status includes the following:
Status |
Description |
0 |
The fitting tasks were completed successfully. |
64 |
The analyze tasks were completed successfully. |
1 |
The fitting task for FX direction failed. |
2 |
The fitting task for FY direction failed. |
4 |
The fitting task for FZ direction failed. |
8 |
The fitting task for TX direction failed. |
16 |
The fitting task for TY direction failed. |
32 |
The fitting task for TZ direction failed. |
Multiple directions failure is represented with the sum of individual failures:
• | Fitting task failed for FX and FZ: the return code is 0+1+4 = 5. |
• | Analyze task failed for FX and FZ: the return code is 64+1+4 = 69. |
Following are six examples of batch mode usage:
Example 1
mit_batch.py –i ./F0_Fx.spd –o ./F0_Fx
• | The file F0_Fx.spd in the current working directory is used as the input .spd file. |
• | The MIT creates an output directory file, ./F0_Fx, in the current working directory. The ./F0_Fx file contains the fit results: |
Result |
Description |
F0_Fx.gbs |
Output .gbs file for simulations. |
F0_Fx.pdf |
Output .pdf file. |
F0_Fx.batch.log |
.log file for the batch run. |
F0_Fx.xm |
Parameters used by the MIT for this run. |
F0_Fx.log |
.log file for the fit operation on F0_Fx.spd. |
1_Cycle |
Sub-directory containing intermediate files generated by the MIT. |
Example 2
mit_batch.py –d /staff/pbrown/rear-gear-box –o /staff/pbrown/rear-gear-box-09-19-2013
• | All .spd files in /staff/pbrown/rear-gear-box are used as input to the MIT. Assume that there are three .spd files in /staff/pbrown/rear-gear-box, rgb-90210-x.spd, rgb-90210-y.spd, rgb-90210-tz.spd, for directions x, y and tz respectively. |
• | The MIT creates an output directory, /staff/pbrown/rear-gear-box-09-19-2013, which contains: |
Result |
Description |
rear-gear-box-09-19-2013.gbs |
Output .gbs file to use for simulations. |
rear-gear-box-09-19-2013.pdf |
Output .pdf file. |
rear-gear-box-09-19-2013.batch.log |
.log file for the batch run. |
rear-gear-box-09-19-2013.xml |
Parameters used by the MIT for this run. |
rgb-90210-x.log |
.log file for the fit operation on rgb-90210-x.spd. |
rgb-90210-y.log |
.log file for the fit operation on rgb-90210-y.spd. |
rgb-90210-tz.log |
.log file for the fit operation on rgb-90210-tz.spd. |
1_Cycle |
Sub-directory containing intermediate files generated by the MIT. |
Example 3
mit_batch.py –d /staff/pbrown/rear-gear-box –o /staff/pbrown/rear-gear-box-09-19-2013 -x
• | All .spd files in /staff/pbrown/rear-gear-box are used as input to the MIT. Assume that there are 3 .spd files in /staff/pbrown/rear-gear-box, rgb-90210-x.spd, rgb-90210-y.spd, rgb-90210-tz.spd, for directions x, y and tz respectively. |
• | The MIT creates an output directory, /staff/pbrown/rear-gear-box-09-19-2013, which contains: |
Result |
Description |
rear-gear-box-09-19-2013.batch.log |
.log file for the batch run. |
rear-gear-box-09-19-2013.xml |
Parameters used by MIT for this run. |
Example 4
mit_batch.py –i F0_Fx.spd, F0_Tx.spd –o ./F0 –t /staff/pbrown/rear-axle-bearing
• | The MIT uses the files F0_Fx.spd and F0_Tx.spd in /staff/pbrown/rear-axle-bearing as the input .spd files. |
• | The MIT creates an output directory file, F0, in the current working directory. The F0 directory contains: |
Result |
Description |
F0.gbs |
Output .gbs file to use for simulations. |
F0.pdf |
Output .pdf file. |
F0.batch.log |
.log file for the batch run. |
F0.xml |
Parameters used by MIT for this run. |
F0_Fx.log |
.log file for the fit operation on F0_Fx.spd. |
F0_Tx.log |
.log file for the fit operation on F0_Fy.spd. |
1_Cycle |
Sub-directory containing intermediate files generated by the MIT. |
Example 5
mit_batch.py –i F0_Fx.spd, F0_Tx.spd –o ./F0 –t /staff/pbrown/rear-axle-bearing -n exported
• | The MIT uses the files F0_Fx.spd and F0_Tx.spd in /staff/pbrown/rear-axle-bearing as the input .spd files. |
• | MIT creates an output directory file, F0, in the current working directory. The F0 directory contains: |
Result |
Description |
exported.gbs |
Output .gbs file to use for simulations. |
exported.pdf |
Output .pdf file. |
exported.batch.log |
.log file for the batch run. |
exported.xml |
Parameters used by MIT for this run. |
F0_Fx.log |
.log file for the fit operation on F0_Fx.spd. |
F0_Tx.log |
.log file for the fit operation on F0_Fy.spd. |
1_Cycle |
Sub-directory containing intermediate files generated by the MIT. |
Example 6
mit_batch.py –i F0_Fx.spd, F0_Tx.spd –o ./F0 –t /staff/pbrown/rear-axle-bearing -n exported -e/staff/pbrown/Test
• | The MIT uses the files F0_Fx.spd and F0_Tx.spd in /staff/pbrown/rear-axle-bearing as the input .spd files. |
• | MIT creates an experiment directory, Test, in the current working directory. The Test directory contains: |
Result |
Description |
exported.batch.log |
.log file for the batch run. |
exported.xml |
Parameters used by MIT for this run. |
F0_Fx.log |
.log file for the fit operation on F0_Fx.spd. |
F0_Tx.log |
.log file for the fit operation on F0_Fy.spd. |
1_Cycle |
Sub-directory containing intermediate files generated by the MIT. |
• | MIT creates an output directory, F0, in the current working directory. The F0 directory contains: |
Result |
Description |
exported.gbs |
Output .gbs file to use for simulations. |
exported.pdf |
Output .pdf file. |