0% found this document useful (0 votes)
24 views

Command Line Version

This document describes how to use the command line version of OPTUM G2 for computational engineering. Key points include: 1. All OPTUM G2 calculations are processed by the executable OPTUM G2Cmd.exe, which can be run from the command line without the GUI. 2. Running OPTUM G2Cmd.exe with a .g2x project file as the only argument will process the model and generate output. 3. Optional arguments allow specifying output file names, generating log files, and getting echo output to the command prompt. 4. MATLAB can be used to run OPTUM G2Cmd.exe via the dos command, but results must be processed outside of MATLAB.

Uploaded by

Akash Garg
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Command Line Version

This document describes how to use the command line version of OPTUM G2 for computational engineering. Key points include: 1. All OPTUM G2 calculations are processed by the executable OPTUM G2Cmd.exe, which can be run from the command line without the GUI. 2. Running OPTUM G2Cmd.exe with a .g2x project file as the only argument will process the model and generate output. 3. Optional arguments allow specifying output file names, generating log files, and getting echo output to the command prompt. 4. MATLAB can be used to run OPTUM G2Cmd.exe via the dos command, but results must be processed outside of MATLAB.

Uploaded by

Akash Garg
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

OPTUM COMPUTATIONAL ENGINEERING

COMMAND LINE VERSION

Version 2019
OPTUM G2: Command Line Version
K Krabbenhoft (Editor)

c Optum Computational Engineering 2019
www.optumce.com
CONTENTS

Contents

1 COMMAND LINE VERSION 5


1.1 Optional arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.2 Running through MATLAB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.3 Setting up projects for command line processing . . . . . . . . . . . . . . . . . . . . 7

iii
CONTENTS

iv
COMMAND LINE VERSION

1 COMMAND LINE VERSION

All calculations in OPTUM G2 are processed by the calculation core OPTUM G2Cmd.exe. This
is in principle a stand-alone program that communicates with the graphical user interface (GUI) to
process input data and visualize results. It is therefore possible to bypass the GUI entirely and use
OPTUM G2 in command line mode. This is done by executing OPTUM G2Cmd.exe with the input
file and various settings as arguments.

To use the command line version of OPTUM G2, first open a Windows command prompt (cmd.exe).
Directions on the usage of OPTUM G2Cmd can be accessed at any time by executing OPTUM
G2Cmd without arguments (see Figure 1.1).

Figure 1.1: Windows command prompt.

To process an OPTUM G2 project file, OPTUM G2Cmd should be executed with the filename as
argument:

OPTUM G2Cmd FileName.g2x


The input file name must have extension g2x. This generates an output file FileName.results.g2x
which can be opened in OPTUM G2 as any other project file.

If the input file is located in a folder different from the current one, the full path should be specified,
for example:

OPTUM G2Cmd C:\OptumProjects\FoundationProject\FileName.g2x


If the input file or the path contain spaces, the whole path should be enclosed by quotation marks,
for example:

OPTUM G2Cmd "C:\OptumProjects\Foundation Project\File Name.g2x"

5
COMMAND LINE VERSION

1.1 Optional arguments

As indicated in Figure 1.1, three additional optional arguments are possible. These regard results
output, log file output and the information shown in the command prompt upon execution.

Example 1:

OPTUM G2Cmd FileName.g2x /output:FileNameResults.g2x

This generates a project file, FileNameResults.g2x, containing results. The project file can opened
with OPTUM G2 as any other project file.

Example 2:

OPTUM G2Cmd FileName.g2x /output:FileNameResults.g2x /log:ResLog.txt

This generates a project file, FileNameResults.g2x, containing results and in addition a file, ResLog.txt,
containing the analysis log.

Example 3:

OPTUM G2Cmd FileName.g2x /output:FileNameResults.g2x /log:ResLog.txt /echo

This is the same Example 2 except the analysis progress is written to the command line prompt as
shown in Figure 1.2. The argument /echo may be used on its own or with any of the other arguments.

Figure 1.2: Output of analysis progress using the /echo argument.

6
COMMAND LINE VERSION

1.2 Running through MATLAB


OPTUM G2 may be run through MATLAB using the dos function. This simply invokes the Windows
command prompt and no results will be available in MATLAB upon completion of the analysis. Tools
such as xlmread and xml2struct are useful in the further processing of the results through MATLAB.
The latter tool is distributed along with OPTUM G2.

1.3 Setting up projects for command line processing


When setting up input files for processing with OPTUM G2Cmd, it is advised to first use the regular
OPTUM G2 graphical user interface to create a template project file that resembles the final desired
project file as much as possible. This file, an easily decipherable xml file, can be read and modified
with any text editor.

Finally, if more than one project file is to be processed, it is advised to use a batch file (a regular
text file with extension bat) to set up the runs. An example is shown in Figure 1.3. This file is then
executed via the command prompt by entering its name.

Figure 1.3: Batch file for processing multiple (five) projects.

You might also like