*IF, VAL1
, Oper1
, VAL2
, Base1
, VAL3
, Oper2
, VAL4
, Base2
Conditionally causes commands to be read.
VAL1
First numerical value (or parameter which evaluates
to a numerical value) in the conditional comparison operation. VAL1
, VAL2
, VAL3
, and VAL4
can also
be character strings (enclosed in quotes) or parameters for Oper
= EQ and NE only.
Oper1
Operation label. A tolerance of 1.0E-10 is used for comparisons between real numbers:
Equal (for VAL1
= VAL2
).
Not equal (for VAL1
≠ VAL2
).
Less than (for VAL1
< VAL2
).
Greater than (for VAL1
> VAL2
).
Less than or equal (for VAL1
VAL2
).
Greater than or equal
(for VAL1
VAL2
).
Absolute values of VAL1
and VAL2
before <
operation.
Absolute values of VAL1
and VAL2
before >
operation.
VAL2
Second numerical value (or parameter which evaluates to a numerical value) in the conditional comparison operation.
Base1
Action based on the logical expression (Oper1
) being true. If false, continue reading at the
next line. This is conditional, except for the IF-THEN-ELSE constructs
described below; any of the following constructs (through Base1
= THEN) cause all subsequent fields to be ignored:
label --
A user-defined label (beginning with a colon (:), 8 characters
maximum). The command reader will skip (and wrap to the beginning
of the file, if necessary) to the first line that begins with the
matching :label
.
Caution: This label option may not be mixed with do-loop or if-then-else constructs.
This action will cause an exit from the ANSYS program at this line, unless running in interactive mode. In interactive mode, the program will not stop.
Exit the current do-loop [*EXIT].
Skip to the end of the current do-loop [*CYCLE].
Make this *IF an if-then-else construct (see below).
The following optional values determine
the connection between the two logical clauses Oper1
and Oper2
True if both clauses (Oper1
and Oper2
) are true.
True if either clause is true.
True if either (but not both) clause is true.
VAL3
Third numerical value (or parameter which evaluates to a numerical value).
Oper2
Operation label. This will have the same labels as Oper1
, except it uses Val3
and Val4
. A tolerance of 1.0E-10 is used
for comparisons between real numbers.
VAL4
Fourth numerical value (or parameter value which evaluates to a numerical value).
Base2
Action based on the logical expression (Oper1
and Oper2
) being true.
They will be the same values as Base1
,
except as noted.
Conditionally causes commands to be read from a specific block
or at a specific location. Twenty levels of nested *IF blocks are allowed. Jumping to a :label
line is not allowed with keyboard entry. Jumping into, out of,
or within a do-loop or an if-then-else construct to a :label
line is not allowed. Using *IF interactively or from the command line prevents rereading the file
to find a label
. To do so, use batch mode
or /INPUT.
The following is an example of an if-then-else construct:
*IF,VAL1
,Oper
,VAL2
,THEN
----
*ELSEIF,VAL1
,Oper
,VAL2
----
*ELSEIF,VAL1
,Oper
,VAL2
----
----
where "----" represents a block of any number of commands. Any number of *ELSEIF clauses (or none) may be included (in the location shown). One *ELSE clause (at most) may be included (in the location shown). The *IF command is executed by evaluating its logical expression. If it is true, the block of commands following it is executed. The construct is considered to be complete and the command following the *ENDIF is executed next. If the logical expression is false, the next *ELSEIF command (if any) following the block is executed. The execution logic is the same as for *IF. The effect is that the logical expressions in the *IF and the *ELSEIF commands are sequentially tested until one is found to be true. Then the block of commands immediately following the expression is executed, which completes the execution of the if-then-else construct. If all *IF and *ELSEIF expressions are false, the block following the *ELSE command is executed, if there is one. Only one block of commands (at most) is executed within the if-then-else construct. If a batch input stream hits an end-of-file during a false *IF condition, the ANSYS run will not terminate normally. You will need to terminate it externally (use either the Linux “kill” function or the Windows task manager). The *IF, *ELSEIF, *ELSE, and *ENDIF commands for each if-then-else construct must all be read from the same file (or keyboard).
This command is valid in any processor.