General

General

How to check the eroded elements in an Autodyn model with unstructured parts using User Subroutine

    • FAQFAQ
      Participant

      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 “eroded_element.txt”, 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 “Retain Inertia of Eroded Nodes” 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=”eroded_elements.txt”) 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