Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to use *DOWHILE command!

Status
Not open for further replies.

hacinilyes

Materials
Jul 26, 2006
14
Hi everybody,
I would like to know how the *DOWHILE command works, and what is the argument "par"?
Thank you.
Lyes
 
Replies continue below

Recommended for you

*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.

-Brian
 
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 ...

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor