Ansys Assistant will be unavailable on the Learning Forum starting January 30. An upgraded version is coming soon. We apologize for any inconvenience and appreciate your patience. Stay tuned for updates.
General Mechanical

General Mechanical

Topics related to Mechanical Enterprise, Motion, Additive Print and more.

Problem with getting list of all nodes in element

    • Koen_Franse
      Subscriber
      Hi all,nI'm trying to create a list of all elements, their center coordinate and the included nodes in an APDL input file script. I now have the following, but I'm getting an error:n/post1n*dim,_data_elem,table,_nrElem,14 ! Initialize a table to store the datan*vget,ELEMLIST,ELEM,ALL,ELISTnn! Loop over all elements to extract datan*do,n,1,_nrElem,1n *get,_data_elem(n,1),ELEM,ELEMLIST(n),CENT,Xn *get,_data_elem(n,2),ELEM,ELEMLIST(n),CENT,Yn *get,_data_elem(n,3),ELEM,ELEMLIST(n),CENT,Znn esel,s,,,ELEMLIST(n)n nsle,alln *get,_nrNodesInElem,NODE,0,count ! Get the total number of nodes in elementn *vget,NodesInElem,NODE,ALL,NLIST ! Get node list of selected elementn *do,nNE,1,_nrNodesInElemn cnum = 3+nNE n *SET,_data_elem(n,cnum),(NodesInElem(nNE))n *end don*end donnHowever, I'm getting the following errors:n *** ERROR *** CP = 5.328 TIME= 15:13:56n Subscript range error. Parameter NODESINELEM is dimensioned as 3, but location 4 is being requested nn *** ERROR *** CP = 5.328 TIME= 15:13:56n No data exists for dimensioned parameter NODESINELEM with subscript 4.nnApparently the _nrNodesInElem variable says there are 4 nodes in the element, but the list of nodes only contains 3. Anybody an idea what I'm doing wrong?.Thanks, Koenn
    • Koen_Franse
      Subscriber
      I found something that might potentially be causing the problem:my mesh contains contains some 2D triangle and some rectangular elements, and in my input file I saw that the triangular elements are defined as the following:nn/wb,elem,start      ! set before creation of elementsn/com,*********** Elements for Body 1 connective ***********net,1,182nkeyo,1,3,3neblock,19,solid,,375n(19i9)n    1    1    1    1    0    0    0    0    4    0    1   851   1067   1066   1066n    1    1    1    1    0    0    0    0    4    0    2   859   1072   1071   1071n    1    1    1    1    0    0    0    0    4    0    3   869   1078   1077   1077n.....nnSo one node is double in this list, which explains why _nrNodesInElem is 4 while the NodesInElem array in only 3 in size.
Viewing 1 reply thread
  • The topic ‘Problem with getting list of all nodes in element’ is closed to new replies.
[bingo_chatbox]