How can I check my components to see if they include multiple element types?


The input below creates a string array of the component names and a data array
with 5 columns. If the cm type is nodes then column 2 contains the number of nodes,
and if the cm type is elements then column 2 contains the number of elements,
column 3 contains the element enam number for the lowest numbered element,
column 4 contains the count of that elements in the component of that enam, and
column 5 is the difference between the count of elements in the component and
those of the enam. If column 5 is non-zero then the component has multiple element
enam types. See the string array in the matching row number for the component name.


resume
cmsel,all
*get,n_cmp,comp,,ncomp
!
*dim,c_nam,string,128,n_cmp
*dim,c_dat,array,n_cmp,5
! col1 cm type of 1 node , 2 elem
! col2 selected entities
! col3 elem enam
! col4 elems of type equal to enam
! col5 elems not of type equal to enam
*do,jj,1,n_cmp
!/gopr
*get,c_nam(1,jj),comp,jj,name
*get,c_dat(jj,1),comp,c_nam(1,jj),type
cmsel,s,c_nam(1,jj)
cmlist
!
*if,c_dat(jj,1),eq,1,then
*get,c_dat(jj,2),node,,count
*elseif,c_dat(jj,1),eq,2
*get,c_dat(jj,2),elem,,count
*get,c_emint,elem,elnext(0),attr,type
*get,c_dat(jj,3),etyp,c_emint,attr,enam
esel,r,enam,,c_dat(jj,3)
*get,c_dat(jj,4),elem,,count
c_dat(jj,5)=c_dat(jj,2)-c_dat(jj,4)
*endif
allsel
cmsel,all
*enddo
fini
parsav,all
/exit,nosa





Show Form
No comments yet. Be the first to add a comment!