USim has the ability to create key parameters. These variables are visible in the Editor pane of the Setup tab in USimComposer, and they can be modified without the user having to sift through the input file (also called the pre file). They are useful when creating a base simulation that can be easily modified to simulate different phenomena within the same base simulation. This tutorial is for power users who wish to use key parameters within their own simulations and who are familiar with the USimComposer Introduction. As preparation for a discussion of key parameters, the user must be comfortable with accessing the input file, as discussed in Pre File Syntax.
The two main components of the key parameters feature are the XSim block and the XVar block. An example XSim block in a run space input file is boxed in red in the below figure, and an example XVar block is boxed in blue.
A description of the elements of these blocks and their effect on the Parameters view in the USimComposer Setup tab is given in the following sections.
Given below is a template XSim block that can be modified to fit any file:
<XSim simulationName>
shortDescription = "Simulation Name"
description = "Description of the simulation."
longDescription = "Longer description of the simulation."
image = "simulationName.png"
thumbnail = "simulationNameTn.png"
</XSim>
Each line in this block is explained below:
The three following parameters are only useful to very advanced users who are creating, and placing input files in the Examples directory of USimComposer. The examples directory can be found in [USimInstallDirectory]ContentsExamples.
Key parameters can be created in the input, or .pre, file of a USim simulation, and appear in the Setup tab in USimComposer as seen below boxed in red.
To create these parameters, the user must modify the .pre file and add XVar blocks, in the same way that the user must add an XSim block as described in the preceding section. It is the practice of Tech-X developers to first declare the primary variables with a default value, then give the XVar blocks for the primary variables below that. Given below is a template XVar block that can be modified to fit any file:
$ variableName = default value
<XVar variableName>
description = "Description of the variable"
min = minimum value
max = maximum value
</XVar>
Each line in this block is explained below:
Note that the name of the key parameter will turn red if there is no value given for the parameter, or if the value is not greater than or equal to min and less than or equal to max, if they are specified.