Commands require various arguments, including numbers, filenames, yes/no responses, character strings, and lists. A uniform interface to this input is provided by the text prompt system. A prompt consists of a prompt string, followed by an optional units string enclosed in parentheses, followed by a default value enclosed in square brackets. The following shows some examples of prompts:
filled-mesh? [no] Enter shrink-factor [0.1] Enter line-weight [1] Enter title [""]Enter
The default value for a prompt is accepted by pressing Enter on the
keyboard or typing a ,
(comma).
Important: Note that a comma is not a separator. It is a separate token that indicates a default
value. The sequence “ 1,2
” results in three values; the
number 1 for the first prompt, the default value for the second prompt, and the number 2 for the
third prompt.
A short help message can be displayed at any prompt by entering a
?
. (See Using the Text Interface Help System.)
To abort a prompt sequence, simply press Ctrl+c.
The most common prompt type is a number. Numbers can be either integers or real numbers. Valid numbers are, for example, 16
, -2.4
, .9e5
, and +1e-5
.
Integers can also be specified in binary, octal, and hexadecimal form.
The decimal integer 31 can be entered as
31
,#b11111
,#o37
, or#x1f
.In Scheme, integers are a subset of reals, so you do not need a decimal point to indicate that a number is real;
2
is just as much a real as2.0
.If you enter a real number at an integer prompt, any fractional part will be truncated. For example,
1.9
will become1
.
Some prompts require a yes-or-no response. A yes/no prompt will accept either
yes
or y
for a positive response, and
no
or n
for a negative response. Yes/no
prompts are used for confirming potentially dangerous actions such as overwriting an existing
file, exiting without saving case, data, mesh, and so on.
Some prompts require actual Scheme Boolean values (true or false). These are entered with
the Scheme symbols for true and false, #t
and
#f
.
Character strings are entered in double quotes, for example,
“red”
. Plot titles and plot legend titles are examples
of character strings. Character strings can include any characters, including blank spaces and
punctuation.
Symbols are entered without quotes. Zone names, surface names, and material names are examples of symbols. Symbols must start with an alphabetical character (that is, a letter), and cannot include any blank spaces or commas.
You can use wild cards to specify zone names when using the TUI. Some examples are:
*
will translate as “all zones”.For example,
/display/boundary-grid *
enables you to display all the boundary zones in the mesh./boundary/delete-island-faces wrap*
enables you to delete island faces on all zones prefixed bywrap
.
>
will translate as “all zones visible in the graphics window”.For example,
/boundary/manage/delete >, yes
enables you to delete all visible zones.^
will translate as “all zones selected in the graphics window”.For example,
/boundary/manage/delete ^, yes
enables you to delete all selected zones.[object_name
will translate as “all zones with the name object_name”.For example,
/boundary/manage/delete [box, yes
enables you to delete all zones of an object with the name box.[object_name/label_name
will translate as "all zones with label_name of object_name"For example,
/boundary/manage/delete [fluid/box*, yes
enables you to delete all zones of an object with the name fluid and comprising face zone labels box*.
If you use a wild card for an operation that requires a single zone as input, you will be prompted to specify a single zone from the list of those that match the expression specified.
> /boundary/manage/name wall*
<Enter>
wall-1 wall-3 wall-5
wall-2 wall-4 wall-6
Zone Name [ ]
Filenames are actually just character strings. For convenience, filename prompts do not require the string to be surrounded with double quotes. If, for some exceptional reason, a filename contains an embedded space character, then the name must be surrounded with double quotes.
One consequence of this convenience is that filename prompts do not evaluate the response. For example, the sequence
>(define fn "valve.ps")
fn >hc fn
Will end up writing a picture file with the name fn
, not
valve.ps
. Since the filename prompt did not evaluate the response,
fn
did not get a chance to evaluate
“valve.ps”
as it would for most other prompts.
Some functions in Ansys Fluent require a “list” of objects such as numbers,
strings, Booleans, and so on. A list is a Scheme object that is simply a sequence of objects
terminated by the empty list, ’()
. Lists are prompted for an
element at a time, and the end of the list is signaled by entering an empty list. This
terminating list forms the tail of the prompted list, and can either be empty or can contain
values. For convenience, the empty list can be entered as ()
as well as
the standard form ’()
. Normally, list prompts save the previous
argument list as the default. To modify the list, overwrite the desired elements and terminate
the process with an empty list. For example,
element(1) [()]1
element(2) [()]10
element(3) [()]100
element(4) [()] Enter
Creates a list of three numbers: 1, 10, and 100. Subsequently,
element(1) [1] Enter
element(2) [10] Enter
element(3) [100] Enter
element(4) [()] 1000
element(5) [()] Enter
Adds a fourth element. Then
element(1) [1] Enter
element(2) [10] Enter
element(3) [100] ()
Leaves only 1 and 10 in the list. Subsequently entering
element(1) [1] ,,’(11 12 13)
Creates a five element list: 1, 10, 11, 12, and 13. Finally, a single empty list removes all elements
element(1) [1] ()
A different type of list, namely, a “list-of-scalars” contains pick menu items (and not list items) for which a selection has to be made from listed quantities, which are available at the Enter prompt. Hence, a list-of-scalars cannot be entered as a list.
An example of a “list-of-scalars” consists of the following:
All responses to prompts (except filenames, see above) are evaluated by the Scheme interpreter before they are used. You can therefore enter any valid Scheme expression as the response to a prompt. For example, to enter a unit vector with one component equal to 1/3 (without using your calculator),
/foo>set-xy
x-component [1.0](/ 1 3)
y-component [0.0](sqrt (/ 8 9))
Or, you could first define a utility function to compute the second component of a unit vector,
>(define (unit-y x) (sqrt (- 1.0 (* x x))))
unit-y /foo>set-xy
x-component [1.0](/ 1 3)
y-component [0.0](unit-y (/ 1 3))