Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

*GET with implied loop

Status
Not open for further replies.

jkupka84

Mechanical
Apr 15, 2014
40
Hi
I try to get temperature for x nodes via implied loop like that

Code:
*GET,Par(1:x),NODE,N(1:x),BFE,TEMP

this command writes temperature only for the last node x. ANSYS output Windows shows me correct values for each node but I am unable to write them all to variable Par.

Is it possible to do such thing or I have to use classic *DO do-loop?

Best regards
JK
 
Replies continue below

Recommended for you

Hi,

I am not sure that your command will work, I have never seen syntax like this in APDL.
You do not have to use *do loop, look at *vget command, you can use it like

*VGET, ParR, NODE, n,TEMP

where ParR is ARRAY (defined via *DIM command) and n entity nuber (usualy n=1)

The advantage is, that *vget is much faster than *do loop.

Regards,

Petr



Petr Vymlatil (
 
Hi Petr,
Implied (colon) Do Loops is documented in help at chapter 5.4. Controlling Program Flow in APDL, respectively 5.4.6. Implied (colon) Do Loops in my ANSYS 13.0 Help (yeah I use still this old version).

I do some research do optimize my macro. Changing do-loops indexing and sorting the operation I was able to reduce my time of the processing the code about 40%. On the web I found notes about this Implied do-loops which make the code more readable, simpler and even faster.

I use this implied do-loops and it works pretty well for some operations, e.g. get material data, reaction force. But when I use it to get for e.g. temperature or stress I get error. I see right values in the output window but the values are not save to the variable.

Back to your hint. *VGET command didn't cross my mind. I can try do some *VGET *VMASK magic to achieve my requirements and I'll see what happen. I have to confess my nodes of interest are non-continuous.

I'll keep you posted.
JK
 
Hi,
I did some test of implied do-loop with following results:

- some commands work only as sequence of continuous range numbers e.g.

Code:
ELEMTNUMBER(1:N)=ENEARN(Nmin:Nmax)

where N is length of the range <Nmin,Nmax>, Nmin, Nmax is node numbers.

- some commands work as array index position, e.g.

Code:
*GET,MATID(1:N),ELEM,ELEMNUMBER(1:N),ATTR,MAT

the code looks to array ELEMNUMBER in position 1,2,..,N and grab material assigned number of element number in position N.

- some commands work not clearly, e.g.

Code:
*GET,Par(1:N),NODE,NODENUMBER(1:N),S,X

the code looks at array NODENUMBER in position 1 and grab stress of node in position 1. Next step add 1 to node number in position 1. So if I have array with node number [100,130,5] the result will be for node number [100,101,102].

My conclusion is that I do something wrong or the behaviour of the command is not clear. For my purpose it is necessary to change numbering of the item of the interest and than work with continuous range. Please correct me if I am wrong.

Petr mentioned to use command *VGET so I dig into this command and found another command *MOPER which works insanely fast (I cut the extraction of the results from 350 s to 20 s) and it suit for my needs. So I used the combination of commands

Code:
*MOPER,ParR,Par1,INTP,Par2
*MOPER,ParR,Par1,SGET,Par2,Label,Comp

Best regards
JK

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor