HyperMath

Invoking HyperMath

Invoking HyperMath

Previous topic Next topic Expand/collapse all hidden text  

Invoking HyperMath

Previous topic Next topic JavaScript is required for expanding text JavaScript is required for the print function  

You can invoke HyperMath:

as a standalone product,
by running it in batch mode,
or from within HyperWorks products
oHyperMath can be invoked from the View > Toolbars > HyperWorks > Scripting toolbar in the following HyperWorks products: HyperMesh, HyperView, HyperGraph and MotionView.
oThe interactive standalone mode can also be accessed from the Applications menu in HyperStudy, HyperGraph HyperView and MotionView.

HyperMath runs on the following platforms:

Windows 64-bit
Linux 64-bit
Mac OS
 hmtoggle_plus1greyRunning HyperMath in Standalone Mode for HyperWorks 2017

On Windows

From the Start menu, click All Programs > Altair HyperWorks 2017 > HyperMath.

From the DOS prompt on a PC

Run the following script:

<install directory>\hwx\bin\win64\hwx.bat

Or, run the following executable:

<install directory>\hwx\bin\win64\runhwx.exe -client HyperMath -l en

On Linux

Invoke HyperMath 2017 via hmath in <install_dir>/scripts/hmath 

On Mac

Double-click the HyperMath icon from the installation folder
Invoke HyperMath via <install_dir>/scritps/hmath
hmtoggle_plus1greyRunning HyperMath in Batch Mode

On Windows

Invoke HyperMath via hypermath.bat in <install_dir>/hwx/bin/win64.

From the DOS prompt on a PC

Run the following executable:

<install directory>\hwx\bin\win64\hypermath.bat -f  "<filename>.hml" [options]

On Linux

Invoke HyperMath via hmathbatch in <install_dir>/scripts/hmathbatch

On Mac

Invoke HyperMath 2017 via <install_dir>/scripts/hmathbatch –f hmlfile

hmtoggle_plus1greyHyperMath Start Options

Option

Argument

Description

Available On

-f

-file

<filename>.hml

Runs a script specified by the file.

Requires absolute file paths as the argument (separated by ',').

All platforms.

-b or

-batch

None

Runs hwx in batch (non-GUI and non-interactive) mode.

All platforms.

-help

None

List the options when invoking hwx.exe.

All platforms.

-nobg

None

With this option, HyperMath will not return until the script completes.

Linux

 

hmtoggle_plus1greyMore on Batch Execution

The installation includes the batch files hypermath.bat, located in <install folder>\hwx on Windows, and hmathbatch in <install folder>\altair\scripts on Linux.  You can use these files for batch mode execution of HyperMath script files as follows (on Linux, replace hypermath.bat with hmathbatch):

hypermath.bat –f filename1.hml … filenameN.hml

hypermath.bat –input input1 … inputN –f filename1.hml

filename1.hml … filenameN.hml

A set of fully qualified (unless in defined path) filenames to be executed in batch mode in that order.  If an error is encountered with any of these files, the execution stops.

input1 … inputN

A set of input arguments that can be accessed in the HyperMath scripts.  This can be used to supply inputs like data filenames and paths.  See the functions GetNumOfCmdInputs and GetCmdInput for how to access these inputs in HyperMath scripts.  Only one HyperMath script file can be supplied with this option.

Executes two HyperMath script files in succession.

 hypermath.bat –f c:/demo/test.hml c:/test/demo.hml

If ran from a console screen, all print statement outputs are echoed to the console.  Outputs can be redirected to a file using the redirection operator (>>) as shown below:

 hypermath.bat –f c:/demo/test.hml c:/test/demo.hml >> c:/log.txt

Provides input and output filenames to be used in the HyperMath scripts.

hypermath.bat –input in.dat out.dat –f c:/demo/test.hml

In case the input arguments (path and filename) contain spaces, they need to be inside quotes and spaces have to be protected by  "\ ".

For example, if the filename is test batch mode.hml (2 spaces), then the command is

hmathbatch –f "$HOME/test\ batch\ mode.hml"

hmtoggle_plus1greyUser Start-up File

If you define a user-init.hml file in your preference directory, this file is launched at each start-up.

The user preference directory is defined by

getuserdir() + '/.altair/' + <VERSION>.

For example, for version 2017, the directory is defined by: getuserdir() + '/.altair/' + '2017.0'.

A more detailed example:

USER_FILE = getuserdir() + '/.altair/' + '2017.0' + '/user-init.hml';

fid = Open(USER_FILE,"wt");

fid::write("print(\'hello at each startup.\');\n");

fid::close()

You can restart HyperMath to see the result.  In the above example, each time HyperMath is launched, the message 'hello at each startup' is displayed in the Command window.