TAGGED: mechanical-apdl, post-processing
-
-
October 1, 2020 at 1:48 pm
Koen_Franse
SubscriberHi 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 -
October 2, 2020 at 8:48 am
Koen_Franse
SubscriberI 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.
Innovation Space
Trending discussions
Top Contributors
-
6515
-
1906
-
1463
-
1309
-
1022
Top Rated Tags
© 2026 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.