HyperStudy

Define Models

Define Models

Previous topic Next topic Expand/collapse all hidden text  

Define Models

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

Once you have added a model to the study, it must be defined.

hmtoggle_plus1greyLoad a Resource File

A resource file contains information about the input variables and/or output responses that you are investigating. When you load a resource file, HyperStudy extracts it's input variable and/or output response information. To load a resource file for a model in the Define models table:

1.In the Resource column of the model you are defining, click file_util_icon.
2.In the HyperStudy - Load model resource dialog, navigate to your working directory and open the resource file.

 

The type of file you load in the Resource column will vary depending on the type of model you are defining.

Parameterized File model: Load a .tpl file. If you load a file that does not contain parameters, a dialog will appear asking if you would like to parameterize the file. If you select Yes, the file will open in the Editor as a .tpl file. When you close the Editor, HyperStudy automatically loads the .tpl in the Resource column, and inserts the file name in the Solver input file column.
Spreadsheet model: Load a .xls file.
HyperMesh model: Load a .hm file.
MotionView model: Load a .mdl file.

 

If you are defining an Internal Math model, or if you invoked HyperStudy from another HyperWorks Desktop application, then you do not have to load a resource file.

 

hmtoggle_plus1greyDefining Model Dependencies

When defining a model, create model resources to reference files called by scripts or to link to result files that were generated by existing models.

1.In the Define models step, right-click on a model and select Model Resources from the context menu.
2.In the Model Resources dialog, click Add Resource.
3.Select a type of model resource and click OK.
Normal is a file that does not change.
Link is a file that changes with each run.
4.In the Origin Path field, navigate to your working directory and open the file to reference.
5.In the Operation field, select:
None to leave the file as it is. Used for reference files.
Move to move the file into the run directory (this is only available for files of type Link).
Copy to copy the reference file into the run directory.
Write Input is a special case for the resource file for the model (for example, the HyperMesh database for a HyperMesh model type).
6.Click Close.

 

Note:Varnames can be referenced in the Solver Input Arguments field, for example $file $filebase, and so on. The proper syntax is ${varname}, for example ${m_1.file_2}.

 

hmtoggle_plus1greySpecify a Solver Input File

A Solver Input file is the name of the solver input deck. HyperStudy will create this file for each run from the initial template file, using the current value of the parameters. In HyperStudy, a solver input file is required in order to run the solver. In the Define models step, you can specify what solver input file you would like to run the solver with. To specify a solver input file, enter it in the Solver input file column.

You can enter more than one file to the Solver input file field by separating the files with a semi-colon. In such cases, HyperStudy creates the first file from the parameterization and then copies the others files from its original location into the run directory.

 

hmtoggle_plus1greySelect a Solver Execution Script

HyperStudy uses a solver script to run the model. By default, HyperStudy has the following solver codes registered:

RADIOSS
OptiStruct
Templex
HyperXtrude
MotionSolve - standalone
Python
TCL
HyperMath

 

You need to register solver scripts in cases where:

The solver is not a HyperWorks solver and hence is not registered by default.
You need to perform a series of actions such as copying files, running one or more solvers, and extracting data.

 

You can register solver scripts in HyperStudy or by editing the preference file. For more information on how to register solver script files in HyperStudy, refer to Register Solver Scripts.

 

hmtoggle_plus1greySpecify Solver Input Arguments

A Solver input argument is any argument to be passed to the solver. The default argument is $file, which means that the qualified solver input file name is passed to the solver script.

Some examples of Solver input arguments are listed below. In these examples, $file refers to the solver file that is passed to the solver script.

For RADIOSS, this field might contain:

$file -both

For OptiStruct, this field might contain:

$file -scr C:\temp

For HyperMath, this field might contain:

-f $file

For Excel, this field may contain a macro name

My_Vb_script1

For LS-DYNA, this field might contain:

i=$file MEMORY=5000000

For NASTRAN, this field might contain:

Batch=no

For MADYMO, this field might contain:

-fg <filename>.xml

For solver scripts running on Linux, this field might contain:

-nobg

For Adams, this field might contain:

 

For Abaqus, this field might contain:

job=<filename>.inp memory=200Mb interactive

-In addition, for Abaqus you may need to edit the abaqus environment file (ex: <ABAQUS INSTALL>\v6.11\6.11-1\site\abaqus v6.env) file to include

ask_delete=OFF

or

comment the line ask delete=on if any.

This is needed as Abaqus prompts the user if they want to overwrite the old files when re-running the analysis. In order to eliminate the need for user interaction we need to command Abaqus not to ask this question and overwrite.

 

Solver input arguments are passed to the solver script as separate arguments. The script then treats them as %1 (first argument) , %2 (second argument), and so on. In the following example, file1.txt is the model file updated by HyperStudy, and file2.txt and file3.txt are additional files needed for the solver (that is include files).

2d_plot_filter

Having the three files listed in the Solver input arguments field allows file1.txt to be updated and ensures that all three files are copied into the appropriate folder together. The solver input arguments ensures that $file ( = file1.txt), file2.txt and file3.txt are submitted to the solver script.

Below is a sample solver script (.bat file) for this example:

echo %1

echo %2

echo %3

 

Which results in:

"C:\TEST\nom_run\m_1\file1.txt"

file2.txt

file3.txt

 

It is possible to improve the solver script by using:

%1 = full file name passed by HyperStudy to the solver script

%~n1 = file name without extension and path

%~x1 = file extension

 

or by using a HyperStudy environment variables such as %STUDY_DIR_PATH% (to get the current path) or %STUDY_RUN_NUMBER% (to get the current run number). For others, see Process Environment Variables.

The image below illustrates a Spreadsheet model type with an Excel connection Solver arguments example :

setup_excel

In this example, the macro my_VB_script_1 will be executed for each solver run.

In the case of the Excel connection, Solver input arguments also recognizes a number of environment variables that can be used to pass information to the VB macro used in the spreadsheet.

$file, $filespec

(example: c:\studyfolder\approaches\doe_1\run__00001\plate.fem)

$filebasename

(example: plate.fem)

$studydir

(example: c:\studyfolder)

 

Following the previous example, you can pass the name of the current run folder to the macro.

my_VB_Script1 $filespec

setup_define2

 

 

 

See Also:

HyperStudy Parameterized File