


{"id":319857,"date":"2023-11-28T19:05:10","date_gmt":"2023-11-28T19:05:10","guid":{"rendered":"\/forum\/forums\/topic\/grouping-elements-with-a-command-in-apdl\/"},"modified":"2023-11-28T19:05:10","modified_gmt":"2023-11-28T19:05:10","slug":"grouping-elements-with-a-command-in-apdl","status":"closed","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/grouping-elements-with-a-command-in-apdl\/","title":{"rendered":"Grouping elements with a command in APDL"},"content":{"rendered":"<p>Good morning everyone.<\/p>\n<p>I hope I have chosen the right section, if not then please correct me.<\/p>\n<p>I am looking for an expert who is well versed in writing scripts in APDL inside Workbench. I&#8217;m doing a thermal-structural analysis and have encountered the following problem. I have a temperature distribution from the &#8220;transient thermal&#8221; modules. I imported the result of the last calculation step into the &#8220;transient structural&#8221; module. Inside the &#8220;transient structural&#8221; module, I want to divide the finite elements into groups according to what temperature they have. To do this, I wrote APDL code that looks like the following (this is a piece of code that later based on the groups assigns them the appropriate critical value and kills the elements):<\/p>\n<p>group1=0<br \/>group2=0<br \/>group3=0<br \/>group4=0<br \/>group5=0<br \/>group6=0<br \/>group7=0<\/p>\n<p>*get, NUMELEM, ELEM, 0, COUNT<\/p>\n<p>*do, i, 1, NUMELEM<br \/>&nbsp; *get, temp_val, elem, i, temp&nbsp; <\/p>\n<p>&nbsp; ! Group 1<br \/>&nbsp; *if, temp_val, le, 20<br \/>&nbsp; &nbsp; *if, temp_val, gt, 0<br \/>&nbsp; &nbsp; &nbsp; group1 = 1<br \/>&nbsp; &nbsp; *endif<\/p>\n<p>&nbsp; ! Group 2<br \/>&nbsp; *if, temp_val, le, 0<br \/>&nbsp; &nbsp; *if, temp_val, gt, -40<br \/>&nbsp; &nbsp; &nbsp; group2 = 1<br \/>&nbsp; &nbsp; *endif<\/p>\n<p>&nbsp; ! Group 3<br \/>&nbsp; *if, temp_val, le, -40<br \/>&nbsp; &nbsp; *if, temp_val, gt, -60<br \/>&nbsp; &nbsp; &nbsp; group3 = 1<br \/>&nbsp; &nbsp; *endif<\/p>\n<p>&nbsp; ! Group 4<br \/>&nbsp; *if, temp_val, le, -60<br \/>&nbsp; &nbsp; *if, temp_val, gt, -100<br \/>&nbsp; &nbsp; &nbsp; group4 = 1<br \/>&nbsp; &nbsp; *endif<\/p>\n<p>&nbsp; ! Group 5<br \/>&nbsp; *if, temp_val, le, -100<br \/>&nbsp; &nbsp; *if, temp_val, gt, -130<br \/>&nbsp; &nbsp; &nbsp; group5 = 1<br \/>&nbsp; &nbsp; *endif<\/p>\n<p>&nbsp; ! Group 6<br \/>&nbsp; *if, temp_val, le, -130<br \/>&nbsp; &nbsp; *if, temp_val, gt, -160<br \/>&nbsp; &nbsp; &nbsp; group6 = 1<br \/>&nbsp; &nbsp; *endif<\/p>\n<p>&nbsp; ! Group 7<br \/>&nbsp; *if, temp_val, le, -160<br \/>&nbsp; &nbsp; group7 = 1<br \/>&nbsp; *endif<br \/>*enddo<\/p>\n<p>cmgroup,group1,1<br \/>cmgroup,group2,2<br \/>cmgroup,group3,3<br \/>cmgroup,group4,4<br \/>cmgroup,group5,5<br \/>cmgroup,group6,6<br \/>cmgroup,group7,7<\/p>\n<p>I get the following error, which I can&#8217;t solve myself:<\/p>\n<p>&#8220;Unknown label in field 5 ( temp ) of *GET command.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br \/>&nbsp; Line= *get, temp_val, elem, i, temp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br \/>&nbsp; The *GET command is ignored.&#8221;<\/p>\n<p>I&#8217;m hoping to find someone here who can help me fix it.&nbsp;<\/p>\n","protected":false},"template":"","class_list":["post-319857","topic","type-topic","status-closed","hentry"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_bbp_subscription":["303137","20905"],"_bbp_author_ip":["23.206.193.146"]," _bbp_last_reply_id":["0"]," _bbp_likes_count":["0"],"_btv_view_count":["1497"],"_bbp_topic_status":["unanswered"],"_bbp_status":["publish"],"_bbp_topic_id":["319857"],"_bbp_forum_id":["27791"],"_bbp_engagement":["20905","303137"],"_bbp_voice_count":["2"],"_bbp_reply_count":["1"],"_bbp_last_reply_id":["320071"],"_bbp_last_active_id":["320071"],"_bbp_last_active_time":["2023-11-29 14:18:23"]},"test":"s177000student-pg-edu-pl"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/319857","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics"}],"about":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/319857\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=319857"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}