ANSYS Mechanical Advances (Using Command Objects) : APDL Commands
ANSYS Mechanical Advances (Using Command Objects) : APDL Commands
APDL Commands
16.0 Release
B. Log File
C. Parameters
D. Control Logic
1. 3.
2. 4.
5.
6.
7.
8.
9.
• Session Editor can also give access to the recorded APDL commands of the current
session.
• See *SET command help in the Commands Reference for a complete listing
• See the *DIM command in the Commands Reference for more details on the
syntax
• To refer to a table array, simply use the same notation as earlier for a
regular array, although instead of using an integer index, use the
interpolation column. For indices outside of the defined range, the last
value will be used.
– FORCE(3.2) will return 560
𝟗 − 𝟖. 𝟓 × 𝟎 − 𝟐𝟑𝟖. 𝟓
– FORCE(9) will give 89.4375 = 𝟐𝟑𝟖. 𝟓 +
𝟗. 𝟑 − 𝟖. 𝟓
– FORCE(9.5) will return 0
– FORCE(7.85) will return ?
ncolon=44
saut=0
*SREAD,newstr,tableau,txt,,,saut
*GET,nlignes,parm,newstr,dim,2
*DIM,temptab,table,nlignes-1,ncolon-1,,time
*TREAD,temptab,tableau,txt,,saut
27 © 2015 ANSYS, Inc. March 23, 2016 Release 16.0
… Assigning Values to Strings
• Strings can be given a value simply by referring to the first index
– MYSTRING(1)=‘Here is a long string’
• The use of any other index will replace the contents from that character
– If the above command was executed, then the following was issued:
MYSTRING(9)=‘changed text’
then the resulting string would be ‘Here is achanged text’
• See “Appendix B. GET Function Summary” in the APDL Programmer’s Guide in the
Mechanical APDL help for a complete listing.
Example
Save the nodal deformations in
an array:
– *VOPER command is used to operate on two vectors with the result as one vector.
Adding or comparing vectors is an example where the output will be another vector.
– *VFUN command is used to operate on one vector with the result as one vector.
Taking the cosine of a vector is an example.
– *VSCFUN command is used to operate on one vector with the result as one scalar parameter.
Taking the sum, standard deviation, or max value of a vector is an example where the output is a
scalar parameter.
• Matrix operations using *MOPER, *MFUN, and *MFOURI are also available.
*VOPER,C(1),A(1,2),ADD,B(1,1)
*VFUN,C(1),COS,A(1,3)
*VSCFUN,value,SUM,B(1,2) value = 15
PARSAV
PARRES
/POST1
SET,last
*GET,nb_nodes,NODE,0,count
Nd_current = 0
Seqv_max = 0
*DO,I,1,nb_nodes
Nd_current = NDNEXT(Nd_current)
*GET,Seqv_current,NODE,Nd_current,S,EQV
*IF,Seqv_current,GT,Seqv_max,then
Seqv_max=Seqv_current
*ENDIF
*ENDDO