Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Try to create a table array for plotting data

Status
Not open for further replies.

plvachon

Mechanical
Jun 16, 2005
38
Hi to all,

I'm trying to plot on a graph the Z displacement of some nodes, with defining a table array to do it. The resulting graph is a kind of kid drawing, but it should not be... I just have a layered plate under four-point bending. I checked out the table I created, and the data is not what it should be: the X position of the nodes is absolutely false (some nodes have the same position) and the Z displacements are weird too... When I'm listing the node results for Z displacement, the results are like I expected them to be and so the X positions. So in brief: the model is correctly programmed, but the information in the table is false... I don't know what I'm doing wrong! Here is the procedure: after solving, in the post-proc., I select the nodes I want and then I create a table and plot data in a graph:

*DIM,graph,TABLE,nb_node,2
*vget,graph(1,1),node,all,loc,x
*vget,graph(1,2),node,all,u,z
*DO,ii,1,nb_node
graph(ii,0)=ii
*ENDDO
graph(0,1)=1
graph(0,2)=2
*vplot,graph(1,1),graph(1,2)
/axlab,x,X ! Change the axis labels
/axlab,y,UZ
/replot

Hope you can help me! Thanks!
 
Replies continue below

Recommended for you

I think you may be getting confused with the usage of the *VGET command. You cannot "select" certain nodes to be filled in your array using this method.

ANSYS Help File said:
*VGET Notes
Retrieves values for specified items and stores the values in an output vector of a user-named array parameter according to:

ParR = f(Entity, ENTNUM, Item1, IT1NUM, Item2, IT2NUM)


where (f) is the *GET function; Entity, Item1, and Item2 are keywords; and ENTNUM, IT1NUM, and IT2NUM are numbers or labels corresponding to the keywords. A starting array location number must be defined for the result array parameter. Looping continues over successive entity numbers (ENTNUM) for the KLOOP default. For example, *VGET,A(1),ELEM,5,CENT,X returns the centroid x-location of element 5 and stores the result in the first location of A. Retrieving continues with element 6, 7, 8, etc. until successive array locations [*VLEN, *VMASK] are filled. Absolute values....

In other words, if you leave the ENTNUM field blank (you have "all" currently which is meaningless for this command), then the *VGET will loop from node 1 until all nodes have been looped upon. It then places this data in numerical order in your TABLE, which you then plot. You're probably storing the correct numbers, but these are being stored by ANSYS in numerical order. I don't know how your model is numbered, but you may be able to fiddle with the KLOOP parameter to get what you need. Try turning the lines in your plot off using:

Code:
 /GTHK,CURVE,-1  
/GROPT,FILL,OFF 
/GROPT,CURL,1   
/GCOLUMN,1, 
/GMARKER,1,3,1,

and see whether the resulting plot makes sense.


------------
See faq569-1083 for details on how to make best use of Eng-Tips.com
 
Hi plvachon!

Try these:

! first select your nodes
! then:
*get, nb_node, node,,count
*DIM,graph,TABLE,nb_node,2
*get, nmin, node,,num,min

*DO,ii,1,nb_node
graph(ii,0)= ii
graph(ii,1)= nx(nmin)
graph(ii,2)= uz(nmin)
nmin= ndnext(nmin)
*ENDDO

graph(0,1)=1
graph(0,2)=2

*vplot,graph(1,1),graph(1,2)
/axlab,x,X ! Change the axis labels
/axlab,y,UZ
/replot
 
Ok that works, thanks for your help! I shall learn about Ansys up to my death!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor