1 / 8

CHAPTER 3 Reuse of Commands & Branching

CHAPTER 3 Reuse of Commands & Branching. Repeating a Command. *REPEAT, NTOT, VINC1, VINC2, …, VINC11 NTOT : Number of times the preceding command is executed (including the initial execution). Must be 2 or greater. NTOT of 2 causes one repeat (for a total of 2 executions).

gabe
Télécharger la présentation

CHAPTER 3 Reuse of Commands & Branching

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CHAPTER 3 Reuse of Commands & Branching Written by Changhyun, SON

  2. Repeating a Command *REPEAT, NTOT, VINC1, VINC2, …, VINC11 NTOT : Number of times the preceding command is executed (including the initial execution). Must be 2 or greater. NTOT of 2 causes one repeat (for a total of 2 executions). VINC1, VINC2, ..., VINC11 : Value increments applied to first through eleventh data fields of the preceding command E,1,2,3,4 *REPEAT,4,1,10,1,20 Written by Changhyun, SON

  3. Do-loops *DO,Par,IVAL,FVAL,INC . . . . . . *ENDDO Do-loops can be input interactively and can also be nested up to ten levels deeps. *DIM,XX2ANDX3,,10,3 *DO,ROW,1,10,1 *DO,COL,1,3,1 XX2ANDX3(ROW,COL)=ROW**COL *ENDDO *ENDDO Written by Changhyun, SON

  4. IF-THEN-ELSE Constructs *IF, VAL1, Oper, VAL2, Base . . . . . . *ELSEIF, VAL3, Oper, VAL4 . . . . . . *ELSE . . . . . . *ENDIF Oper : LT, LE, EQ, GE, GT Base : THEN, CYCLE, EXIT, STOP, :Label IF-THEN-ELSE constructs can be nested up to 10 levels deep. Written by Changhyun, SON

  5. Loop ControlBase Option IF-THEN-ELSE Construct THEN - Signifies that this is the beginning of an IF-THEN-ELSE construct CYCLE - Used only inside a do-loop; equivalent to a conditional *CYCLE command EXIT - Used only inside a do-loop; equivalent to a conditional *EXIT command STOP - Immediately stop and exit the ANSYS program :Label - Read the next command from the line following this user defined label (8 characters maximum) Written by Changhyun, SON

  6. Abbreviation *ABBR,Abbr,String *ABBR,NNON,/PNUM,NODE,ON *ABBR,NNOFF,/PNUM,NODE,OFF *ABBR,ENON,/PNUM,ELEM,ON *ABBR,ENOFF,/PNUM,ELEM,OFF . . . NNON NPLOT NNOFF Written by Changhyun, SON

  7. Start FORCE PRESSURE PRESSURE > 20 FORCE > 100 FORCE < 50 FORCE PRESSURE 50 < FORCE < 100 PRESSURE < 20 PRESSURE > 50 PRESSURE PRESSURE < 50 WIDTH = 10 LENGTH = 2 WIDTH = 8 LENGTH = 1.2 Exercise Written by Changhyun, SON

  8. Input File :restart *ask,force,’FORCE = ’ *ask,pressure,’PRESSURE = ’ *if,force,le,50,then *if,pressure,le,20,then width=8.0 length=1.2 *endif *elseif,force,le,100 *if,pressure,le,50,then width=10.0 length=2.0 *endif *else *go,:restart *endif Written by Changhyun, SON

More Related