*DOWHILE repeats a loop until a certain condition either is or is not meant. This is the same principal as a "while" type of DO loop in Fortran. You need to have a conditional statement which sets a parameter value depending on whether a condition is or is not meant somewhere in your loop. This is typically done with an *IF construct. Whenever the parameter (the 'par' argument) equals zero the loop exits. *DOWHILE is used when you don't know the number of times a loop should be executed, rather you know it should be exectued until a condition is true or not. Take a look on the web for some Fortran examples using a WHILE type of DO construct if you're still unclear.
Hi Brain,
I'm familiar with the WHILE loop in Fortran, but my problem is that I don't know how tu use the 'par' argument. In Fortran, we could write:
WHILE,A,LT,B,THEN
....
ENDWHILE
But with *DOWHILE in Ansys there is just the 'par' argument! why the loop exit when arg is equal to zero only? I don't understand the role of this parameter!
Lyes.
Hi,
'par' is a boolean control parameter. 0 = "False", so the loop ends. Any other number is equivalent to 1 = "True", so the loop goes on.
It's the same concept as, for example, in VB when you write something like
... if not my_parameter then ...