{"id":165154,"date":"2023-03-17T08:59:34","date_gmt":"2023-03-17T08:59:34","guid":{"rendered":"\/knowledge\/forums\/topic\/how-to-check-the-eroded-elements-in-an-autodyn-model-with-unstructured-parts-using-user-subroutine\/"},"modified":"2023-07-31T12:30:42","modified_gmt":"2023-07-31T12:30:42","slug":"how-to-check-the-eroded-elements-in-an-autodyn-model-with-unstructured-parts-using-user-subroutine","status":"publish","type":"topic","link":"https:\/\/innovationspace.ansys.com\/knowledge\/forums\/topic\/how-to-check-the-eroded-elements-in-an-autodyn-model-with-unstructured-parts-using-user-subroutine\/","title":{"rendered":"How to check the eroded elements in an Autodyn model with unstructured parts using User Subroutine"},"content":{"rendered":"<p>The subroutine example below loops over the elements of all unstructured parts in an Autodyn model. The subroutine checks for each element whether it has been eroded or not. If yes, then the part Id, element Id, the mass and the erosion flag of the element are written to a file &#8220;eroded_element.txt&#8221;, which is saved in the Autodyn ad_usrsub.exe directory. the variable erosion_flag is checking the status of the elements. If erosion flag gets a value of 1 or 2, this means that the element has been eroded. A value of 1 means that the option &#8220;Retain Inertia of Eroded Nodes&#8221; for the element is active and a value of two means that the option is deactivated for the current element.  ! BEGIN EXAMPLE        SUBROUTINE EXEDIT3        USE kindef       USE wrapup       USE mdpart       USE mdvar_all       USE cycvar       USE mdsolv        IMPLICIT NONE              INTEGER (INT4) :: np, ne, intpoi, nenum       INTEGER (INT4) :: erosion_flag       REAL (REAL8) :: mass        open(20, file=&#8221;eroded_elements.txt&#8221;)              do np = 1, num_parts          do ne = 1, parts(np)%p%numelm            nenum = parts(np)%p%element_list(ne)            intpoi = 0            call get_elem_var(nenum,intpoi)            mass = rvl(ivr_mass)            erosion_flag = ivl(ivi_erosion)            ! erosion_flag == 1: eroded element while retaining inertia, 2: eroded but not retaining ineratia            if (erosion_flag .eq. 1 .or. erosion_flag .eq. 2) write(20,*) np, ne, mass, erosion_flag          end do       end do              close(20)              RETURN        END SUBROUTINE EXEDIT3  ! END EXAMPLE<\/p>\n","protected":false},"template":"","class_list":["post-165154","topic","type-topic","status-publish","hentry","topic-tag-4391","topic-tag-autodyn","topic-tag-explicit-autodyn","topic-tag-structural-mechanics","topic-tag-user-programmable-autodyn"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_wp_page_template":["default"],"_bbp_last_active_time":["3\/15\/2023 20:20"],"_bbp_forum_id":["27789"],"_bbp_author_ip":["23.56.168.180"],"_btv_view_count":["826"],"siebel_km_number":["2053565"],"product_version":["19"],"km_published_date":["2018-03-14T00:00:00.000Z"],"family":["Structural Mechanics"],"application_name":["AUTODYN"]},"test":"articlesansys-com"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/topics\/165154","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/topics"}],"about":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/topics\/165154\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/media?parent=165154"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}